Created
September 20, 2011 22:22
-
-
Save qw3r/1230608 to your computer and use it in GitHub Desktop.
backup LVM backed iSCSI target
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've created a san using Logical Volumes as backing-store iSCSI LUNs (tgt) | |
the target iqn.2011-09.com.pany.san:target1 using the LV /dev/vg0/t1l1 as backing-store | |
the initiator sees the device as /dev/sda | |
on the initiator i've created 2 partition /dev/sda1 (swap) and /dev/sda2 (ext4) | |
I want to be able to create backup on of the ext4 fs, without stopping the initiator! | |
The solution i came up with involves the snapshot feature of LVM, kpartx from multipath-tools and some backup method (i prefer rdiff-backup or safekeep). | |
steps: | |
1. lvcreate -s -n sh -L 10G /dev/vg0/t1l1 | |
2. kpartx -a /dev/mapper/vg0-sh | |
3. mount /dev/mapper/vg0-shp2 /mnt/backup | |
4. do the backup (rdiff-backup, safekeep, or just copy the files) | |
5. umount /dev/mapper/vg0-shp2 | |
6. kpartx -d /dev/mapper/vg0-sh | |
7. lvremove /dev/vg0/sh | |
That it! :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment