UUID in fstab for device mapper devices?

Max Vozeler xam at debian.org
Fri Aug 7 15:49:14 UTC 2009


Hi Guido,

On Fri, Aug 07, 2009 at 05:15:06PM +0200, Guido Günther wrote:
> > we recently changed d-i (partman-target, to be precise) to use 
> > UUIDs in fstab in order to get stable device naming.
> So you're using /dev/disk/by-uuid/<uuid> in /etc/fstab?

Just plain UUID=. From a recent test install:

  # / was on /dev/vda2 during installation
  UUID=c08d38bd-90d8-4fea-b4c5-624600254667 /               ext3    errors=remount-ro 0       1

> > Currently UUIDs are used for all devices except 
> >  - /dev/fd*
> >  - cryptsetup mappings
> >  - those specified by explicit /dev/disk/by-* paths
> I'm confused. Doesn't every disk have symlnks in /dev/disk/by-id (even
> LVM LVs)?

Yes, I would think so.

I meant that partman-target will keep any device paths that 
start with /dev/disk/ without changing them to use UUID.

It is useful for the device paths for multipath you describe 
below; If we get partman to use the /dev/disk/by-id/ device paths
in the first place, they will end up in fstab unchanged.

> > Since then, we concluded that it is preferable to go back to plain
> > /dev/mapper/ paths for LVM LVs because those already provide stable 
> > device naming (and are more descriptive).
> > 
> > What about your types of devices? (dmraid, multipath)
> 
> multipath.udev sets up these links for persistent device naming:
> 
> # Create persistent links for multipath tables
> ENV{DM_UUID}=="mpath-*", \
> 	SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
> 
> # Create persistent links for dmraid tables
> ENV{DM_UUID}=="dmraid-*", \
>         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}"
> 
> # Create persistent links for partitions
> ENV{DM_PART}=="?*", \
>         SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}"
> 
> This is what should idealy be used in d-i for multipath device naming.
> We could then start to remove the hacks that use /dev/mapper/mpath* to
> reference multipath devices then.

Sounds good!

One way to do this could be to change the device path to 
/dev/disk/by-id/.. in partman-base/init.d/parted if the device
is a multipath device.

This would save us from having to map the device name from 
/dev/mapper/... to /dev/disk/by-id/.. later on.

	Max



More information about the pkg-lvm-maintainers mailing list