# Mounting USB Hard Drive on boot.



## nmahadkar (Mar 8, 2011)

I have googled but have found no clear answer to this.  I have an external USB 1 TB HDD that I want to mount on boot.  I made a 
	
	



```
dev/da0s1             /media/USB-HDD  ufs     rw              0       0
```
 entry into the /etc/fstab.  When the machine boots it aborts the boot saying that /dev/da0s1 is an invalid argument and bring me to the shell.  Few seconds later I get a dmesg alert saying that /dev/da0s1 has been detected.  I guess I have to figure out how to detect the USB drive before fstab tries to mount it.  

PS.  I am running 8.2


----------



## SirDice (Mar 8, 2011)

Add the "late" option, see fstab(7). I also advise to use labels. USB harddisks tend to move around, if you have another attached, this one might show up as da1 instead of da0.


----------



## DutchDaemon (Mar 8, 2011)

And make sure you have the leading slash in /etc/fstab ..


----------



## nmahadkar (Mar 8, 2011)

Sorry I did not copy the /.  It is in the fstab.  I am new to BSD is there a good tutorial on using labels?


----------



## wblock@ (Mar 8, 2011)

Maybe not the greatest, but what it lacks in quality it makes up for with brevity: Moving A FreeBSD System To AHCI And Labeled Filesystems

Ignore the part about loading the AHCI module and modifying /etc/sysctl.conf for now; you may want to do them later if your system supports it.  I should probably break that up into two more-focused documents.


----------



## mav@ (Mar 9, 2011)

Some USB devices are attaching with some delay. You may try to instruct CAM to wait for more devices by setting kern.cam.boot_delay loader tunable. It is measured in milliseconds.


----------

