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

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



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> ."

Bas.


_______________________________________________
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®.