lvm snapshots - mmmmm mmmmmm good

home | blog | Terrible people and places | Covid-19 links | Teh Internet | guest blog |rants | placeholder | political | projects | Gwen and Liam | Citadel patched | Tools | Scouts

Just create a new volume with the remaining space you have on the lvm (that of course you left over for this exact reason!). It does not need to be a big enough volume to be the size of the one to be backed up, just enough to track changes while you copy the files!

lvcreate -L500G -s -n vmbackup /dev/vg0/lv0
(or whatever your pool of disk is called)

mount /dev/vg0/vmbackup /mnt/backups/

cd /mnt/backups/

copy copy copy
(probably cp --sparse=always)

lvremove /dev/vg0/vmbackup

If this fails because it says it is in use (but fuser and lsof prove otherwise):
udevadm control --stop-exec-queue
-- udev could be in the way --
Retry the lvremove.
udevadm control --start-exec-queue
-- might want to add a tweaked blacklist rule: --

comment out the line with the watch rule:
#KERNEL=="dm-*", OPTIONS+="watch"

More info here: