/var on a USB disk

Teemu Nikkilä teemu.nikkila at innovativeideasoy.com
Wed Aug 6 14:24:10 UTC 2008


Hi,

I'd like to keep /var on a USB disk, but there are serious problems since
the /dev/sdX entries are dynamically changed as I plug in an another
drive.

The fstab entry is based on the disk uuid:
# /dev/sdc1
UUID=b443310d-5a1a-43df-9731-038cbf61a2ea /var ext3 relatime 0 2

Here /dev/sdc1 is wrong:
$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2008-08-06 16:32
b443310d-5a1a-43df-9731-038cbf61a2ea -> ../../sdb1

However,
$ cat /proc/mounts
...
/dev/sdb1 /var ext3 rw,relatime,data=ordered 0 0

Now, if I plug in a new drive in the USB bus, /dev/sdb becomes /dev/sdc:
$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2008-08-06 17:14
b443310d-5a1a-43df-9731-038cbf61a2ea -> ../../sdc1

and the system is hosed:
$ ls /var/
ls: reading directory /var/: Input/output error

Is there a way to mount the drive based on the uuid only?

Cheers,
Teemu





More information about the ubuntu-users mailing list