LVM Flashcards

1
Q

What is LVM?

A

Logical Volume Manager can partition logical volumes (which are flexible) without needing to close the primary partition (dynamically allocated).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a dev mapper?

A

It’s a directory that maps the logical devices to their physical volumes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the advantages we take from LVM?

A

No downtime, is flexible, can resize (reduce or extend) volumes using a pool (volume group)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three stages of LVM?

A

pvcreate (physical volume) -> vgcreate (volume group) -> lvcreate (logical volume)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the “vgcreate” command do?

A

Creates a new volume group, which is a pool of volumes made up of 4 mib physical extents. The volume group is created from physical volumes and can, in turn, create logical volumes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the physical extent?

A

A physical extent is a small (4 MiB) chunking of data in a volume group. It’s the smallest building block of a logical volume.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Logical Unit Number?

A

A storage device that can be mounted as a volume

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does LVS command do?

A

Summarizes the logical volume

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to create physical volume?

A

pvcreate <device_name1> <device_name2></device_name2></device_name1>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is volume group? How to list volume groups?

A

A volume group is a pool of physical volumes. It can be listed with vgs or vgdisplay

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to create a volume group?

A

vgcreate <name_of_vg> </pv_to_include1> </pv_to_include2> ...</name_of_vg>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the types of logical volume?

A

Linear, striped, mirrored

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to extend a volume group?

A

vgextend <name_of_vg> </new_pv_to_include></name_of_vg>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to extend a logical volume?

A

lvextend -L/-l [+1G/+100%FREE/+extents] </dev/vg/lv>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to reduce a logical volume?

A

lvreduce -L/-l [-1G/-10%/-extents] </dev/vg/lv>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Command to resize the xfs file system?

A

xfs_growfs <mount-point> or you can use -r when resizing logical volumes</mount-point>

17
Q

Command to resize an ext4 file system?

A

resize2fs <file-system> or you can use -r when resizing logical volumes</file-system>

18
Q

How can we shrink the XFS file system on the logical volume?

A

Can’t shrink xfs

19
Q

You got a system there is a volume group eg VG_1 and it’s not showing up. What command would you use to show it up?

A

vgscan scans all SCSI, (E)IDE disks, multiple devices and a bunch of other disk devices in the system looking for LVM physical volumes and volume groups.

20
Q

How to list all Logical Volumes and associated Block devices?

A

lvdisplay

21
Q

How to see all the mounted file systems?

A

mount, df -hT

22
Q

How to scan LUN recently attached to your machine after booting of your machine?

A

echo “- - -“ > /sys/class/scsi_host/host0/scan

23
Q

How to format a disk with xfs file system?

A

mkfs.xfs /dev/partition

24
Q

How to mount a logical volume “LV1” on /mount_lv1

A

mount /dev/vg/LV1 /mount_lv1

25
Q

Your storage is full, and you added a new disk. What steps would you take before extending the LV?

A

pvcreate to add additional physical volume, vgextend to add that new physical volume to the usuable pool, and then resize lv with lvextend

26
Q

What is the difference between -L and -l in LV extend?

A

-L uses human readable sizes (G,M,k), whereas -l uses extents or percentages

27
Q

How to remove all the file system formats from a disk?

A

wipefs -a /dev/sda

28
Q

How to list the mounted file systems? Any two commands

A

mount or df -hT

29
Q

What file would you make an entry to make mount point boot persistent?

A

/etc/fstab