There are cases where you would like to add an additional disk to a Xen guest VM, and make the newly added storage available to the VM. In order to add an additional hard drive to Xen VM, do the following.
On Dom0, create an image file for a new hard drive, and edit the Xen DomU config file for the VM to include the drive. In this example, I'll create a 10GB disk.
disk = ['file:/vm/myvm-disk1.img,xvda,w','file:/vm/myvm-disk2.img,xvdb,w']
Now start the Xen VM. The Xen VM should now see a new block device /dev/xvdb.
On Xen VM, configure the newly added disk as follows.
/dev/xvdb /disc ext3 defaults 0 0
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!