LVM snapshot fails to be removed for some unknown reason.
Issue
-
LVM snapshot fails to be removed for some uknown reason.
-
I am running the follwing bash script to remove the lvm snapshot volume on a daily basis:
[..]
/bin/umount -l /data_snap
/sbin/lvremove -f /dev/Volume00/snap
[..]
- To find the cause of the issue I added some option strings to get more verbose logging in removing the snapshot:
[..]
/bin/umount -l /data_snap
/sbin/lvremove -fvvv /dev/Volume00/snap > lvremove.out 2>&1
[..]
- Looking at lvremove.out I found
lvremove -fvvvshowed the snapshot volume was in use:
[..]
Getting device info for Volume00-snap [LVM-MTOzwX254vVyUNyoxDBoBdVo7Dv9bBqUhNKPINp1kSUgOHM2BduKWpad2nXzKSIB]
dm info LVM-MTOzwX254vVyUNyoxDBoBdVo7Dv9bBqUhNKPINp1kSUgOHM2BduKWpad2nXzKSIB OF [16384] (*1)
Logical volume Volume00/snap contains a filesystem in use.
Unlock: Memlock counters: locked:0 critical:0 daemon:0 suspended:0
Syncing device names
Unlocking /var/lock/lvm/V_Volume00
_undo_flock /var/lock/lvm/V_Volume00
Closed /dev/mapper/mpathbp1
Freeing VG Volume00 at 0x1aed1a0.
Environment
- Red Hat Enterprise Linux 6
- LVM
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.