]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Do not call 'lvm' for non-LVM device-mapper devices
authorHannes Reinecke <hare@suse.de>
Thu, 11 Dec 2014 14:46:06 +0000 (15:46 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 16 Dec 2014 12:29:36 +0000 (13:29 +0100)
If a device-mapper device is not created by LVM it's pointless
to call any 'lvm' programs got extract details; they'll be
failing anyway. So check the UUID before calling 'lvm'.
This speeds up initrd creation and avoids I/O errors on
multipath devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
dracut-functions.sh

index 17a71f0eb11c7834b9139768f6c1f5124ebaf592..edd8ea9ef0b40d4fc45a6e354cae19cf2b7034e4 100755 (executable)
@@ -698,10 +698,12 @@ for_each_host_dev_and_slaves()
 # but you cannot create the logical volume without the volume group.
 # And the volume group might be bigger than the devices the LV needs.
 check_vol_slaves() {
-    local _lv _vg _pv
+    local _lv _vg _pv _dm
     for i in /dev/mapper/*; do
         [[ $i == /dev/mapper/control ]] && continue
         _lv=$(get_maj_min $i)
+        _dm=/sys/dev/block/$_lv/dm
+        [[ -f $_dm/uuid  && $(<$_dm/uuid) =~ LVM-* ]] || continue
         if [[ $_lv = $2 ]]; then
             _vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
             # strip space