Table of Contents
Remaining DM devices
Error description
LVM devices are often generated and removed by automatic processes. Examples are the creation of vhosts or the generation of snapshots while performing backups. During these processes LVM devices are sometimes removed while belonging DM devices still remain. The error becomes visible when LVM partitions cannot be created. This happens because DM devices of the same name still exist.
root@kvm55:~# lvs LV VG Attr LSize Origin … images vg -wi-ao 200.00g lv_dbslave5501 vg -wi-a- 20.00g lv_dbserver5501 vg3_dbserver -wi-ao 4.98g lv_nas5501 vg3_nas -wi-ao 499.98g root@kvm55:~# dmsetup ls vg-images (252:0) vg-lv_dbslave5501 (252:1) 350002ac21d632071 (252:2) vg3_dbserver-lv_dbserver5501 (252:3) 350002ac21d622071 (252:4) vg3_nas-lv_nas5501 (252:5) vg3_nas-lv_nas5501_snapshot (252:6)
In the depicted example above the command lvs
displays no snapshot for the LVM partition 'lv_nas5501'. But the belonging dm device 'vg3_nas-lv_nas5501_snapshot' still exists as the output of the command dmsetup
shows. In this case the creation of a snapshot with the same name will fail:
root@kvm55:~# lvcreate -s -n lv_nas5501_snapshot -L 5G \ /dev/vg3_nas/ lv_nas550 Locical volume “lv_nas5501_snapshot“ already exists in volume group “ vg3_nas“
Failure cause
The failure cause is completely unknown. Because automatic processes often lead to the error, it is hard to observe the error cause.
Solution
It is possible to remove the DM device directly. Before removal check, whether the DM device still has open connections:
root@kvm55:~# dmsetup info /dev/dm-6 Name: vg3_nas-lv_nas5501_snapshot State: ACTIVE Read Ahead: 256 Tables present: LIVE Open count: 0 Event number: 1 Major, minor: 252, 6 Number of targets: 1 UUID: LVM-keMgdvei4HyiAJrdMgW8EEa8Q8vTze6cVsvVBap2GKZ5oqeO6KBNOUEZTBw8
In the example above the device has no open connections (Open count: 0) and can be removed:
root@kvm55:~# dmsetup remove /dev/dm-6