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/
Home Products Support Community News


Re: [Xen-users] img file to physical disk

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] img file to physical disk
From: Bas Mevissen <abuse@xxxxxxxxxxxxxx>
Date: Mon, 07 Apr 2008 13:22:25 +0200
Delivery-date: Mon, 07 Apr 2008 04:23:08 -0700
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 (Windows/20080213)
MS wrote:

just stop the domu, mount the image and the disk
# mount -o loop /foo/bar/myimage /mnt/old

If the image is a virtual disk, you need to skip to the first sector of
the partition:

losetup /dev/loop0 /foo/bar/myimage
sfdisk -l /dev/loop0 # get the start sector of the partition.

The first partition on the first sector of the second track. With 63
sectors per track, the offset is 63 * 512 = 32256.

# example:
losetup -o 32256 /dev/loop1 /dev/loop0
# now mount the first partition of the virtual disk
mount /dev/loop1 /mnt/old

# mount /dev/sdx1 /mnt/new

and copy all the files
# cd /mnt/old
# tar c * | tar x -C /mnt/new

Be carefull with "tar <options> *" as it skips hidden files in the root
directory. Better is to use "tar <options> ."


Xen-users mailing list

<Prev in Thread] Current Thread [Next in Thread>