RHCSA Exam EX200 Cheat Sheet Part 2


LVM

PV(/dev/sda) –> VG –> LV –> directory

Create PV change system ID to LVM (8e) under fdisk

pvcreate /dev/sdb1

To check PV: pvs or pvdisplay

create VG vgcreate vg-name /dev/sdb1 /dev/sdb2

To check VG: vgs or vgdisplay

create LV lvcreate -L 800M -n lv-name vg-name

To check LV: lvs or lvdisplay

create filesystem mkfs.ext4 /dev/vg-name/lv-name

Increase size

resize LV lvresize -L 900M /dev/vg-name/lv-name
resize filesystem resize2fs /dev/vg-name/lv-name

Shrink size
1. unmount the volume first
2. run filecheck fsck -f /dev/vg-name/lv-name

resize filesystem resize2fs /dev/vg-name/lv-name 800M
resize LV lvresize -L 800M /dev/vg-name/lv-name

Snapshot
1. Create a directory for snapshot
2. Create a snapshot of 100M on LV

lvcreate -L 100M -s -n lvmsnapshot /dev/vg-name/lv-name

3. mount the snapshot to retrieve file

mount -t ext4 /dev/vg-name/lvmsnapshot /directoy

delete snapshot:

lvmremove /dev/vg-name/lvmsnapshot

GUI tool for LVM

yum install system-config-lvm

Go on to part 3 of the cheat sheet

Related Posts with Thumbnails

About the Author

Alfred Tong
Author and owner of this blog. A Networking enthusiast, full time networking and systems Engineer. Generally curious about all things IT.Certifications: GIAC GSEC, CCNP-S, CCNP, CCSP, CCDP, CCNA, RHCE, JNCIA - FWV