1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

udev: create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for a PV

We already have /dev/disk/by-id/dm-uuid-... (which encompasses the
VG UUID and LV UUID in case of LVs since the mapping's UUID is
VG+LV UUID together) and /dev/disk/by-id/dm-name-... (which encompasses
the VG and LV name in case of LVs).

This patch addds /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> that completes
this scheme and makes navigation a bit easier using PV UUIDs since
one can navigate using PV UUIDs only and there's no need to do extra
PV UUID <--> kernel name matching (the PV UUID is stable across reboots).
This may come in handy in various scripts.

Since we already have the PV UUID stored in udev database (as a result
of blkid call - returned in ID_FS_UUID blkid's variable), this operation
is very cheap indeed, just creating the extra one symlink.
This commit is contained in:
Peter Rajnoha 2014-02-18 11:27:21 +01:00
parent 0e0f91b6dd
commit 417e52c13a
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.106 - Version 2.02.106 -
==================================== ====================================
Create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for each PV via udev.
lvcreate computes RAID4/5/6 stripes if not given from # of allocatable PVs. lvcreate computes RAID4/5/6 stripes if not given from # of allocatable PVs.
Fix merging of old snapshot into thin volume origin. Fix merging of old snapshot into thin volume origin.
Use --ignoreskippedcluster in lvm2-monitor initscript/systemd unit. Use --ignoreskippedcluster in lvm2-monitor initscript/systemd unit.

View File

@ -34,6 +34,9 @@ ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
# Inform lvmetad about any PV that is gone. # Inform lvmetad about any PV that is gone.
ACTION=="remove", GOTO="lvm_scan" ACTION=="remove", GOTO="lvm_scan"
# Create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for each PV
ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-id/lvm-pv-uuid-$env{ID_FS_UUID_ENC}"
# If the PV is a special device listed below, scan only if the device is # If the PV is a special device listed below, scan only if the device is
# properly activated. These devices are not usable after an ADD event, # properly activated. These devices are not usable after an ADD event,
# but they require an extra setup and they are ready after a CHANGE event. # but they require an extra setup and they are ready after a CHANGE event.