[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Understanding LVM UUIDS



On Wed, Jun 23, 2010 at 4:40 AM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:
> I feel I should move my entire /etc/fstab over to using uuids
>
> However after installation I added the following line
>
> /dev/raid/bak /bak            ext4    defaults        0       2
>
> which I now need to convert to a uuid  (/dev/raid/bak is an lv on the "raid"
> volume group)
>
> if I look in /dev/disk/by-id I can locate the following
>
> lrwxrwxrwx 1 root root 10 Jun 21 19:20 dm-name-raid-bak -> ../../dm-0
>
> which shows me that this has been mapped to /dev/dm-0
>
> However, I now have two options
>
> in /dev/disk/by-id there is the following (excuse the word wrap)
>
> lrwxrwxrwx 1 root root 10 Jun 21 19:20
> dm-uuid-LVM-25HQ5BuXqjSs2y53Aj4C8zMHEX1ZrgBieFN7ln0AYSPSwzxCh5ylxoM3kRzS9gCe
> -> ../../dm-0
>
> and in /dev/disk/by-uuid (again excuse the word wrap)
>
> lrwxrwxrwx 1 root root 10 Jun 21 19:20 f3408fda-0649-414f-8446-c01cf4e07558
> -> ../../dm-0
>
> There seems to be no correspondence between them
>
> Which do I use, and what does the other one mean?

The last one is the lv's uuid so it the "right" uuid value although
you shouldn't need uuids for lvs since vg and lv names are persistent.

The lv-related dm-... values in by-id are "artificial" because the
usual values in by-id are hardware ids. Since the hardware is
abstracted, udev is creating disk ids with the vg and lv names and
with the lv filesystem uuids. I am sure that you can use them in your
fstab (I think that Suse/OpenSuse does so instead of /dev/sda1 for
non-lvm'd boxes, etc) but not with "UUID=..." because, AFAIK, there
isn't an equivalent of "UUID=..." for /dev/disk/by-id. You'ill have to
use "/dev/disk/by-id/...".


Reply to: