Environment
- Red Hat Enterprise Linux 6
Issue
- Not able to remove unounted logical volume.
lvremove
failed with below error.
# lvremove /dev/mapper/testvg-testlv
Logical volume testvg-testlv contains a filesystem in use.
Resolution
- Stop
nfs
service and removelogical volume
. - Check whether there are any processes which are accessing the logical volume. In some cases kernel thread for journald might be accessing the LVM device due to which the lvm can be left open. In such case rebooting the server is the safest way to recover since the journald process should not be killed.
Root Cause
- Mount point was exported through
nfs
.
Diagnostic Steps
1. Verify filesystem is not mounted.# df
# cat /proc/mount
3. Verify whether this lv is exported through nfs
#cat /etc/exportfs
# blockdev --flushbufs /dev/vg/lv
# echo 1 > /proc/sys/vm/drop_caches
# echo 2 > /proc/sys/vm/drop_caches
# echo 3 > /proc/sys/vm/drop_caches
No comments:
Post a Comment