User Tools

Site Tools


info:vmdk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
info:vmdk [2011-07-21 22:35]
sam [Mounting (Linux)]
info:vmdk [2011-07-21 23:06] (current)
sam [Mounting (Linux)]
Line 25: Line 25:
 ''​vmware-mount''​ can be used to mount partitions in a VMDK file. ''​vmware-mount''​ can be used to mount partitions in a VMDK file.
  
-Flat VMDK files are just raw images of the disk, so they can be mounted directly; however, you have to find the first sector of the disk. For example, see [[http://​cromoteca.com/​en/​blog/​mountflatvmwarediskimagesunderlinux/​|Mount Flat VMWare Disk Images Under Linux]]. It looks like the ''​kpartx''​ program can be used to automatically set up loop devices for each partition, but I couldn'​t get the device to mount the one time I tried it. If you can find the right offset (try ''​fdisk -l -u <​file>'',​ multiply start by 512, or the number of bytes per sector; or ''​parted foobar-flat.vmdk unit B print'',​ which gives you bytes), you can skip the ''​losetup''​ described in the previously-mentioned article, because mount will do it for you:+Flat VMDK files are just raw images of the disk, so they can be mounted directly; however, you have to find the first sector of the partition (if the disk has partitions). For example, see [[http://​cromoteca.com/​en/​blog/​mountflatvmwarediskimagesunderlinux/​|Mount Flat VMWare Disk Images Under Linux]]. It looks like the ''​kpartx''​ program can be used to automatically set up loop devices for each partition, but I couldn'​t get the device to mount the one time I tried it. If you can find the right offset (try ''​fdisk -l -u <​file>'',​ multiply start by 512, or the number of bytes per sector; or ''​parted foobar-flat.vmdk unit B print'',​ which gives you bytes), you can skip the ''​losetup''​ described in the previously-mentioned article, because mount will do it for you, given the right option:
  
 <​code>​ <​code>​
 mount -o loop,​offset=1048576 foobar-flat.vmdk /mnt mount -o loop,​offset=1048576 foobar-flat.vmdk /mnt
 </​code>​ </​code>​
 +
 +===== Images Without a Partition Table =====
  
 If the disk image doesn'​t have a partition table (i.e. the raw block device is formatted with whatever filesystem; this is useful to be able to increase the size while the virtual machine is online), ''​vmware-mount''​ won't be able to mount it. However, if it's a flat image, you can just mount it directly: If the disk image doesn'​t have a partition table (i.e. the raw block device is formatted with whatever filesystem; this is useful to be able to increase the size while the virtual machine is online), ''​vmware-mount''​ won't be able to mount it. However, if it's a flat image, you can just mount it directly:
info/vmdk.txt · Last modified: 2011-07-21 23:06 by sam