Creating an Nth disk drive for a VM

fallocate -l 500G /store/images/
ls -lh /store/images/
chown libvirt-qemu:mlocate /store/images/
l -lh /store/images/
chmod 600 /store/images/

Create an xml file describing the disk

cat > ran.sdb.xml
<disk type='file' device='disk'>
        <driver name='qemu' type='raw' cache='none'/>
        <source file='/store/images/'/>
        <target dev='vda'/>

Attach the new store to the VM

virsh attach-device ran.sdb.xml 

You will have to reboot the VM to see the device.

Then you can

mkfs.ext4 /dev/vda

Edit /etc/fstab and mount the new volume

Last modified 6 years ago Last modified on Oct 6, 2013, 7:55:58 AM