Port-xen archive

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

Re: installing a 4.1 DOMU



Le 17/07/2012 18:30, Brook Milligan a écrit :
What do you mean by "within the same system"? Mounting vnd0a and
installing the system inside?

I simply meant that if I drop into the shell while in sysinst, I can
manually mount /dev/xbd0a and install a complete system to
it. Thus, the DOM0 is presenting the underlying device to the DOMU
correctly.  However, even manually I cannot successfully run
disklabel on xbd0 as it seems to be readonly. I am confused about why
I can mount it read/write but disklabel thinks it is readonly.

That depends on how you declared your partitions and exposed them to domU.

If the domU tries to overwrite the sector containing the labels then the dom0 backend will likely return EROFS, hence "read only file-system." See [1] for an example.

- using the image file as a partition, rather than a disk. This can
lead to all kind of weird errors, like EROFS when attempting to
overwrite the disklabel.

I'm not certain I understand what you mean by this.  I am creating an
image file, using vnconfig on that to create a virtual disk from it,
and passing that virtual disk as a xen phy: device.  That seems to
work fine.  Is that not correct?

It is, however you have to know what you are doing.

Using phy: declares a device, so anything passed as a device will be used as a virtual disk, _even_ if it is a partition/label within dom0.

Let's illustrate this: suppose you create a disk.img file, then label it through vnd(4). What you do is:
- vnconfig -c vnd0 disk.img # declares disk as a vnd(4) device
- disklabel vnd0            # create labels in disk.img

Now you have labels on the vnd0 device, vnd0 is the whole disk (but not necessarily vnd0a as the label does not necessarily covers the whole disk).

If you pass phy:/dev/vnd0a, you are saying: "label/partition a will act as a virtual disk with regard to domU." It will be treated as a disk within domU, and used as one.

That's why it is preferable to use file:/path/disk.img for image files, because you expose the entire file as a disk to the domU, so they are treated the same way whether you use them within domU (through xbd(4)), or within dom0 (through vnd(4)).

This is not specific to Xen BTW, you have the same principle with LVM. You can add partitions or whole disks as physical volumes. See pvcreate(8).

Thanks for your help.

Hope that it is now a bit clearer :)

[1] http://www.kerneltrap.com/mailarchive/netbsd-tech-kern/2008/12/14/4416334

--
Jean-Yves Migeon


Home | Main Index | Thread Index | Old Index