Logical Volume Management (LVM) makes it easier to manage disk space. If a file system needs more space, it can be added to its logical volumes from the free spaces in its volume group and the file system can be re-sized as we wish. If a disk starts to fail, replacement disk can be registered as a physical volume with the volume group and the logical volumes extents can be migrated to the new disk without data loss.
In this article we will discuss few LVM interview questions with the answers for experience professionals.
1. How many volume groups can be created in Linux ?
2. How to reduce the logical volume ?
Ans: No.You can’t reduce the logical volume on mounted. Here is the steps to reduce the logical volume on redhat Linux.
a) Un-mount the filesystem
b) Run e2fsck on the volume device
c) Reduce the Filesystem.(resize2fs)
d) Reduce the logical Volume(lvreduce)
e) Mount the filesystem back for production.
3. How to do you scan the new disk for LVM physical volume ?
4. How to scan disks for existing volume group ?
5. How to scan a logical volume from exising volume group?
6. How to deactivate the logical volume ?
Ans: lvchange -an /dev/vg_name/lv_name
7. How to activated the logical volume which in deactivated state ?
Ans: lvchange -ay /dev/vg_name/lv_name
8. How to disable/deactivate the volume group ?
Ans: vgchange -an volume_group_name
9. How to enable/activate the volume group ?
Ans: vgchange -ay volume_group_name
10. How do you find that what are the disks are used for logical volume mirroring ?
Ans: lvs -a -o +devices
11. How to list the volume groups on the system ?
Ans: We use "vgs" command to display the volume group.
12. How to list the available logical volumes on the system?
Ans: We use “lvs” command to list the logical volumes on the system.
13. How to list the available physical volumes in LVM?
Ans: We use “pvs” command to list the physical volumes.
14. How to see the detailed volume group information ?
Ans: vgdisplay vg_name
15. How to see the detailed logical volume information ?
Ans: lvdisplay /dev/vg_name/lv_name
16. How to see the detailed physical volume information ?
Ans: pvdisplay /dev/disk_name
17. How to rename volume Group ? can we rename the VG on fly ?
Ans: vgrename Old_Name New_name
18. How to take a LVM configuration backup ?
Ans: vgcfgbackup vg_name
Note: The default volume group backup location is “/etc/lvm/backup” .
19. How to re-create the device files for LVM volumes ?
20. What is lvmdump ?
Ans: “lvmdump” is tool for LVM2 to collect the various information for diagnostic purposes.By default, it creates a tarball suitable for submission along with a problem report