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

Re: [Xen-users] Mounting *.img file



On Sat, 2012-04-14 at 19:15 +0100, Scott Meyers wrote:
> I am trying to figure out the offest sector for vm01.img2 partition. I
> tried many possible ways, for example (1020 *512) , but in vain. I
> just can't hit the right offest sector to mount vm01.img2 partition.
> Any help is greatly appreciated.

There is a tool called "kpartx" which is very useful here -- it will
read the partition table and create DM nodes corresponding to the
partitions on it. You might need to "losetup" the img to get a /dev/loop
and then run kpartx on that (I don't recall if kpartx handles loop
mounting too)

kpartx ought to be available on most distros, on Debian it is its own
binary package but the source is "multipath-tools" so YMMV may vary on
other distros.

Xen also ships "lomount" which automates the calculation of offset to
mount, but strangely I've never really used it.

Ian.




_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.