Re: Lock down device name for USB drive
In the last episode (Jul 02), Doug Poland said: > On Fri, Jul 01, 2005 at 05:18:04PM -0500, Dan Nelson wrote: > > In the last episode (Jul 01), Doug Poland said: > > > 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: > > Thanks for the info. This particular box has an internal IDE Zip > drive as well. I noticed when I added device atapicam to the kernel, > then the Zip drive shows up as /dev/da* . That is complicating > things as sometimes either the Zip drive or the USB drive may or may > not be plugged in when the machine reboots. > > I've read man loader.conf and man device hints and I'm a little fuzzy > on how the hints work in loader.conf. > > If I want the Zip drive to always be da0 (here's dmesg from a recent boot) > Jul 2 10:29:45 couillard kernel: da0 at ata1 bus 0 target 1 lun 0 > > Then loader.conf should have: > hint.ata1.0.at="ata1" > hint.da.0.at="ata1" > hint.da.0.target="1" > hint.da.0.unit="0" "da#" devices always attach to "scbus#" devices, which in turn attach to "ata#" devices. The extra layer is important so you can represent all the busses of a multi-channel SCSI adapter. "camcontrol devlist -v" is the best way I've found to list what attaches to what. > And I want the USB drive to be da1 (snip from dmesg again) > Jul 2 10:30:26 couillard kernel: umass0: PNY USB DISK 20X, rev 2.00/1.00, > addr 2 > Jul 2 10:30:27 couillard kernel: da1 at umass-sim0 bus 0 target 0 lun 0 > > And loader.conf should read: > hint.scbus.0.at="umass0" > hint.da.0.at="scbus0" > hint.da.0.target="0" > hint.da.0.unit="0" > > Unfortunately, when I reboot, I get the Zip drive at da1 and the > Thumbdrive at da2! What am I doing wrong? First, you don't want two sets of da0 hints :) This should work: hint.scbus.0.at="ata1" hint.da.0.at="scbus0" hint.da.0.target="1" hint.da.0.unit="0" hint.scbus.1.at="umass0" hint.da.1.at="scbus1" hint.da.1.target="0" hint.da.1.unit="0" -- Dan Nelson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Lock down device name for USB drive
On Fri, Jul 01, 2005 at 05:18:04PM -0500, Dan Nelson wrote: > In the last episode (Jul 01), Doug Poland said: > > > > 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: > Thanks for the info. This particular box has an internal IDE Zip drive as well. I noticed when I added device atapicam to the kernel, then the Zip drive shows up as /dev/da* . That is complicating things as sometimes either the Zip drive or the USB drive may or may not be plugged in when the machine reboots. I've read man loader.conf and man device hints and I'm a little fuzzy on how the hints work in loader.conf. If I want the Zip drive to always be da0 (here's dmesg from a recent boot) Jul 2 10:29:45 couillard kernel: da0 at ata1 bus 0 target 1 lun 0 Jul 2 10:29:45 couillard kernel: da0: Removable Direct Access SCSI-0 device Jul 2 10:29:45 couillard kernel: da0: 3.300MB/s transfers Jul 2 10:29:45 couillard kernel: da0: 96MB (196608 512 byte sectors: 64H 32S/T 96C) Then loader.conf should have: hint.ata1.0.at="ata1" hint.da.0.at="ata1" hint.da.0.target="1" hint.da.0.unit="0" And I want the USB drive to be da1 (snip from dmesg again) Jul 2 10:30:26 couillard kernel: umass0: PNY USB DISK 20X, rev 2.00/1.00, addr 2 Jul 2 10:30:27 couillard kernel: da1 at umass-sim0 bus 0 target 0 lun 0 Jul 2 10:30:27 couillard kernel: da1: < USB DISK 20X PMAP> Removable Direct Access SCSI-0 device Jul 2 10:30:27 couillard kernel: da1: 1.000MB/s transfers Jul 2 10:30:27 couillard kernel: da1: 238MB (487424 512 byte sectors: 64H 32S/T 238C) And loader.conf should read: hint.scbus.0.at="umass0" hint.da.0.at="scbus0" hint.da.0.target="0" hint.da.0.unit="0" Unfortunately, when I reboot, I get the Zip drive at da1 and the Thumbdrive at da2! What am I doing wrong? -- Regards, Doug ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Lock down device name for USB drive
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 [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Lock down device name for USB drive
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? -- Regards, Doug ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"