Subject: Re: [Fedora-xen] How to backup a Domu filesystem (on LVM) from Dom0 on Fedora 8 ?

Anne Facq annefacq at crpp-bordeaux.cnrs.fr
Sun Jun 8 09:56:53 UTC 2008


Henok Mikre wrote:
> This helped me a great deal. Thanks. I just have a few questions...
> 
> 1) is it best to unmount the /mnt/lvfoo/ before or after kpartx -d? because you have it in your procedure list both before and after kpartx -d. 

The /mnt/lvfoo must be unmounted before the kpartx -d, otherwise
it will generate problems on the filesystem of the DomU (because the 
kpartx -d deletes partition mappings)

But the line "umount /mnt/lvfoo" after "kpartx -d" is an error due to a 
"copy and paste", sorry.

So here are the steps to backup a Domu (filesystem on LVM in backend and 
on xvda in frontend) with the dump command from Dom0 (Fedora 8) :

------------------------------------------------------------
# The DomU named "foo" must be stopped before dump
xm shutdown -w foo

# Creates device mapper mappings /dev/mapper/lvfoop[1234] for
/dev/vg00/lvfoo
kpartx -v -a /dev/vg00/lvfoo

# Mounts temporarly the filesystem to backup
mount /dev/mapper/lvfoop1 /mnt/lvfoo/

# Launches the dump
/sbin/dump 0 -L FULL_foo -f /BACKUP-XEN/foo.colddump /mnt/lvfoo/

# Umount the filesystem
umount /mnt/lvfoo/

# Removes the mappings
kpartx -d /dev/vg00/lvfoo

# The DomU can now be restarted
xm create --config /var/lib/xend/....
------------------------------------------------------------

> 2) is it possible to explore this dump file by either mounting it or some other method?

You can explore the dump file, using the "restore" command like this
restore -if /var/BACKUP-XEN/foo.colddump

You can also restore in another filesystem the filesystem (of the Domu) 
that you backuped, following these steps :

lvcreate -L2048 -n lvfoo2 vg00
mkfs.ext3 /dev/vg00/lvfoo2
mkdir /mnt/lvfoo2
mount /dev/vg00/lvfoo2 /mnt/lvvfoo2
cd /mnt/lvfoo2
restore -rf /BACKUP-XEN/foo.colddump

> 4) is this the best possible method of backing up a domU?

This method works well, but I would be interested in knowing other 
methods :-)

Regards

Anne Facq





More information about the xen mailing list