evansj57
Posts: 9
Joined: Fri May 03, 2013 9:04 pm

Mounting USB drive

Fri Mar 27, 2015 3:21 am

I have mounted a USB hard drive at /mnt/usbdrive using fstab and shared it with Windows using Samba.

But after installing and setting up some applications (NZBget, Transmission) they install folders at /mnt/usbdrive before the drive is mounted - as these apps check if the folders exist and create them if not.

This then stops fstab from mounting the drive.

How can I make sure the drive is mounted before other applications start up?

evansj57
Posts: 9
Joined: Fri May 03, 2013 9:04 pm

Re: Mounting USB drive

Fri Mar 27, 2015 12:39 pm

I was wrong - the drive is not mounting during boot.

dmesg log seems to show that it is mounting:
[10.801071] sda: sda1
[10.812751] sd 0:0:0:0: [sda] Attached SCSI disk

blkid recognises the drive at /dev/sda1:
/dev/sda1: LABEL="TranscendHDD" UUID="F89C-5280" TYPE="exfat"

fstab entry:
UUID=F89C-5280 /mnt/usbdrive exfat uid=pi,gid=pi 0 0

And the drive mounts with 'mount -a':
/dev/sda1 488384000 17408 488366592 1% /mnt/usbdrive

But is won't mount during boot.

I am using a raspberry pi 2. I read that there was an issue with the boot process and it is recommended to add "rootwait=5" to end of /boot/cmdline.txt. I have tried this and also higher numbers but no success.

Others who have had this issue:
http://www.raspberrypi.org/forums/viewtopic.php?t=99491
https://github.com/raspberrypi/linux/issues/824

So as suggested by one of the posters, I have added 'mount -a' to /etc/init.d/rc.local
The drive mounts on boot now. But this is not standard and I dont know if there are any disadvantages.

Return to “Beginners”