|  |  | 
  
    |  |  | 
 
  |   |  | 
  
    |  |  | 
  
    |  |  | 
  
    |   xen-users
Re: [Xen-users] img file to physical disk 
| 
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 <=
 |  |  | 
  
    |  |  |