OpenWrt Forum Archive

Topic: Automount USB NTFS partition on boot?

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello.

I am trying to have a usb drive containing a NTFS partition be mounted on boot. So far, no success.

I created a custom-user-startup file in /etc/init.d containing

#!/bin/sh /etc/rc.common

START=61

start()
{
ntfs-3g /dev/sda1 /mnt/sda1/
}
stop()
{
umount /mnt/sda1
}
restart()
{
stop
start
}

And then I did a "chmod +x custom-user-startup" and then a

/etc/init.d/custom-user-startup enable

to havec the UCI create the correct /etc/rc.d/S61custom-user-startup.

It doesn't work, the drive does not get mounted after a reboot.

However, I can issue a ./custum-user-startup start manually and it works.

I am running Backfire (10.03.1-rc3, r22796).

Any thoughts?

Same thing here. Created a script

/etc/init.d/mountntfs

which has a single line that uses ntfs-3g to mount a partition. Works fine when called by

/etc/init.d/mountntfs start

but does not work after enabling it and rebooting.

Hi,

try something like "sleep 15" right before mounting. The USB-drive needs to spin up to read the partition table, before the device can work.

My WNDR3700 mounts ntfs-3g partitions automaticly on boot as well as on insertion. Did you install the "block-hotplug" package, the ntffs-3g mount helper and set the busybox support for mount helpers ?

Here's my /etc/config/fstab

config global automount
        option from_fstab 1
        option anon_mount 1

config global autoswap
        option from_fstab 1
        option anon_swap 0

config mount
        option target   /mnt/usb
        option device   /dev/sda1
        option fstype   ntfs-3g
        option options  rw,sync
        option enabled  1
        option enabled_fsck 0

(Last edited by Adze on 17 Nov 2010, 12:05)

Adze wrote:

My WNDR3700 mounts ntfs-3g partitions automaticly on boot as well as on insertion. Did you install the "block-hotplug" package, the ntffs-3g mount helper and set the busybox support for mount helpers ?

Here's my /etc/config/fstab

config global automount
        option from_fstab 1
        option anon_mount 1

config global autoswap
        option from_fstab 1
        option anon_swap 0

config mount
        option target   /mnt/usb
        option device   /dev/sda1
        option fstype   ntfs-3g
        option options  rw,sync
        option enabled  1
        option enabled_fsck 0

Hi!

Are you sure in this? I have compiled a BackFire 10.03 for x86 with busybox mount helpers enabled. And the result is:

root@OpenWrt:~# fdisk -l | grep NTFS
/dev/sdb1   *           1        1134     3915760    7  HPFS/NTFS
root@OpenWrt:~# mount -t ntfs-3g /dev/sdb1 /mnt
mount: mounting /dev/sdb1 on /mnt failed: No such device
root@OpenWrt:~# ntfs-3g /dev/sdb1 /mnt
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                47.2M      6.1M     38.7M  14% /
tmpfs                   125.3M      1.1M    124.1M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sdb1                 3.7G     21.7M      3.7G   1% /mnt
root@OpenWrt:~#
vargalex wrote:

Hi!

Are you sure in this? I have compiled a BackFire 10.03 for x86 with busybox mount helpers enabled. And the result is:

I'm Sure... ;-) Did you also select the "block-hotplug" package and the ntfs-3g mount helper, besides the busybox mount helpers?

root@mercurius:~# cat /etc/openwrt_release
DISTRIB_ID="OpenWrt"
DISTRIB_RELEASE="10.03"
DISTRIB_CODENAME="backfire"
DISTRIB_DESCRIPTION="OpenWrt Backfire 10.03"
root@mercurius:~# cat /etc/banner
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 Backfire (10.03, r23680) --------------------------
root@mercurius:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.8M      5.8M         0 100% /rom
tmpfs                    15.1M    248.0K     14.9M   2% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock4          768.0K    232.0K    536.0K  30% /overlay
mini_fo:/overlay          5.8M      5.8M         0 100% /
/dev/sda1               486.3M     28.3M    458.0M   6% /mnt/usb
root@mercurius:~# umount /dev/sda1
root@mercurius:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.8M      5.8M         0 100% /rom
tmpfs                    15.1M    248.0K     14.9M   2% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock4          768.0K    232.0K    536.0K  30% /overlay
mini_fo:/overlay          5.8M      5.8M         0 100% /
root@mercurius:~# mount -t ntfs-3g /dev/sda1 /mnt/usb
root@mercurius:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 5.8M      5.8M         0 100% /rom
tmpfs                    15.1M    248.0K     14.9M   2% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock4          768.0K    232.0K    536.0K  30% /overlay
mini_fo:/overlay          5.8M      5.8M         0 100% /
/dev/sda1               486.3M     28.3M    458.0M   6% /mnt/usb

(Last edited by Adze on 17 Nov 2010, 17:17)

You are right. I have not installed ntfs-3g mount helper (not exists in BackFire 10.03).

vargalex wrote:

You are right. I have not installed ntfs-3g mount helper (not exists in BackFire 10.03).

Its selectable under menuconfig --> utilities --> filesystem --> mount.ntfs3g

Adze wrote:
vargalex wrote:

You are right. I have not installed ntfs-3g mount helper (not exists in BackFire 10.03).

Its selectable under menuconfig --> utilities --> filesystem --> mount.ntfs3g

Hi!

Yes. I have soon a new firmware compiled. All OK.

vargalex

Hum...

I get this :

root@OpenWrt:~# mount -t ntfs-3g /dev/sda1 /mnt/sda1/
mount: mounting /dev/sda1 on /mnt/sda1/ failed: No such device

However, this works :

root@OpenWrt:~# ntfs-3g /dev/sda1 /mnt/sda1/
root@OpenWrt:~#
root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=15036k)
tmpfs on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock5 on /overlay type jffs2 (rw,relatime)
mini_fo:/overlay on / type mini_fo (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /mnt/sda1 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

My fstab is setup the same as Adze.

I have the mount.ntfs-3g and the block-hotplug packages installed.

Any thoughts?

stanelie wrote:

Hum...

I get this :

root@OpenWrt:~# mount -t ntfs-3g /dev/sda1 /mnt/sda1/
mount: mounting /dev/sda1 on /mnt/sda1/ failed: No such device

However, this works :

My fstab is setup the same as Adze.

I have the mount.ntfs-3g and the block-hotplug packages installed.

Any thoughts?

And did you compile it with the busybox mount helpers enabled ?

Is there a list somewhere of the standard options used to build the firmwares hosted on the openwrt website?

Is there a list somewhere of the standard options used to build the firmwares hosted on the openwrt website?

The discussion might have continued from here.