RHEL6.4 : during shutdown, blk-deactivate does not deactivate LV which has been sub-mounted with bind
Issue
During shutdown, there is a warning message about block device availability unable to deactivate a Volume Group, because it still has Logical Volume(s) opened.
It looks like the output below :
Stopping block device availability: Deactivating block devices:
[SKIP]: unmount of VG01-Swap (dm-1) mounted on [SWAP]
UMOUNT: unmounting localvg-ext4 (dm-10) mounted on /mnt/test
[SKIP]: unmount of VG01-Root (dm-0) mounted on /
DM: deactivating mpath device mpatha (dm-2)
DM: deactivating mpath device mpathb (dm-3)
DM: deactivating part device testingsp2 (dm-7)
LVM: deactivating Volume Group localvg
Can't deactivate volume group "localvg" with 1 open logical volume(s)
DM: deactivating part device testingsp3 (dm-8)
[ OK ]
It can be manually reproduced :
[root@dhcp-26-137 ~]# grep "^[^#].*test" /etc/fstab
/dev/localvg/ext4 /mnt/test ext4 _netdev,discard 2 2
/mnt/test/bindmount /mnt/test2 none bind 0 0
[root@dhcp-26-137 ~]# mount | grep test
/dev/mapper/localvg-ext4 on /mnt/test type ext4 (rw,_netdev,discard)
/mnt/test/bindmount on /mnt/test2 type none (rw,bind)
[root@dhcp-26-137 ~]# grep test /proc/mounts
/dev/mapper/localvg-ext4 /mnt/test ext4 rw,relatime,barrier=1,data=ordered,discard 0 0
/dev/mapper/localvg-ext4 /mnt/test2 ext4 rw,relatime,barrier=1,data=ordered,discard 0 0
[root@dhcp-26-137 ~]# service blk-availability stop
Stopping block device availability: Deactivating block devices:
[SKIP]: unmount of VG01-Swap (dm-1) mounted on [SWAP]
UMOUNT: unmounting localvg-ext4 (dm-10) mounted on /mnt/test
[SKIP]: unmount of VG01-Root (dm-0) mounted on /
DM: deactivating mpath device mpatha (dm-2)
DM: deactivating mpath device mpathb (dm-3)
DM: deactivating mpath device qdisk_rhel6 (dm-5)
DM: deactivating part device testingsp2 (dm-7)
Couldn't find device with uuid f4YjqP-1f4N-T39f-X8zy-Velm-VSci-I5n13h.
LVM: deactivating Volume Group localvg
Couldn't find device with uuid f4YjqP-1f4N-T39f-X8zy-Velm-VSci-I5n13h.
Can't deactivate volume group "localvg" with 1 open logical volume(s)
DM: deactivating part device testingsp3 (dm-8)
[ OK ]
[root@dhcp-26-137 ~]# mount | grep test
/mnt/test/bindmount on /mnt/test2 type none (rw,bind)
[root@dhcp-26-137 ~]# grep test /proc/mounts
/dev/mapper/localvg-ext4 /mnt/test2 ext4 rw,relatime,barrier=1,data=ordered,discard 0 0
As a result, if LVM is on iSCSI, it will not be de-activated prior to network shutdown, leading to potential file system corruption.
Environment
- Red Hat Enterprise Linux v.6.4
- lvm2 < lvm2-2.02.100-8.el6
- file system on an LV which is sub-mounted with the bind option
- LVM on iSCSI
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.