[Fedora-xen] Format of guest image files?

Andrew Cathrow acathrow at redhat.com
Tue Dec 26 13:23:12 UTC 2006


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
If you run "losetup -a" you'll get a list of the loopback devices that
are configured.

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

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.

You need to use kpartx to add the partition mappings.

kpartx -a /dev/loop0 

This will add partition mappings under /dev/mapper.

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.

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. 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-xen/attachments/20061226/1ab763ef/attachment.htm>


More information about the Fedora-xen mailing list