View previous topic :: View next topic |
Author |
Message |
optilude Apprentice
Joined: 29 May 2002 Posts: 248 Location: England
|
Posted: Thu Dec 25, 2003 1:43 am Post subject: Making sure /dev/sda always refers to the same device |
|
|
Hello,
I've got a laptop and lots of USB gadgets, so connections sometimes vary. My problem is that I've got a USB SD card reader; normally this takes /dev/sda (via the usb-storage module, which performs SCSI emulation) since it's permanently connected, and my Creative Labs MuVo NX takes /dev/sdb when I occasionally plug it in. I've set up /etc/fstab to use these device names, too.
However, when I'm not at home, the card reader that's normally /dev/sda is not used; now, when I plug in my MuVo, things get b0rked, because it takes /dev/sda (makes sense since it's the first device to be plugged in). How on earth do I tell it to stick to /dev/sda? I could imagine ways to be very clever with symlinks in /dev and hotplug, but surely this problem must've been solved before?
Martin _________________ --
"Life is both a major and a minor key" -- Travis |
|
Back to top |
|
|
blueworm l33t
Joined: 09 May 2003 Posts: 962
|
Posted: Thu Dec 25, 2003 7:04 am Post subject: |
|
|
The most sensible thing to do is permanently but the muvo on /dev/sda since it is used home and away.
Is there any compelling reason that the card reader must be /dev/sda? |
|
Back to top |
|
|
optilude Apprentice
Joined: 29 May 2002 Posts: 248 Location: England
|
Posted: Thu Dec 25, 2003 12:06 pm Post subject: |
|
|
Well, first off, that's not really a solution, because if I ever wanted to leave the MuVo at home, and then take the card reader with me, I'd have the same problem again.
Second, I don't think it's actually possible: The MuVo is only ever connected to the computer when I need to transfer songs to it; the card reader is connected to my 7 port hub when I'm at home. Hence, when I boot, this is found first, so it becomes /dev/sda. If I then put in the MuVo to transfer some songs later, it comes /dev/sdb. If there is some way to force the MuVo to stay on /dev/sda, and get the card reader to be /dev/sdb regardless, then that's the same as my original question, so I don't know how.
Is there some way to get devfsd to do this? Would udev fix it (I have no idea how udev works)? The simplest solution would be to have a symlink to "/dev/muvo" and "/dev/sdreader", for example, and have these set up automagically. I think I can make hotplug to do that, maybe even write a general set of scripts (and probably integrate them with hprofile). Would others be interested in that?
But I refuse to believe no simple solution has been found/created before - it seems like such a common problem!
Martin _________________ --
"Life is both a major and a minor key" -- Travis |
|
Back to top |
|
|
blueworm l33t
Joined: 09 May 2003 Posts: 962
|
Posted: Thu Dec 25, 2003 12:36 pm Post subject: |
|
|
Merry Christmas...
This is probably of not much help, but I would do this.
In my /etc/fstab
Code: | /dev/sda1 /mnt/aux1 vfat noauto 0 0
/dev/sdb1 /mnt/aux2 vfat noauto 0 0 |
You will have to mount manually.
|
|
Back to top |
|
|
optilude Apprentice
Joined: 29 May 2002 Posts: 248 Location: England
|
Posted: Thu Dec 25, 2003 6:35 pm Post subject: |
|
|
No, that doesn't help.
I need the mount directories to correspond to the devices, otherwise things get messy, and I can't rely on them.
I've almost worked out how to do it with 2.6 hotplugging; I get a message when I plug a device in, and I know how to get to it from /sys/devices and /proc/bus/usb, which lets me check where it's connected and what device it is. However, I can't work out which device it's assigned in /dev - whether it gets /dev/sda or /dev/sdb. If I could work that out, I could make a symlink in /dev and make sure it points to the right device. _________________ --
"Life is both a major and a minor key" -- Travis |
|
Back to top |
|
|
really Guru
Joined: 27 Aug 2002 Posts: 430 Location: nowhere
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|