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

Re: [Xen-users] mount a .img file


  • To: dave <dave@xxxxxxxxxxxxxxx>
  • From: Chris Petrolino <cpetrolino@xxxxxxxxx>
  • Date: Thu, 13 Jan 2011 17:05:30 -0500
  • Cc: "xen-users@xxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 13 Jan 2011 14:06:55 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=t7uOvS5jU8eac3Jj0jt54LiA8sW3wU5noR49nrIrlViv5U0GwsY1rd1V/zatm2ukax ixnYC7Oypdhiry4uP3wLwgJzmQ8IdXFSch99zoUHS4VJuElGOnOw6pTD02DuA4jhJK/1 PkNP7QPAktJLVGSVNmOBxddxYH23xsKTuZoFU=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Aha that's most likely what I was forgetting! I will give that a shot and 
report back. Thanks a million guys 

Kind Regards,

Christopher James Petrolino


On Jan 13, 2011, at 5:01 PM, dave <dave@xxxxxxxxxxxxxxx> wrote:

> If it's a disk image you need to provide an offset, for example
> 
> mount -o loop,offset=32256 /xen/guest.img /mnt/tmp
> 
> the offset depends on the partitioning of the disk file.  for example:
> 
> ~$ fdisk -l -u -c guest.img
> 
>    Device Boot      Start         End      Blocks   Id  System
> guest.img1   *        2048     9920511     4959232   83  Linux
> guest.img2         9922558    10483711      280577    5  Extended
> guest.img5         9922560    10483711      280576   82  Linux swap / Solaris
> 
> this disk image has a 2048 cylinder boot sector, so the offset would be 
> 2048*512, or 1048576
> 
> another example:
> 
> ~$ fdisk -l -u -c guestA.img
> 
>     Device Boot      Start         End      Blocks   Id  System
> guestA.img1   *          63     1767149      883543+  83  Linux
> guestA.img2         1767150     1992059      112455    5  Extended
> guestA.img5         1767213     1992059      112423+  82  Linux swap / Solaris
> 
> this has a 63 cyl boot sector, so the offset would be 63*512 = 32256.
> 
> as a shortcut, (in bash shell) you can do this:
> 
> mount -o loop,offset=$((512*63)) guestA.img /mnt/tmp
> 
> 
> 
> On 01/13/2011 01:51 PM, Steven Timm wrote:
>> What's the output of
>> 
>> file /xen/guest.img
>> 
>> probably you need to specify -t ext2
>> but the file command will tell you for sure.
>> 
>> Steve
>> 
>> 
>> On Thu, 13 Jan 2011, Christopher J Petrolino wrote:
>> 
>>> Ok guys I am wondering if anyone can help me out here. I am trying to
>>> mount a xen .img file. when I try to do a mount -o loop /xen/guest.img
>>> /mnt/tmp I get a message saying that I need to specify a partition
>>> type.. What am I missing?
>>> 
>>> Many thanks in advance,
>>> 
>>> CJP
>>> 
>>> _______________________________________________
>>> 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


 


Rackspace

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