Re: USB Mass Storage Devices

Nathan Clayton
2003-10-26T08:24:30Z

[-- Attachment #1: Type: text/plain, Size: 2499 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pete Shinners wrote:

| Thorsten Alge wrote:
|
|> I want to use my usb hd and my usb mp3-player an my linux computer.
|> if i plug them on on after one, they will assigned as sda (i.e. my
|> usb hd) and sdb (my mp3-player) . so i can add them to /etc/fstab.
|> the problem is; if i plug on only one of them or in another order,
|> the device files are changed to and the mount points are not
|> correct. my first idea was to use volume labels. that works fine
|> with my ext2 partition but i don't helps on my vfat partitions. the
|> compactflash cards an two of my partitions on my usb-hd must be
|> vfat partitions. any ideas how to fix?
|
|
| i have this same problem and i cannot get it resolved. i believe with
| "devfs" you can get consistent device names?? not sure, but debian
| does not have devfs, so i need a different solution. i was hoping
| there was some "hotplug" script that would link the plugged in device
| to whatever system device it was assigned to, but i have found
| nothing.
|
| help please?

~From what I understand, devfs is a virtualization of the /dev device
tree so that when you plug in devices, they can appear and disappear
once you unplug them (an example of this would be to do something like
plug in a scanner and it appears as "/dev/scanner/scanner0", and have it
disappear once it is gone). But what happens when you plug in a mass
storage device isn't the same as plugging in a new peripheral (at least
to the computer), you are plugging what the computer sees as a new
harddrive, and it assigns those in the order that it sees them, in one
case, your portable hdd first, in another, your MP3 player.

I just whipped up the attached script, I think that it, slightly
modified might help you out a bit (just type in the script name, m or u
for mount or unmount, and the letter of the device (i.e. a for sda, b
for sdb, etc.) I haven't used them so there may be a few bugs. Modify it
for your mp3 player according to what you need too. It might have to be
setuid root, or something similar. Try it as a user first.

Check for the TODO parts, and modify to what you need.

Hope that was helpful, if you need any more help, just email.

Nathan Clayton

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/m4S7XN24wxDWCsYRAuQTAKCQUnV6oftRejonR1VBqDmqq3u0fACgnfhF
L822Kp75NEjff9X8XuaqbwY=
=O2w3
-----END PGP SIGNATURE-----

[-- Attachment #2: usbhdmount.sh --]
[-- Type: application/x-sh, Size: 1430 bytes --]