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

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

To: Xen-Users <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] img file to physical disk
From: Christian <chris@xxxxxxxxxxxxxxxx>
Date: Fri, 02 May 2008 21:20:54 +0000
Cc: Bas Mevissen <abuse@xxxxxxxxxxxxxx>
Delivery-date: Fri, 02 May 2008 14:21:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <47FA03F1.8060808@xxxxxxxxxxxxxx>
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>
References: <47FA03F1.8060808@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.12 (X11/20080226)
Hi Bas,

i stuck a bit. This is what I tried.
tyan:/var/lib/xen # cd images/api/
tyan:/var/lib/xen/images/api # losetup /dev/loop0 disk0
tyan:/var/lib/xen/images/api # sfdisk -l /dev/loop0
Disk /dev/loop0: cannot get geometry

Disk /dev/loop0: 1305 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start     End   #cyls    #blocks   Id  System
/dev/loop0p1 0+ 65 66- 530113+ 82 Linux swap / Solaris
/dev/loop0p2         66    1304    1239    9952267+  83  Linux
/dev/loop0p3          0       -       0          0    0  Empty
/dev/loop0p4          0       -       0          0    0  Empty

now I stuck
what to do to mount "loop0p2". This is the partition I want to mount.
Thanks for your help

Kind regards
Chris


Bas Mevissen schrieb:
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

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

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-users] img file to physical disk, Christian <=