WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] restoring files to guest domains

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] restoring files to guest domains
From: Jared <list-xen@xxxxxxxxxxx>
Date: Wed, 05 Mar 2008 22:18:48 -0600
Delivery-date: Wed, 05 Mar 2008 20:19:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.12 (X11/20080303)
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