• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

UnixArena

  • Home
  • kubernetes
  • DevOps
    • Terraform
    • Jenkins
    • Docker
    • Openshift
      • OKD
    • Ansible engine
    • Ansible Tower
      • AWX
    • Puppet
  • Cloud
    • Azure
    • AWS
    • Openstack
    • Docker
  • VMware
    • vCloud Director
    • VMware-Guests
    • Vcenter Appliance 5.5
    • vC OPS
    • VMware SDDC
    • VMware vSphere 5.x
      • vSphere Network
      • vSphere DS
      • vShield Suite
    • VMware vSphere 6.0
    • VSAN
    • VMware Free Tools
  • Backup
    • Vembu BDR
    • Veeam
    • Nakivo
    • Azure Backup
    • Altaro VMBackup
    • Spinbackup
  • Tutorials
    • Openstack Tutorial
    • Openstack Beginner’s Guide
    • VXVM-Training
    • ZFS-Tutorials
    • NetApp cDot
    • LVM
    • Cisco UCS
    • LDOM
    • Oracle VM for x86
  • Linux
    • How to Articles
    • Q&A
    • Networking
    • RHEL7
  • DevOps Instructor-led Training
  • Contact

LVM- Linux Interview Questions

August 16, 2013 By Cloud_Devops 15 Comments

This article will share Redhat Linux’s  LVM Interview questions. LVM is one of the most important sub-system in Linux where you need  to provision multiple dynamic filesystems. If you attend any Linux interview, you can always expect more questions from LVM. I have intentionally posted this article for Interviewers who always search in internet for what to ask to the candidate.To select the right candidate, you should ask the quality interview questions.By asking the theatrical values will not help to find the right candidate. 

The below one is an example of bad interview question.

How many volume groups can be created in Linux ?
Answer :256. 
I feel this question is unnecessary and In day to day operation,you will never reach this limit.

I feel that the below interview questions can  help you to find the right candidate.
This articles just covers the LVM part.

1.Is it possible to increase the logical volume on fly ? 
Answer: Yes.We can increase the logical volume without umount it. 

2.How to reduce the logical volume ? is it possible to reduce on fly ?
Answer: No.You can’t reduce the logical volume on fly. Here is the steps to reduce the logical volume on redhat Linux.

  •    Un-mount the filesystem
  •    Run e2fsck on the volume device
  •    Reduce the Filesystem.(resize2fs) 
  •    Reduce the logical Volume(lvreduce)
  •    Mount the filesystem back for production.

 The detailed step by step guide is available here.

3.How to do you scan the new LUN or disk for LVM  physical volume ?
Answer:Use “pvscan” to scan existing physical volume from newly connected SAN or DISKS.

4.How to scan disks for existing volume group ? 
Answer:Use “vgscan” to scan existing volume group from newly connected SAN or DISKS.
But you should use “pvscan” prior to executing this command.

5.How to scan a logical volume from exising volume group? 
Answer: lvscan

6.How to stop the logical volume ? or deactivate the logical volume ?
Answer: “lvchange -an /dev/vg_name/lv_name” 

7.How to activated the logical volume which in deactivated state ?
Answer: “lvchange -ay /dev/vg_name/lv_name” .

8.How to disable the volume group ? or Deactivate the volume group ?
Answer:”vgchange -an volume_group_name” .

9.How to enable the volume group ? or Activate the volume group ?
Answer:”vgchange -ay volume_group_name” .

10.How do you find that what are the disks are used for  logical volume mirroring ? 
Answer: use “lvs -a -o +devices” 

11. What are steps to perform in order to increase the logical volume on fly ? 
Answer:

  •       Extend the logical volume
  •       Increase the Filesystem size
  •       Verify the status using df command or lvs command.

12.How to list the imported volume groups ?
Answer: Use “vgs” command to display the imported volume group.

13.How to list the available logical volumes on the system?
Answer: Use “lvs” command to list the available logical volumes on the system.

14.How to list the available physical volumes in LVM?
Answer: Use “pvs” command to list the available physical volumes.

15.How to see the detailed volume group information ?
Answer: Use “vgdisplay  vg_name”

16.How to see the detailed logical volume information ?
Answer: Use “lvdisplay  /dev/vg_name/lv_name”

17.How to see the detailed physical volume information ?
Answer: Use “pvdisplay /dev/disk_name”    Ex: pvdisplay /dev/sde

18.How to rename volume Group ? can we rename the VG on fly ? 
Answer:Yes.Its possible to rename the volume group on fly.But the mounted volumes will not reflect the same unless you re-mount the volume with new VG name.
Need to update the /etc/fstab with new VG name to mount the volumes across the system reboot.

19.How to take a LVM configuration backup ?
Answer:Use “vgcfgbackup vg_name” to take the latest configuration backup of volume group.The default volume group backup location is “/etc/lvm/backup” .
Refer:https://www.unixarena.com/2013/08/linux-lvm-volume-group-operations.html

20.How to re-create the device files for LVM volumes ?
Answer:Run “vgmknodes” to recreate the LVM devices files.

21.What is lvmdump ? 
Answer: “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

22.How to replace the failed hard disk in LVM ? 

23.How to create a mirrored logical volume ? 

24.How to create a striped Logical volume ? 

25.How to convert the linear volume to mirror volume ?

26.How are snapshots in LVM2 different from LVM1 in Redhat Linux?
Answer:LVM1 snapshots are  readonly by default where LVM2 snapshots were read/write.

27.What are the steps involved to create the logical volume from scratch ?
Answer: 
     i.Create a physical volume using pvcreate command.
       #pvcreate /dev/sdc
    ii.Create a volume group using “vgcreate” command 
       #vgcreate vg02 /dev/sdc
   iii.Create a logical volume using “lvcreate” command
       #lvcreate -L 100M -n vol1 vg02 
    iv.Create a filesystem on logical volume using mkfs command.
        #mkfs -t ext4 /dev/vg02/vol1
     v.Mount the filesystem using mount command for use.
        #mount -t ext4 /dev/vg02/vol1 /vol1

28.How to extent the volume group ? 
Answer:Using “vgextend” we can increase the volume group.

29.Assume Volume group “vg02” is already exists.How do you extend the volume group with 50GB ? Provide all the steps with commands.
Answer:
      1.Get the 50GB lun from SAN team.(/dev/sdd)
      2.Create physcical volume ( # pvcreate /dev/sdd )
      2.Extend the volume group (# vgextend vg02 /dev/sdd)

30.If the vg02 has two physical volumes called /dev/sdc/ & /dev/sdd. How do you remove /dev/sdd from vg02. 
Answer: “vgreduce vg02 /dev/sdd/”

31.How to decommission/remove  LVM completely from the host ?
Answer:
          1.Un-mount all the logical filesystems
          2.Remove the logical volumes using “lvremove” command.
          3.Destroy the volume group using “vgremove”  command.
          4.Use “pvremove” command remove the physical volumes from the system.

Many more to come …..

Thank you for reading this article.

Filed Under: Interview Questions, Linux-Interview Questions, LVM

Reader Interactions

Comments

  1. Viral Desai says

    May 9, 2021 at 3:48 pm

    Its really helpful. Pls post interview questions for other topics like NFS, DNS, and other Linux troubleshooting issues

    Reply
  2. satya says

    March 13, 2020 at 11:52 am

    answer 22,23,24,25

    Reply
  3. Raj Sharma says

    November 28, 2018 at 2:55 am

    its really helpful for us thanku for posting such goof articles

    Reply
  4. Naveen says

    January 6, 2017 at 9:45 pm

    Wonderful document and really helpful in clearing doubts.

    Reply
    • Ram says

      May 4, 2017 at 7:54 am

      Very good article

      Reply
  5. Maaz says

    December 16, 2016 at 10:28 am

    Thanks you very much , your post are awesome 🙂 .keep it up.

    Reply
  6. uday says

    December 15, 2016 at 3:56 pm

    This is very usefull article.Thank you for being so helful for beginners.I was asked “how to import & export volume group? Plz tell

    Reply
  7. pradip says

    May 19, 2016 at 7:07 pm

    thank you very much

    Reply
  8. Abhi says

    December 23, 2015 at 12:21 pm

    Thanks … this is really something I was looking for ..appreciate your help .

    Also , logo of the UNIXARENA is seems having little mistake in virtualization. Rest you guys are doing great job 🙂

    Reply
  9. Yatendra Vashishtha says

    March 5, 2015 at 1:47 pm

    it would be great if you can add significance of PE (physical extent) and LE (logical extent) during creation of logical volume and while backuping/restoring logical volume.

    Reply
  10. Yatendra Vashishtha says

    March 5, 2015 at 1:44 pm

    Pretty good stuff shared with respect to LVM.

    Thanks 🙂

    Reply
  11. Sai says

    August 18, 2014 at 4:58 pm

    Hi , I came across one question during my interview. What is the use of lvsplit and lvmerge . I guess both of these commands we will use in HP UX. Please let me know , whether these commands will work in RHEL too.

    Thanks In Advance.
    Sai Krishna

    Reply
  12. Prasad Joshi says

    July 22, 2014 at 3:25 pm

    nice information about LVM,please post more interview question regarding every topics.
    thank you

    Reply
  13. Thamizharasan P says

    March 6, 2014 at 3:07 am

    Superb , Its helped me lot to clear the Interview 🙂

    Reply
  14. RAJA SEKHAR REDDY GENUPULA says

    December 29, 2013 at 4:14 pm

    I have read the Total post, you are great. you have given total process. Thank you

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow UnixArena

  • Facebook
  • LinkedIn
  • Twitter

Copyright © 2025 · UnixArena ·

Go to mobile version