PDA

Bekijk de volledige versie : Multiple USB disks and their order on /dev/discs/discX



cunami
19-01-2006, 21:50
Hi,

I have following problem:

To my WL500g I've connected USB port, where in the beginning was connected to USB devices: USB key and USB printer (which is not related to the problem actually :D).

I've used my USB key as additional space for my router customizations: mounted it on /opt and installed there ipkg packaging system and ssh server. I have added automouting it in post-boot script, so stupid-ftpd did not used it for FTP service automatically. Every time when router is booting, this USB key exists on /dev/discs/disc0 device. Later I have connected another USB storage – external USB hard drive. It was available on /dev/discs/disc1. I did not make manual actions on it and it was picked up by stupid-ftpd, mounted under /tmp/harddisk and used for FTP service. Now after reboot those two drives somehow switched their places:

USB disk is available under /dev/discs/disc0 and USB key - /dev/discs/disc1! All my custom configuration went down – post-boot script mounted USB disk as /opt, and stupid-ftpd picket up USB key. Of course everything stopped to work :). How now can I be sure that this will not happen again? If I will modify my post-boot script to current situation, can it be that after next reboot it will different again? This part is confusing for me, maybe someone could explain to me – how devices naming works and on what depends which device is registered first on /dev/discs/discX?

Randale91
20-01-2006, 11:53
This is a general architecture USB feature (sometimes might be a problem) and
this is normal behaviour. All USB devices will enumerate.

Your problem could be resolved by adding a small USB-Hub.
Please plugin your (all!!!!) devices to this hub.
Now all the devices will be regcognized in the same way (order).
Find out which USB-Port is the first. This order will be kept.

Hope this helps.

cunami
20-01-2006, 14:17
Thanks for reply, I have connected all my drives, and printer as well, through small USB 4-port hub. I hope order now will remain the same if I will not change them (plug/unplug), otherwise I guess there is no way to find out which is comming first. I mean in easy way, cause I could write shell script which mounts both discs and then according to data in them (some files or so) decides which drive is where :-)