Skip to content

HOWTO: Create LVM Snapshot for Backup and transfer over ssh

February 28, 2012

DO NOT DO THIS , IT’S NOT WORKING

1. Create Logical Volume for the snapshot and the snapshot

root@mailer:~# df -h

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/3ware-root
200G 29G 162G 15% /
tmpfs 2.0G 0 2.0G 0% /lib/init/rw
udev 2.0G 124K 2.0G 1% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm

# lvcreate -L 30G -s -n root-snapshot /dev/3ware/root
Logical volume “root-snapshot” created

1.1 See it

root@mailer:~# lvdisplay /dev/3ware/root-snapshot

— Logical volume —
LV Name /dev/3ware/root-snapshot
VG Name 3ware
LV UUID QoOFRQ-VhdL-x1GF-q42V-th9C-gD4p-wO37N7
LV Write Access read/write
LV snapshot status active destination for /dev/3ware/root
LV Status available
# open 0
LV Size 203.13 GiB
Current LE 52001
COW-table size 30.00 GiB
COW-table LE 7680
Allocated to snapshot 0.00%
Snapshot chunk size 4.00 KiB
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 254:2

2. Create the ‘.img'( i called it .img, but it’s not ) file from the created snapshot and pipe to ssh to transfer…(also gzip transfer for faster speed and less bandwidth)

root@mailer:~# dd if=/dev/3ware/root-snapshot bs=30M | gzip -c -9 |ssh sto@your_ip -pyour_port “gzip -dc | dd of=/home/sto/mailer-root-snapshot”
sto@your_ip’s password:

good link: http://www.ibm.com/developerworks/library/l-lvm2/

Advertisements

From → LVM

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: