USB drives and device names

Thomas Charron twaffle at gmail.com
Fri Jan 25 17:19:52 EST 2008


On Jan 25, 2008 4:30 PM, Dan Coutu <coutu at snowy-owl.com> wrote:
> On Linux a USB connected hard drive appears as a SCSI device. But the
> naming of the device seems to 'float' based on who-knows-what criteria.

  The name it chooses is based on the 'first available unused'.  I'm
assuming that it was stc at one point, and perhaps wasn't unmounted
before ejection, so when reinserted, it went to std.  After insertion
as std, it prolly said 'HEY, this has the same ID as stc, let's make
stc unavailable (guessing there), and next time, it came up as stc
again.

  A good test is to mount it, disconnect it from the usb bus, then
reconnect, and repeat.  Each time it will have a new ID, possibly
flipflopping between two of them.

> Is there any kind of algorithm that could be used, perhaps within a
> shell script, in order to reliably mount a USB drive without fail and
> without having to guess at the device name?

  As others have said, mount it by name/id.

-- 
-- Thomas


More information about the gnhlug-discuss mailing list