Topic: Automount USB NTFS partition on boot?

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?

Re: Automount USB NTFS partition on boot?

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.

Re: Automount USB NTFS partition on boot?

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.

4 (edited by Adze 2010-11-17 12:05:20)

Re: Automount USB NTFS partition on boot?

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

Re: Automount USB NTFS partition on boot?

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:~#

6 (edited by Adze 2010-11-17 17:17:54)

Re: Automount USB NTFS partition on boot?

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

Re: Automount USB NTFS partition on boot?

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

Re: Automount USB NTFS partition on boot?

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

Re: Automount USB NTFS partition on boot?

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

Re: Automount USB NTFS partition on boot?

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?

Re: Automount USB NTFS partition on boot?

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 ?

Re: Automount USB NTFS partition on boot?

No, I have a NSLU2 and I downloaded the firmware image from http://backfire.openwrt.org/10.03/ixp4xx/openwrt-nslu2-squashfs.bin.

How do I know if the helpers are enabled in there?

Re: Automount USB NTFS partition on boot?

stanelie wrote:

No, I have a NSLU2 and I downloaded the firmware image from http://backfire.openwrt.org/10.03/ixp4xx/openwrt-nslu2-squashfs.bin.

How do I know if the helpers are enabled in there?

They aren't... you have to compile one yourself.

Re: Automount USB NTFS partition on boot?

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

Re: Automount USB NTFS partition on boot?

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