Table of Contents

goals

method 0: lvm-snapshots

grep ^disk /etc/xen/vm/blvm.run                                # get the lv-volume of the domU
lvs /dev/system/lv_domu_benchlvm                               # optional: verify the logical volume of the domU is accessable
lvcreate -s -L 2G -n lv_domu_benchlvm-snap /dev/system/lv_domu_benchlvm # create the snapshot in the volumegroup
kpartx -a /dev/system/lv_domu_benchlvm-snap                    # get the devnodes for mounting
fsck /dev/mapper/system-lv_domu_benchlvm--snap2                # optional: check if fs-structure is ok
mount /dev/mapper/system-lv_domu_benchlvm--snap2 /mnt/tmp      # mount the partition to be backupped
cd /mnt/tmp && tar cf ....                                     # do the actual full- or incbackup now
umount /mnt/tmp
kpartx -d /dev/system/lv_domu_benchlvm-snap                    # free the no longer needed devnodes
lvremove /dev/system/lv_domu_benchlvm-snap                     # and remove the snapshot again

method 1: copy/cloning of lvm-volume

lvcreate -s -L 2G -n lv_domu_benchlvm-snap /dev/system/lv_domu_benchlvm # create the snapshot
lvdisplay /dev/system/lv_domu_benchlvm             # how many le does the original volume consist of? here 1792
lvcreate -l 1792 -n lv_domu_benchlvm-copy system   # create a fresh volume of exact same size, or bigger
cat /dev/system/lv_domu_benchlvm-snap >/dev/system/lv_domu_benchlvm-copy # make the copy
lvremove /dev/system/lv_domu_benchlvm-snap         # remove snapshot
kpartx -av /dev/system/lv_domu_benchlvm-copy       # get devnodes of partitions
mount /dev/mapper/system-lv_domu_benchlvm--copy2 /mnt/tmp
for i in /mnt/tmp/etc/sysconfig/network/ifcfg-eth-id-aa*; do mv -v $i "`echo $i|sed -e 's,13,20,'`"; done
                                                   # fix network-devices
kpartx -dv /dev/system/lv_domu_benchlvm-copy       # remove devnodes
cp /etc/xen/vm/blvm.run /etc/xen/vm/blvmclone.run  # copy xenfile
vi /etc/xen/vm/blvmclone.run                       # modify name, macs, lvm-name
vi /etc/hosts                                      # add newly assigned ip/hostname
vi /etc/dhcpd.conf && rcdhcpd restart              # add newly assigned ip/hostname/mac
xm cr /etc/xen/vm/blvmclone.run

method 2: usual backupclient in domU

method 3: copy whole diskfile

method 4: mount diskfile

xm shutdown 110                                 # make sure domU is shut down.
grep ^disk /etc/xen/vm/bnas.run                 # what exactly is the diskfile?
lomount -diskimage /mnt/nfs_domu/domu_bnas -partition 2 /mnt/tmp
cd /mnt/tmp && tar cf ....                      # take the backup in you way..
cd; umount /mnt/tmp; xm cr /etc/xen/vm/bnas.run # cleanup & start up domU again.

method 5: dom0 with backupclient

method 6: capture whole domU-state