Installation guide

Many Linux guests use Logical Volume Management (LVM) volumes. Additional steps are required to
read data on LVM volumes on virtual storage images.
1. Add the partition mappings for the guest1.img to the recognized devices in the /dev/mapper/
directory.
# kpartx -a /var/lib/libvirt/images/guest1.img
2. In this example the LVM volumes are on a second partition. The volumes require a rescan
with the vgscan command to find the new volume groups.
# vgscan
Reading all physical volumes . This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
3. Activate the volume group on the partition (called VolGroup00 by default) with the
vgchange -ay command.
# vgchange -ay VolGroup00
2 logical volumes in volume group VolGroup00 now active.
4. Use the lvs command to display information about the new volumes. The volume names (the
LV column) are required to mount the volumes.
# lvs
LV VG Attr Lsize Origin Snap% Move Log Copy%
LogVol00 VolGroup00 -wi-a- 5.06G
LogVol01 VolGroup00 -wi-a- 800.00M
5. Mount /dev/VolGroup00/LogVol00 in the /mnt/guestboot/ directory.
# mount /dev/VolGroup00/LogVol00 /mnt/guestboot
6. The files are now available for reading in the /mnt/guestboot directory. Read or copy the
files.
7. Unmount the device so the guest image can be reused by the guest. If the device is mounted
the guest cannot access the image and therefore cannot start.
# umount /mnt/
8. Disconnect the volume group VolGroup00
# vgchange -an VolGroup00
9. Disconnect the image file from the partition mappings.
# kpartx -d /var/lib/libvirt/images/guest1.img
The guest can now be restarted.
33.8. Set t ing KVM processor affinit ies
This section covers setting processor and processing core affinities with lib virt for KVM guests.
Chapt er 33. T ips and t ricks
317