[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] restoring files to guest domains



I'm currently working on a backup strategy for my Xen domains, which I know has been discussed many times on this list. After looking at the various options, I've settled on creating LVM snapshots on the host (dom0) and centralizing all backups from it. This is easy to control, easy to do, allows me to continue running my guests during the process, and (despite some cautions I've read on the list) so far reliable for me.

However, I've hit a point where the whole thing seems to fall apart: restoring files. I have to just be being dense about this, but I can't find any way to copy a file BACK to the guest domain (short of either rebooting the guest or copying it across the network, neither of which is very practical.

So here's the deal.  I create my backups by doing the following:

lvcreate -L 50G -s -n guest-backup /dev/vg1/guest-disk
mount -t ext3 -o ro /dev/vg1/guest-backup /mnt/snapshot

This lets me copy off the backup files in a clean state. This works fine, so I then unmount/remove the snapshot.

umount /mnt/snapshot/
lvremove -f /dev/vg1/guest-backup

So far, so good. Now, let's say I need to restore a file to that guest-disk partition. Eg., let's say the /etc/fstab file on my guest somehow got corrupt and I want to restore a clean copy. How exactly do I do this?

From what I've read of LVM, v2 includes read/write support. So, I'd think that I could do the following and it'd just work:

lvcreate -L 50G -s -n guest-backup /dev/vg1/guest-disk
mount -t ext3 -o rw /dev/vg1/guest-backup /mnt/snapshot
cp /mnt/backup/guest/etc/fstab /mnt/snapshot/etc/fstab.restore
umount /mnt/snapshot/
lvremove -f /dev/vg1/guest-backup

From the host's perspective, this works fine. However, if I then login to the guest, the new fstab.restore file does not exist. I've tried this multiple times using various different techniques, but I can never get the file to actually show up. Like I said, I must either be really dense or I'm just misunderstanding the meaning of "read/write" here, because the file is certainly not being written as I'd expect.

Can anyone tell me what I'm doing wrong? If this just won't work as I'd expect it, how else can I write a file from the host to a live guest? Surely there must be some way to do it...

Thanks.

--
Jared

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.