Lock down device name for USB drive

Dan Nelson dnelson at allantgroup.com
Fri Jul 1 22:18:05 GMT 2005


In the last episode (Jul 01), Doug Poland said:
> Hello,
> 
> I'm trying to use the automounter to mount a USB thumbdrive on
> -STABLE.  The only problem I'm having is that, between reboots, the
> name of the device changes between da0s1 and da1s1.
> 
> Is there a way to lock down the device name so it doesn't change?

Depends on what you want to lock down.  If you only want a particular
thumbdrive to be mounted, you can give it a label and use geom_label to
provide a /dev/msdosfs/mylabel node.  If you always want the first usb
drive plugged in to be mounted, you can wire down umass and the device
to always appear at the same scbus# and da# numbers, by adding
something like this to loader.conf:

hint.scbus.0.at="umass0"
hint.da.0.at="scbus0"
hint.da.0.target="0"
hint.da.0.unit="0"

If you boot off of scsi devices, you probably would want to wire them
down first, followed by your usb device, to keep them from shifting if
you have more than one usb drive plugged in during bootup.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list