0% found this document useful (0 votes)
47 views

LVM3

The document provides information about Logical Volume Management (LVM) in Linux, including common LVM interview questions and answers. It begins with basic questions about what LVM is, its components, and how to create physical volumes, volume groups, and logical volumes. It then covers more advanced topics like logical volume types, resizing logical volumes, snapshots, and the differences between linear and striped logical volumes. The document aims to help candidates prepare for LVM questions that may come up during a Linux interview.

Uploaded by

Bharath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

LVM3

The document provides information about Logical Volume Management (LVM) in Linux, including common LVM interview questions and answers. It begins with basic questions about what LVM is, its components, and how to create physical volumes, volume groups, and logical volumes. It then covers more advanced topics like logical volume types, resizing logical volumes, snapshots, and the differences between linear and striped logical volumes. The document aims to help candidates prepare for LVM questions that may come up during a Linux interview.

Uploaded by

Bharath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Get Started

Exams
SuperCoaching
Test Series
Skill Academy
Pass
More
Search

Skill Academy
Career Programs
Mini Courses
Internship
Interview Questions
Digital Marketing
Web Development
Wordpress Development
Advanced Excel
Python Programming
Operating Systerm
Home
Interview Questions
Linux LVM Interview Questions
Linux LVM Interview Questions
Linux LVM Interview Questions
Last updated on May 5, 2023
Download As PDF
Linux LVM Interview Questions Exam Preparation
Linux LVM Interview Questions With Answers
If you're preparing for a Linux interview, you may encounter questions about
Logical Volume Management (LVM). LVM is a powerful tool that allows you to manage
disk space more efficiently on a Linux system. In this article, we've compiled a
list of common Linux LVM interview questions, ranging from basic to advanced, to
help you prepare for your interview. You'll find answers to questions like "What is
LVM in Linux?" and "How do you create a physical volume in LVM?" This article is
designed to help you ace your LVM interview by providing valuable insights into
what recruiters are looking for in a candidate. So, whether you're a seasoned Linux
admin or just starting out, read on to brush up on your LVM knowledge and be ready
to impress your interviewer.

Join Full Stack Development Course Online Now!

Crack SSC Exams with Top Teachers like Puneet Chaudhary and Ananya Singh
Get 6 Months SuperCoaching @ just

₹2999
₹799

wallet Your Total Savings ₹2200


Purchase Now
Want to know more about this Super Coaching ?
Explore SuperCoaching Now
Basic LVM Interview Questions
Q1: What is LVM, and why is it used?
A1: LVM (Logical Volume Manager) is a flexible and powerful disk management system
in Linux that allows administrators to manage disk space more efficiently. It is
used for the following reasons:
Simplifies disk space management by abstracting physical disks into logical volumes
Enables dynamic resizing of storage space as needed
Supports snapshots and backups
Facilitates storage expansion without downtime
Q2: Explain the basic components of LVM.
A2: The basic components of LVM are:

Physical Volume (PV): Represents a storage device, such as a hard disk or a disk
partition.
Volume Group (VG): A collection of one or more PVs, forming a pool of storage.
Logical Volume (LV): A virtual partition created from the VG, which can be
formatted with a file system and mounted.
Q3: How do you create a physical volume in LVM?
A3: To create a physical volume, use the pvcreate command:

pvcreate /dev/sdb1

Replace /dev/sdb1 with the appropriate device name.

Q4: How do you create a volume group in LVM?


A4: To create a volume group, use the vgcreate command:

vgcreate my_volume_group /dev/sdb1

Replace my_volume_group with the desired name and /dev/sdb1 with the appropriate
PV.

Q5: How do you create a logical volume in LVM?


A5: To create a logical volume, use the lvcreate command:

lvcreate -n my_logical_volume -L 10G my_volume_group

Replace my_logical_volume with the desired name, 10G with the desired size, and
my_volume_group with the appropriate VG.

Q6: What are the different types of logical volumes?


A6: The different types of logical volumes are:

Linear: A simple, contiguous allocation of storage from a VG.


Striped: Data is distributed across multiple PVs, improving performance.
Mirrored: Provides redundancy by maintaining copies of data on multiple PVs.
Thin-provisioned: Allows overcommitment of storage, allocating space on-demand.
Q7: How do you extend a logical volume?
A7: To extend a logical volume, use the lvextend command:

lvextend -L +5G /dev/my_volume_group/my_logical_volume

Replace +5G with the desired additional size and


/dev/my_volume_group/my_logical_volume with the appropriate LV.

Q8: How do you reduce a logical volume?


A8: To reduce a logical volume, follow these steps:

Unmount the file system: umount /dev/my_volume_group/my_logical_volume


Run a file system check: e2fsck -f /dev/my_volume_group/my_logical_volume
Resize the file system: resize2fs /dev/my_volume_group/my_logical_volume 15G
Reduce the LV: lvreduce -L 15G /dev/my_volume_group/my_logical_volume
Remount the file system: mount /dev/my_volume_group/my_logical_volume /mnt
Q9: What is a snapshot in LVM, and how do you create one?
A9: A snapshot is a point-in-time copy of a logical volume, used for backups or
testing. To create a snapshot, use the lvcreate command with the -s flag:

lvcreate -s -n my_snapshot -L 5G /dev/my_volume_group/my_logical_volume

Replace `my_snapshot` with the desired snapshot name, `5G` with the required
snapshot size, and `/dev/my_volume_group/my_logical_volume` with the appropriate
LV.

Q10: Explain the difference between linear and striped logical volumes.
A10:

- Linear Logical Volumes: In linear LVs, data is stored sequentially in a single PV


within the VG. When the first PV is filled, the data starts being stored in the
next PV. This type of LV is simple to set up and manage but may have slower
read/write performance compared to striped LVs.

- Striped Logical Volumes: In striped LVs, data is distributed evenly across


multiple PVs within the VG. This is achieved by breaking the data into chunks
(stripes) and writing them to different PVs in a round-robin fashion. This can
significantly improve the read/write performance of the LV due to parallel access
to multiple PVs. However, striped LVs require more complex setup and management,
and the failure of a single PV may lead to data loss.

pass-logo
Get Unlimited Access to Test Series for 880+ Exams and much more.
Know More
₹27/month
Buy Testbook Pass
Intermediate LVM Interview Questions
Q11. What are the benefits of using LVM over traditional partitioning?
A11. The benefits of using LVM (Logical Volume Manager) over traditional
partitioning are as follows:

Flexibility: LVM allows you to resize logical volumes (partitions) without


affecting the data stored on them, which is not possible with traditional
partitioning.
Disk management: LVM enables easy addition, removal, or modification of physical
storage devices, while traditional partitioning requires manual modification of
partition tables.
Snapshots: LVM supports the creation of snapshots, allowing you to create a point-
in-time backup of a logical volume.
Thin provisioning: LVM provides support for thin-provisioned logical volumes, which
allows for efficient storage utilization.
Increased performance: LVM can improve performance by enabling logical volumes to
span multiple physical disks or storage devices.
Q12. How do you display the current LVM configuration?
A12. To display the current LVM configuration, you can use the following commands:

pvdisplay: Displays information about physical volumes (PVs).


vgdisplay: Displays information about volume groups (VGs).
lvdisplay: Displays information about logical volumes (LVs).
Q13. How do you add or remove physical volumes from a volume group?
A13. To add a physical volume to a volume group, use the vgextend command:

vgextend <volume_group_name> <physical_volume>

To remove a physical volume from a volume group, first move the data from the
physical volume using pvmove, then use the vgreduce command:

vgreduce <volume_group_name> <physical_volume>

Q14. What is the difference between a physical extent and a logical extent?
A14. Physical extents (PEs) and logical extents (LEs) are both fixed-size blocks of
storage used in LVM:

Physical extents are the basic units of allocation within a physical volume.
Logical extents are the basic units of allocation within a logical volume.
The main difference between them is their function in the LVM hierarchy. Physical
extents are related to the physical storage devices, whereas logical extents are
related to the logical volumes created by users.

Q15. How do you migrate data from one physical volume to another?
A15. To migrate data from one physical volume to another, use the pvmove command:

pvmove <source_physical_volume> <destination_physical_volume>

This command will move all the data from the source physical volume to the
destination physical volume.

Q16. What are the limitations of LVM?


A16. Some limitations of LVM include:

Bootloader support: Not all bootloaders support booting from LVM, which may require
a separate boot partition.
Complexity: LVM can be more complex to set up and manage compared to traditional
partitioning.
Data recovery: Recovering data from an LVM-based system can be more challenging
than from traditional partitions.
Q17. How do you create a mirrored logical volume?
A17. To create a mirrored logical volume, use the lvcreate command with the -m
option:

lvcreate -L <size> -m <mirrors> -n <logical_volume_name> <volume_group_name>

Here, <mirrors> is the number of additional copies of the data (1 for a single
mirror).

Q18. What is a thin-provisioned logical volume, and how do you create one?
A18. A thin-provisioned logical volume is a volume that allocates storage space on
demand, only consuming physical storage when data is actually written to the
volume. This allows for more efficient storage utilization and over-provisioning of
storage.

To create a thin-provisioned logical volume, follow these steps:

Create a thin-pool within the volume group using lvcreate:


lvcreate -L <pool_size> --thinpool <thin_pool_name> <volume_group_name>

Create a thin-provisioned logical volume using the lvcreate command with the --
virtualsize and --thin options:
lvcreate -V <virtual_size> --thin -n <logical_volume_name>
<volume_group_name>/<thin_pool_name>

Q19. How do you resize a file system on a logical volume?


A19. To resize a file system on a logical volume, follow these steps:
Resize the logical volume using the lvresize or lvextend/lvreduce commands:

You might also like