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

Re: [Xen-users] Using LVM snapshots to backup NTFS partitions forwindows guests

  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Amos Shapira" <amos.shapira@xxxxxxxxx>
  • Date: Wed, 24 Oct 2007 14:13:11 +1000
  • Delivery-date: Tue, 23 Oct 2007 21:14:00 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TpQyb4aXl0XwQXC3Jf1mH7aQhocqybgxje0jDIFaI444W5WgaMLuPRYLzB/thngYzM/mKcdM5R4QBvNQlPkiTjcezfWlutEjQR+4W2fUvjLldpwyo6P/MdN6BTTS1H0uCx0pSmCvxfHAuxl+5D32lNzGdFBtawtJN6vXqbtWhj4=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

On 24/10/2007, James Harper <james.harper@xxxxxxxxxxxxxxxx> wrote:
> Hi everyone!
> I've been reading this list for a while and I'm thinking that the best
> way to do backups is using LVM snapshots as discussed here several
> times.
> The problem is that when i use a LVM logical volume as windows disk,
> windows writes the partition table onto the LV so the LV itself is not
> a partition - it's a whole disk.
> lvm/device-mapper does not create the partition devices in /dev so i
> cannot mount/access the ntfs partitions with anything but fdisk, and i
> would like to use ntfsclone or similar.
> Is there any way around this?

In the past I have done this by using loopback with an offset, but you need to do a few sums to get that right (eg figure out where in the disk image each partition starts etc).

Not very complicated. I've been doing that a few times in the last few days while trying to get CentOS 5 installer running under Debian Etch with Xen 3.0.3.

"fdisk -l -u /dev/xen/lvm-name" will give you the offsets. The "Units = " line will give you the multiplier (always was 512 for me).
Then you can do:

Find an available loop device:

# losetup -f

Setup the loop device with the right offset, the `expr...` backtick will multiply the number you got from fdisk by 512:

# losetup -o `expr offset-from-fdisk \* 512` /dev/loop1 image-file-or-lvm

After that yuou can do
# mount /dev/loop1 /mnt/mount-point

This is on Debian Etch (mount package version 2.12).

Hope this helps,


Xen-users mailing list



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