Investigation 1: Adding a physical volume
- Stop the VM "fedora1".
- Dump the XML for the virtual machine 'fedora1' into a file:
virsh dumpxml fedora1 >fedora1.xml
- Examine the file to determine the structure.
- Add another virtual disk to the XML configuration file. Use the filename
/var/lib/libvirt/images/fedora1-1.img
. - Redefine the VM using the XML configuration file:
virsh define fedora1.xml
- Create the tile
/var/lib/libvirt/images/fedora1-1.img
as an empty file with a size of 10G:dd if=/dev/zero of=/var/lib/libvirt/images/fedora1-1.img bs=1G count=10
- Start the VM.
- You should now have a new disk,
/dev/vdb
- Use
fdisk
to create a single primary partition that fills all of the new disk. - Use
pvcreate
to format the new partition as a physical volume:pvcreate /dev/vdb1
- Use
vgextend
to add the new PV to your volume group:vgextend InsertNameOfYourVGhere /dev/vdb1
- Use
lvextend
to extend the size of the root filesystem by 5G:lvextend InsertNameOfYourVGhere/InsertNameOfYourLVhere --size +5G -r
- Note that the
-r
resizes the filesystem withing the LV and is critically important!
- Note that the
- Confirm that the LV has been resized.
- Record notes about this investigation in your lab book.