This is a discussion on Mount hardware to specific location with specified device within the Linux General forums, part of the Linux Forums category; My subject probably doesn't make any sense but I wasn't sure how to word it. I have 2 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
My subject probably doesn't make any sense but I wasn't sure how to
word it. I have 2 external USB 2.0 / Firewire hard-drives and an iPod. I only turn them on when I need them. The problem I'm running into is that whichever is the first device to be turned on gets assigned to /dev/sda. The next device gets /dev/sdb and so on. I need to assign each piece of hardware it's own device so that my programs know where to find the correct hardware. For example, when I turn on my iPod I want it to get /dev/sdc even if I don't have my hard-drives on. And if I turn on my "2nd" hard-drive first, I want it to get /dev/sdb instead of /dev/sda Is this possible? As it stands right now, every time I turn on one of my devices I have to manually shuffle around the mount locations because /etc/fstab will mount /dev/sda to /mnt/ext_hdd regardless of which device it is. And if it happens to be my iPod, then when I start GTKPod, it can't find any of my music because it's looking in /mnt/ipod I guess it doesn't really matter which device gets assigned to /dev/sda as long as I have some way of telling it which directory to get mounted to based on the content of the device. So that if /dev/sda is my iPod, it gets mounted to /mnt/ipod. But if /dev/sda is my 1st external hard-drive, it gets mounted to /mnt/ext_hdd. But if /dev/sda is my 2nd exteranl hard-drive, it gets mounted to /mnt/ext_hhd2 Uh... what else. I'm running RedHat 9, Linux kernel 2.4.20-20.9 (RedHat kernel) |
|
|||
|
David <blixel@yahoo.com> wrote:
> Is this possible? Quick answer: no it isn't. Long answer: if you want to go all the way into hacking the various device drivers that handles those devices it is possible, but do that at your own risk. > to manually shuffle around the mount locations because /etc/fstab will > mount /dev/sda to /mnt/ext_hdd Then get them out /etc/fstab and use a more flexible script to mount what you want where you want. Davide |
|
|||
|
blixel@yahoo.com (David) writes:
> I need to assign each piece of hardware it's own device so that my > programs know where to find the correct hardware. For example, when I > turn on my iPod I want it to get /dev/sdc even if I don't have my > hard-drives on. And if I turn on my "2nd" hard-drive first, I want it > to get /dev/sdb instead of /dev/sda You can try http://www.lerhaupt.com/devlabel/devlabel.html which is an attempt at a proper solution to the problem. Otherwise, if all of drives are formatted as ext2, ext3, or xfs, you can identify them by `LABEL=...' in /etc/fstab rather than by device name. Unfortunately, Linux's `mount' command doesn't recognize volume labels on other filesystems. Failing that, you can hack together a script that looks at /proc/bus/usb and /proc/scsi to try to figure out which device is attached where. For more info see http://groups.google.com/groups?thre...0zoo.cam.ac.uk -- Stephen Cornell cornell@zoo.cam.ac.uk Tel/fax +44-1223-336644 University of Cambridge, Zoology Department, Downing Street, CAMBRIDGE CB2 3EJ |