Topic: mount with ntfs-3g

searched in the forum but couldn't find any useful info.
mounting with
  ntfs-3g /dev/sdc2 /mnt/ntfspart -o rw
works but mounting with
  mount -t nfts-3g /dev/sdc2 /mnt/ntfspart -o rw
or
  mount -t fuse /dev/sdc2 /mnt/ntfspart -o rw,defaults,locale=de.DE.utf8,umask=000
does not.

any pointers?

ps I can mount with the kmod-fs-ntfs but this is not what I want

All the waiting and then the CPU ventilator brrrrrr all the time.

Re: mount with ntfs-3g

To mount '-t nfts-3g /dev/sdc2 /mnt/ntfspart -o rw'
You can just make a symlink like this:
ln -s /usr/bin/ntfs-3g /sbin/mount.ntfs-3g

I have made and use this patch that does this under compiling. I'm not sure if this is the proper or right way to do it, but it works for me, and I can mount ntfs-3g within LuCI.

--- feeds/packages/utils/ntfs-3g/Makefile       2010-03-30 02:19:20.000000000 +$
+++ feeds/packages/utils/ntfs-3g/Makefile       2010-03-30 01:24:42.000000000 +$
@@ -109,6 +109,8 @@
define Package/ntfs-3g/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
+       mkdir  $(1)/sbin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g $(1)/sbin/mount.ntfs-3g
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
endef

Re: mount with ntfs-3g

yes this trick with the ln was the first thing I tried but it didn't work. So I'm quite unsure if your patch will do any better...

All the waiting and then the CPU ventilator brrrrrr all the time.

4 (edited by Protx 2010-05-06 23:44:22)

Re: mount with ntfs-3g

You are absolutely right it won't work, because I forgot to mention that you have to add:
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_HELPERS=y
in your config file or do it in the busybox settings, and compile.

Re: mount with ntfs-3g

Protx wrote:

You are absolutely right it won't work, because I forgot to mention that you have to add:
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_HELPERS=y
in your config file or do it in the busybox settings, and compile.

I've recompiled busybox with this switch and now ln -s works. Thank you for the hint

All the waiting and then the CPU ventilator brrrrrr all the time.

Re: mount with ntfs-3g

flux wrote:
Protx wrote:

You are absolutely right it won't work, because I forgot to mention that you have to add:
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_HELPERS=y
in your config file or do it in the busybox settings, and compile.

I've recompiled busybox with this switch and now ln -s works. Thank you for the hint

do you know the size difference between the two busybox (with and without this setting)?

Re: mount with ntfs-3g

zorxd wrote:

do you know the size difference between the two busybox (with and without this setting)?

old size - 363177
new size - 366069

its for x86 platform

All the waiting and then the CPU ventilator brrrrrr all the time.

Re: mount with ntfs-3g

Hi!
I also want to mount ntfs with ntfs-3g under luci, but i don't know where is must add CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_HELPERS=y. In wiche diretory can i find this config file?

9

Re: mount with ntfs-3g

In the build-system. You have to build a image by yourself. It's a menuconfig option.

Re: mount with ntfs-3g

Okay, Thank you for the fast replay.

I don't have a Linux and can't build my own OpenWrt.config. Is there a other way get ntfs-3g work in Luci or automount it?

11

Re: mount with ntfs-3g

Install Linux in a virtual machine. That's enough...

Re: mount with ntfs-3g

I am a Linux noob and have nerver before compilet a file. Is it possibel to make the changs in the openwrtbuilder?

13

Re: mount with ntfs-3g

Then it's time to start compiling by yourself smile

Re: mount with ntfs-3g

at least on buffalo wzr it is possible to automount with hotplug instead of mount

Re: mount with ntfs-3g

Hi vladkon, how were you able to automount with hotplug.d?  It fails for me, even after adding a sleep 20 in the script.  It works fine in init.d as a script run as 99 however (example 99-usb).

16 (edited by vladkon 2010-07-19 13:07:16)

Re: mount with ntfs-3g

yes i'm able to automount with hotplug. works fine for me. see here on how to configure it http://blog.podspring.com/?tag=openwrt

Re: mount with ntfs-3g

I also tried manipulate my /etc/hotplug.d/block/xx-mount script and it works.

#!/bin/sh
# Copyright (C) 2009-2010 OpenWrt.org
# Copyright (C) 2010 Vertical Communications
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

. /lib/functions/block.sh

blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then

    device=`basename $DEVPATH`

    case "$ACTION" in
        add)

                local from_fstab
                local anon_mount
                local anon_swap
                local anon_fsck
                local mds_mount_target
                local mds_mount_device
                local mds_mount_fstype
                local sds_swap_device
                local use_device
                local do_fsck=0
                local fsck_type

                local autoswap_from_fstab
                local automount_from_fstab

            mount_dev_section_cb() {
                mds_mount_target="$2"
                        mds_mount_device="$3"
                        mds_mount_fstype="$4"
                        mds_mount_enabled="$6"
            }

            swap_dev_section_cb() {
                        sds_swap_device="$2"
                        return 0
            }

                config_get_automount
                automount_from_fstab="$from_fstab"
                [ "$automount_from_fstab" -eq 1 ] && {
                        config_get_mount_section_by_device "/dev/$device"
                        use_device="$mds_mount_device"
                        [ "$mds_mount_enabled" -eq 1 ] && {
                                if [ -n "$mds_mount_target" ]; then
                                        grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || {

                                                if [ "$mds_mount_fstype" = "ntfs-3g" ];
                                                then
                                                        ( mkdir -p "$mds_mount_target" && ntfs-3g "$mds_mount_device" "$mds_mount_target" ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
                                                else

                                                        ( mkdir -p "$mds_mount_target" && mount "$mds_mount_target" ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
                                                fi
                                        }
                                else
                                        logger -t 'fstab' "Mount enabled for $mds_mount_device but it doesn't have a defined mountpoint (target)"
                                fi
                        }
                }

                [ -z "$use_device" ] && {
                        config_get_autoswap
                        autoswap_from_fstab="$from_fstab"

                        [ "$autoswap_from_fstab" -eq 1 ] && {
                                config_get_swap_section_by_device "/dev/$device"
                                use_device="$sds_swap_device"
                        }
                }

                grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || {
                        [ "$anon_mount" -eq 1 ] && [ -z "$use_device" ] && {
                                ( mkdir -p /mnt/$device && mount /dev/$device /mnt/$device ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab'
                        }
                }
                reset_dev_section_cb
                ;;
        remove)
                umount /dev/$device
                ;;
    esac

fi

Now i can automount ntfs-filesystems with Luci. It only works with ntfs-3g when you configure in Luci the files systeme. When i use a hdd with other filesystem i always need to change the config in Luci. Now i try to integrate a automatic mount command choose for each filesystem but i don't find a function for autodetecting the filesystem. Did somebody know such a function??

Re: mount with ntfs-3g

I still search a function which detect the filesystem.

19 (edited by written_direcon 2011-03-01 20:15:24)

Re: mount with ntfs-3g

The Busybox mount helpers option (CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_HELPERS) got enabled by default finally smile

- Backfire r25816
- Trunk r25815

Now you can mount the NTFS partition directly in /etc/config/fstab without any extra scripts!