Update: I found out that setting the label for your USB device is the less painful way to do this, see below.
The naming of my USB hard disks in Ubuntu differed from time to time, which became more and more annoying recently. When I booted up the system with my external hard disk attached, the disk would be mounted as /media/sdb6. However, when I plugged the disk in when the system was already up and I was logged in, it would mount as /media/usbdisk. This was very nasty, as it broke links and libraries of applications like F-Spot and Quod Libet.
The cure for this problem was to have proper /etc/fstab entries for these devices. I found out about udev, which is the device manager for Linux since 2.16: udev manages the device nodes in /dev. In addition to the usual names like /dev/sdb, udev in Edgy is configured to also create symbolic links that will never change their name, like /dev/disk/by-id/usb-WD_3200JB_External_574D414D5231343637323730-part5 or /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0. (/etc/udev/rules.d/65-persistent-storage.rules does this.)
Knowing this, I went and put the right paths into /etc/fstab. The following is an excerpt from my configuration. I have an external WD hard disk with two partitions, one vfat and the other ext3. The last entry mounts a SanDisk USB stick, which uses vfat again:
# USB WD /dev/disk/by-id/usb-WD_3200JB_External_574D414D5231343637323730-part5 /media/WD_3200JB-part5 ext3 auto,users,defaults 0 0 /dev/disk/by-id/usb-WD_3200JB_External_574D414D5231343637323730-part6 /media/WD_3200JB-part6 vfat rw,nosuid,nodev,quiet,shortname=mixed,auto,users,iocharset=utf8 0 0 # SanDisk /dev/disk/by-id/usb-SanDisk_U3_Cruzer_Micro_0000060326115761-part1 /media/SanDisk_Cruzer vfat rw,nosuid,nodev,quiet,shortname=mixed,auto,users,iocharset=utf8 0 0
The Gnome Disk Mounter, which I don't use, seems quite confused by this. However, the disks are now automatically mounted with nice names, and I can reliably link into my external disks.
Update: I found out that setting the label for your USB device is the less painful way to do this. E.g. after renaming your FAT32 device to MYDATA, Ubuntu will mount your device at /media/MYDATA. This page explains how to rename your device for all kinds of filesystem types: https://help.ubuntu.com/community/RenameUSBDrive
posted at: 15:20 |
0 comments |
category: /linux
|
permanent link |
add to del.icio.us or digg it
| < | December 2006 | > | ||||
| Su | Mo | Tu | We | Th | Fr | Sa |
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | ||||||
Feed of all categories:
rss |
atom