Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   /var on a USB disk (http://www.linux-archive.org/ubuntu-user/138565-var-usb-disk.html)

Teemu Nikkilä 08-06-2008 02:24 PM

/var on a USB disk
 
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


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Florian Diesch 08-07-2008 04:41 PM

/var on a USB disk
 
Teemu Nikkilä <teemu.nikkila@innovativeideasoy.com> wrote:

> I'd like to keep /var on a USB disk,

Why do you want that?


> 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:

/dev/sdc1 is just a comment, it isn't used by the system.

[...]
> Is there a way to mount the drive based on the uuid only?

It's the default since AFAIR Ubuntu 7.04


Florian
--
<http://www.florian-diesch.de/>
-----------------------------------------------------------------------
** Hi! I'm a signature virus! Copy me into your signature, please! **
-----------------------------------------------------------------------

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Derek Broughton 08-08-2008 01:50 PM

/var on a USB disk
 
Florian Diesch wrote:

> Teemu Nikkilä <teemu.nikkila@innovativeideasoy.com> wrote:
>
>> I'd like to keep /var on a USB disk,
>
> Why do you want that?
>
>
>> 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:
>
> /dev/sdc1 is just a comment, it isn't used by the system.
>
> [...]
>> Is there a way to mount the drive based on the uuid only?
>
> It's the default since AFAIR Ubuntu 7.04
>

I started to write this same post the other day :-) (Right to the point
of "why would you want to do that?")

But there really _is_ something wrong here. There's no way that adding
another USB drive while you have one mounted should move the first
from /dev/sdb to /dev/sdc. There's even less reason why it should make a
difference to any currently mounted device. While I agree with you that
the /dev/sdc1 in /etc/fstab is just a comment, look at the output from
mount: mount clearly _maps_ the UUID to the current /dev device where that
UUID is found, and _then_ mounts it, so no it's not a "pure" uuid-only
mount. In my case:

$ grep -B 1 -i uuid /etc/fstab
# /dev/sda6
UUID=9ed67955-1660-41cc-bae1-be8277b3c626 / jfs ...

and:
$ mount | grep sda6
/dev/sda6 on / type jfs (rw,noatime,errors=remount-ro)

--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


All times are GMT. The time now is 08:54 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.