Adding A Block Device To A Domu

This section apply to Debian Etch, as well as a Ubuntu 7.10.
If after booting your vm, you realize that you forget to add a special block from domain0, it is still possible to add it when you vm are runnig.
If you read the man page of xen :

# man xm

you will see that you need to do that :

# xm block-attach our_domU_id phy:/dev/hda /dev/sda rw

to add the real block device :

/dev/hda

from dom0 to a domU. But it doesn't work actually, and you will get this error :

Error: Invalid mode
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode>

Create a new virtual block device.

Strange, as the mode in the man page did say :

rw

or

ro

Actually, you have to specify an other mode, w instead of rw, and r instead of ro.
So, you have to type this :

# xm block-attach our_domU_id phy:/dev/hda /dev/sda w

and it will work.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License