Juggling USB devices (fstab related)
First of all, *everythig is working*. I want to make it work better.
I have two USB mass-storage devices: an external HD that i just bought for making total backups. I also have a card reader. I do not plan to keep the external HD on unless i am backing up, and i do not plan to have a card plugged into the reader at all times. When you plug a USB device into the system, hotplug will pick it up and slap it into the nearest convenient device slot: /dev/sda, /dev/sdb, and so on. The problem is that when the actual hardware is not permanantly plugged in and turned on, i cannot always expect to plug in the card reader and have it always be sda1 or anything else. It all depends on what is already plugged into the system. This is a problem for fstab. For instance, if i want to write a backup script that says "mount /backup", fstab looks it up and sees that it is tied to /dev/sda1, which i expect to be a HD. But at the moment in this example, it's the card reader. Ha! Is there a way to permanantly assign a device file to a device so that fstab always mounts the same hardware to the same slots? Thanks for your help. I appreciate it. |
Hi.
Have a look here: http://www.redhat.com/docs/manuals/e...-devlabel.html I'm looking into this myself. Dave Edit: Maybe not - apparently, devlabel was deprecated by udev. "udev is the preferred solution". |
Are you using udev/hotplug/hald? (does "hald" appear in 'ps -A')? If so, then I have a solution.
It's a bit involved, but it lets you set a mount point for specific devices, so that they mount in the same place no matter what. Dave |
Aparently not. 'ps -A' gives me this:
PID TTY TIME CMD 1 ? 00:00:00 init 2 ? 00:00:00 keventd 3 ? 00:00:06 ksoftirqd_CPU0 4 ? 00:00:27 kswapd 5 ? 00:00:13 bdflush 6 ? 00:00:00 kupdated 103 ? 00:00:01 kjournald 229 ? 00:00:00 kjournald 368 ? 00:00:00 knodemgrd_0 468 ? 00:00:00 khubd 835 ? 00:00:02 usb-storage-0 836 ? 00:00:00 scsi_eh_1 837 ? 00:00:00 usb-storage-1 838 ? 00:00:00 scsi_eh_2 893 ? 00:00:00 dhclient 897 ? 00:00:00 portmap 919 ? 00:00:00 kwacomd 1065 ? 00:00:00 syslogd 1068 ? 00:00:00 klogd 1101 ? 00:00:00 exim4 1106 ? 00:00:11 famd 1111 ? 00:00:00 inetd 1115 ? 00:00:00 lpd 1122 ? 00:00:00 sshd 1183 ? 00:00:00 bash 1185 ? 00:00:00 bash 1186 ? 00:00:00 bash 1190 ? 00:00:00 Xprt 1195 ? 00:00:00 rpc.statd 1198 ? 00:00:00 ntpd 1201 ? 00:00:00 atd 1237 ? 00:00:00 cron 1248 ? 00:00:00 apache 1253 ? 00:00:00 apache 1254 ? 00:00:00 apache 1255 ? 00:00:00 apache 1256 ? 00:00:00 apache 1257 ? 00:00:00 apache 1266 ? 00:00:00 kdm 1273 tty1 00:00:00 getty 1274 tty2 00:00:00 getty 1275 tty3 00:00:00 getty 1276 tty4 00:00:00 getty 1277 tty5 00:00:00 getty 1278 tty6 00:00:00 getty 1279 ? 00:03:37 XFree86 1282 ? 00:00:00 kapmd 1540 ? 00:00:00 kjournald 1572 ? 00:00:00 kdm 1582 ? 00:00:01 enlightenment 1638 ? 00:00:00 ssh-agent 1640 ? 00:00:01 gkrellm 1646 ? 00:00:00 xmms 1647 ? 00:00:00 xmms 1648 ? 00:00:00 xmms 1653 ? 00:00:00 xmms 1654 ? 00:00:08 kmail 1656 ? 00:00:00 kdeinit 1659 ? 00:00:00 kdeinit 1661 ? 00:00:00 kdeinit 1663 ? 00:00:00 kdeinit 1667 ? 00:00:00 kdeinit 1673 ? 00:01:09 firefox-bin 1683 ? 00:00:00 firefox-bin 1684 ? 00:00:00 firefox-bin 1686 ? 00:00:00 gconfd-2 1688 ? 00:00:00 firefox-bin 1989 ? 00:00:00 firefox-bin 1994 ? 00:00:02 artsd 1995 ? 00:00:00 artsd 2006 ? 00:00:00 kdeinit 2018 ? 00:00:00 kdeinit 2026 ? 00:00:00 kdeinit 2047 ? 00:00:01 kdeinit 2048 ? 00:00:00 kdeinit 2050 ? 00:00:00 kdeinit 2051 ? 00:00:00 kdeinit 2054 ? 00:00:00 kdeinit 2055 ? 00:00:00 kdeinit 2056 ? 00:00:00 kdeinit 2061 ? 00:00:00 Eterm 2062 pts/0 00:00:00 bash 2065 pts/0 00:00:00 bash 2125 pts/0 00:00:00 ps |
Quote:
|
leiavoia: Have a look at that devlabel thing in post #2, I think it's probably what you're looking for.
Wells: Here we go: Basically, what you want to do is add hal config files (.fdi files), so that the mount point is something other than the usual usbdisk or whatever, depending on some feature or another of the volume. In FC3, the hal files are in /usr/share/hal/fdi There should be a few directories starting with numbers, like 10generic and so on. The main config is in 90defaultpolicy This is the file I created to change the mount point of my Sony USB stick to 'sony': Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> It's one device per file. You get the volume.uuid above by plugging in the device, then running 'lshal'. At the top of the output you should see a load of stuff about the drive. This is the output of lshal when the Sony device is in: Code:
udi = '/org/freedesktop/Hal/devices/block_41C7-EE93' As long as all the match key statements in your .fdi file are true, then the merge key assignment will be done, and with that you can change your mount point. That probably makes no sense, so hit me back and I'll clarify. |
looks like debian doesn't have devlabel support and udev requires kernel 2.6, i'm on 2.4.x :-(
I could try upgrading my kernel but i've never actually been successfull in doing so. |
|
All times are GMT -5. The time now is 03:31 PM. |