lvm snapshot to remote server

lvdisplay /dev/lvm-group/lv-name | grep Size
LV Size 60.00 GiB

take 10-20% of this space:
lvcreate –size 7G –snapshot –name lv-name-snap /dev/lvm-group/lv-name

copy and compress:
dd if=/dev/lvm-group/lv-name-snap | gzip -1 - | ssh [email protected] dd of=/backups/lvm-images/lv-name-snap.gz

from backup server:
ssh user@remote "dd if=/dev/lvm-group/lv-name-snap | gzip -1 -" | dd of=/backups/lvm-images/lv-name-snap.gz

remove snapshot image:
lvremove /dev/lvm-group/lv-name-snap

Please be carefully with dd command, this command can be destructive.

Leave a Reply

Your email address will not be published. Required fields are marked *