I am running Debian 11, using LVM.
The root partition is /dev/mainvg/lvroot.
I created a snapshot of the root partition by doing lvcreate -L5G -n bkp_lvroot -s /dev/mainvg/lvroot
.
My system was in this state for a few days.
Now I wanted to remove the snapshot, like so:
lvremove /dev/mainvg/bkp_lvroot
Logical volume mainvg/bkp_lvroot in use.
Looks like the snapshot is in 'active' state, so I tried to deactivate it:
lvchange -an -v /dev/mainvg/bkp_lvroot
Change of snapshot mainvg/bkp_lvroot will also change its origin mainvg/lvroot. Proceed? [y/n]: n
Accepted input: [n]
Logical volume mainvg/bkp_lvroot not changed.
I cannot set the root partition to deactivated, can I???
Also: The snapshot is not mounted,
and lsof | grep /dev/mainvg/bkp_lvroot
brings no results
My actual question is: How can I safely remove the snapshot? (I don't know how, and I don't want to break my system)