Logical Volume Manager Flashcards

1
Q

What is a physical volume?

A

Underlying physical storage unit used by LVM
Can use partition or entire block device
*partition type must be initialised/marked as Linux LVM to provide metadata to LVM

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

What is the structure for LVM?

A

── Logical Volume
└── Volume Group
├─── Physical Volume 1
└─── Physical Volume 2

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

What is an extent in a Volume Group?

A

Smallest amount of space that can be assigned to a volume group, also knows as physical extents. They are mapped to logical volumes

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

How do you create a Physical Volume?

A

pvcreate {/block/device}

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

How do you view Physical Volumes on the system?

A

pvdisplay

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

How do you create a Volume Group?

A

vgcreate {vgname} {/physical/volume}

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

How do you view Volume Groups on the system?

A

vgdisplay

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

How do you create a Logical Volume?

A

lvcreate -n {name} -L {size} {vgname}

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

How do you view Logical Volumes?

A

lvdisplay

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

On a Logical Volume what are the limitations of xfs vs ext4?

A

LVM using xfs can only be increased

LVM using ext4 can be increased and decreased

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

How do you delete a Physical Volume?

A

pvremove

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

How do you delete a Volume Group?

A

vgremove

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

How do you delete a Logical Volume?

A

lvremove

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

How do you format an LVM to be used as swap space?

A

mkswap {/lv/path}

i. e mkswap /dev/vg1/lvswap1
* formats with swap signature

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

How do you mount a swap disk?

A

swapon

i.e swapon /dev/vg1/lvswap1

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

How do you unmount a swap disk?

A

swapoff

i.e swapoff /dev/vg1/lvswap1

17
Q

How do you persistently mount swap a disk?

A

Edit /etc/fstab
UUID, /block/device
specify path and filetype of: swap

18
Q

How do you mount all swap disk entries listed in /etc/fstab?

A

swapon -a

19
Q

How do you format a partition/volume for swap?

A

mkswap {/block/device}

Partition must have an id type of Linux swap

20
Q

How do you get a summary about used swap devices?

A

swapon -s

*also located in /proc/swaps

21
Q

How do you add another block device to a volume group?

A

vgextend {vgname} {/physical/volume}

22
Q

If there are multiple block devices in a volume group, how do you move the data from one physical volume to others within the group so that it can be removed?

A

pvmove {/block/device}
Physical extents on the device will be copied to other physical volumes
*useful if changing partition format MBR vs GPT

23
Q

How do you remove a physical volume from a volume group?

A

vgreduce {vgname} {/physical/volume}

24
Q

How do you extend a logical volume?

A

lvextend {lvname} -L {size}

25
Q

Once a logical volume is extended how do you increase the filesystem size?

A

xfs: xfs_growfs {/mount/point}
ext4: resize2fs {/mount/point}
* lv must be mounted to see filesystem