Show Menu
Cheatography

RedHat volume manager Cheat Sheet by

RedHat volume manager

LVM create

gdisk /dev/sdb (n -new; w -write)
pvcreate /dev/sdb1 /dev/sdb2
pvdisplay
vgcreate vg01 /dev/sdb1 /dev/sdb2
lvcreate -L50 -n lv01 vg01
lvcreate -l 40%VG -n lv02 vg01
lvcreate -l 100%FREE -n lv03 vg01
lvs
mkfs.xfs /dev/v­g01­/lv01
mount /dev/v­g01­/lv01 /mnt/t­est_1

STRATIS create

yum install stratisd strati­s-cli
systemctl enable --now stratisd
wipefs -a /dev/sdb
stratis pool create mypool /dev/sdb
stratis pool list
stratis fs create mypool stratis1
stratis fs list
mkdir /mnt/s­tra­tis_01
echo '/dev/­str­ati­s/m­ypo­ol/­str­atis1 /mnt/s­tra­tis_01 xfs defaul­ts,­x-s­yst­emd.re­qui­res­=st­rat­isd.se­rvice 0 0' >> /etc/fstab
mount -a
 

LVM delete

lvremove /dev/v­g01­/lv0*
vgremove vg01
pvremove /dev/sdb1 /dev/sdb2

LVM extent­ed/­reduce

vgreduce vg01 /dev/sdb2
vgextend vg01 /dev/sdb2
lvextend -l +100%FREE /dev/v­g01­/lv01
xfs_growfs /dev/v­g01­/lv01

STRATIS remove

stratis fs destroy mypool stratis1
stratis pool destroy mypool

VDO

yum install -y vdo kmod-kvdo
vdo create --name­=vdo1 --devi­ce=­/de­v/sdb --vdoL­ogi­cal­Size=1T
mkfs.xfs /dev/m­app­er/vdo1
mkdir /mnt/vdo1
cp /usr/s­har­e/d­oc/­vdo­/ex­amp­les­/sy­ste­md/­VDO.mo­unt.ex­ample /etc/s­yst­emd­/sy­ste­m/m­nt-­vdo­1.mount
what = /dev/m­app­er/vdo1 where = /mnt/vdo1
systemctl enable --now vdo1.mount
vdostats --huma­n-r­eadable
 

LVM other

mirror
lvcreate -L 1G -m1 -n lv-mir vg01
snapshot
lvcreate -L500 -s -n sn01 /dev/v­g01­/lv01
export
vgexport vg01
import
vgimport vg01
deactivate
vgchange -an vg01
activate
vgchange -ay vg01

VDO remove

systemctl disable --now mnt-vd­o1.m­ount
vdo remove --name­=vdo1
       
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          Vim Editor [Yet Another] Cheat Sheet