USB drives and device names
Ben Scott
dragonhawk at gmail.com
Fri Jan 25 17:14:11 EST 2008
On Jan 25, 2008 4:30 PM, Dan Coutu <coutu at snowy-owl.com> wrote:
> But the naming of the device seems to 'float' based on who-knows-what criteria.
SCSI and SCSI-like devices (sda, sdb, sdc, etc.) are assigned based
on the order the kernel sees the device. The first device is sees is
sda, the second sdb, and so on. This was bad enough with traditional
SCSI devices, which had fixed ID numbers (but what if you insert a
device between two others?). It's horrible with USB, which is
entirely dynamically discovered and hot-plug is the norm. The kernel
generally doesn't remember USB device history, either. That's partly
because the kernel tends to avoid that kind of thing for efficiency's
sake, but also because USB devices aren't required to have a unique
hardware ID (so there is no way to know if that device that just got
plugged in is the same widget, or another one of the same model).
That's sometimes why you'll see the logical device climb higher and
higher.
As others have pointed out, filesystem labels are a solution to many
problems. Michael O'Donnell pointed out /etc/usb/. Other interesting
places to find config info are /etc/hotplug/ and /etc/hotplug.d/
(older distros) and /etc/udev/ (udev is the system which handles
dynamic devices on most newer distros).
-- Ben
More information about the gnhlug-discuss
mailing list