Ben Buxton <[EMAIL PROTECTED]> wrote:
> How can one go about ensuring that certain USB mass-storage devices
> always get linked to the right /dev node, irregardless of the order that
> they're plugged into?

Irregardless? Yay for Bushisms!

> I'd like to have things where by for example, my camera always appears
> ad /dev/sda, my USB key as /dev/sdb, etc. It seems that they are
> allocated in the order they're attached, but this makes things rather
> complicated as I have to keep hunting for which device something's
> attacehd to.

Install udev.

Plug each device in and look in your syslog for a line like:
Jul 29 12:28:51 localhost kernel: Vendor: USB 2.0 Model: Flash Disk
        Rev: 1.00

Create or edit /etc/udev/rules/local.rules (or some other filename in
that directory) and add a line for each device using values you found in
syslog. Example:

[ wrapped for email; put it all on one line ]
BUS="scsi", SYSFS{vendor}="USB 2.0", SYSFS{model}="Flash Disk",
        NAME{all_partitions}="flash"

The SYSFS bits match whatever your device reports itself as. The NAME
bit is what name you'd like the device to have in /dev.

To /etc/fstab, add lines something like:
[ note the dev name: "flash1" (first and only partition), not "flash" ]
/dev/flash1   /mnt/flash   vfat   user,noauto   0 0

Insert device, "mount /mnt/flash", wipe hands on pants.
-- 
Sam "Eddie" Couter  |  mailto:[EMAIL PROTECTED]
Debian Developer    |  mailto:[EMAIL PROTECTED]
                    |  jabber:[EMAIL PROTECTED]
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C

Attachment: signature.asc
Description: Digital signature

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to