[Fedora-xen] Format of guest image files?

Phil Rhoades phil at pricom.com.au
Tue Dec 26 18:01:40 UTC 2006


Andrew,

Thanks for the reply - see inline comments:


On Tue, 2006-12-26 at 08:23 -0500, Andrew Cathrow wrote:
> Let's say that your image is called /var/lib/xen/images/disk.img
> 
> First you need to access that file like a loopback device 
> 
> losetup -f /var/lib/xen/images/disk.img
> 
> that will create a device like /dev/loop0


OK, that seemed to work.


> If you run "losetup -a" you'll get a list of the loopback devices that
> are configured.


I get:

	/dev/loop0: [0344]:49158 (/home/fc6v1)


> Lets presume that it was /dev/loop0 that was created.


Correct.


> You have a device now but you don't have partitions yet.
> You can do fdisk -l /dev/loop0  to see what partitions are in the
> loopback device but you can't access them yet.


I get:

Disk /dev/loop0: 1610 MB, 1610612736 bytes
255 heads, 63 sectors/track, 195 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

      Device Boot      Start         End      Blocks   Id  System
/dev/loop0p1   *           1         195     1566306   83  Linux


> You need to use kpartx to add the partition mappings.
> 
> kpartx -a /dev/loop0 
> 
> This will add partition mappings under /dev/mapper.


I now have:

	brw-rw----  1 root disk 253,  0 Dec 27 04:32 loop0p1


> You should now be able to access these like regular partitions.
> If you used LVM during your install then you'll need to do a vgscan
> and a vgchange -ay to activate the volume groups. 
> Now you can mount the partitions/logical volumes.


Yes, when I do:

	mount /dev/mapper/loop0p1 /mnt

I can then see all the directories under /mnt!


> At this point I hope you didn't use the default partitioning for both
> the guest and the host, otherwise you'll have duplicate VG names.


No, I used one big 1.5GB partition - I avoid using LVM usually anyway.

Many thanks!

Now I just have to work out how to get a REALLY minimal guest install -
a la The RULE Project or The FedoraCD project, although as an exercise I
will probably reduce the RPMs in the current guest as much as possible
myself to begin with.

Regards,

Phil.


> There is a way to rename volume groups but that's a story for another
> day .....
> 
> 
> 
> On Tue, 2006-12-26 at 19:28 +1100, Phil Rhoades wrote: 
> > People,
> > 
> > Firstly, congratulations on some nice work! - I could not get
> > inter-guest or host-guest networking on FC5 but it started working
> > immediately on FC6 - thanks!
> > 
> > On a FC6 host I have created a FC6 guest minimal install (everything
> > checked off except for text networking) in a 1.5GB image file.  What is
> > the format of this image?  Is it possible to somehow use a loopback
> > switch to mount it like iso9660? - I want to be able to make a copy of
> > the image file; in the image, edit the /etc/sysconfig/network
> > and /etc/sysconfig/network-scripts/ifcfg-eth0 files; add an
> > appropriate /etc/xen config file and then be able to boot a second
> > guest.  Is this possible somehow?
> > 
> > Thanks,
> > 
> > Phil.
-- 
Philip Rhoades

Pricom Pty Limited  (ACN 003 252 275  ABN 91 003 252 275)
GPO Box 3411
Sydney NSW      2001
Australia
Mobile:  +61:(0)411-185-652
Fax:     +61:(0)2-8221-9599
E-mail:  phil at pricom.com.au





More information about the Fedora-xen mailing list