Multiple USB disks and their order on /dev/discs/discX
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?