🖥️lvm

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the lvm command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ██╗    ██╗   ██╗███╗   ███╗
#                ██║    ██║   ██║████╗ ████║
#                ██║    ██║   ██║██╔████╔██║
#                ██║    ╚██╗ ██╔╝██║╚██╔╝██║
#                ███████╗╚████╔╝ ██║ ╚═╝ ██║
#                ╚══════╝ ╚═══╝  ╚═╝     ╚═╝
                                           
                                           
														 
#Exclusive Activation of a Volume Group in a Cluster 
#Link --> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/High_Availability_Add-On_Administration/s1-exclusiveactive-HAAA.html 
1> vgs --noheadings -o vg_name
2> volume_list = [ "rhel_root", "rhel_home" ]
3> dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
4> Reboot the node
5> uname -r to verify the correct initrd image

#==============================#
# CMD LVM 
#==============================##==============================#
https://thomas-krenn.com/de/wiki/LVM_vergrößern

vgdisplay
lvdisplay
pvdisplay
# LVM's anschauen long

vgs
lgs
pgs
# LVM's anschauen short

lvextend -r --size +10G /dev/vg/opt
# vergrößern mit der option -r resized gleich das filesystem

lvdisplay

swapoff /dev/vg/swap
# swap aus

lvextend -L+1G /dev/vg/swap
mkswap /dev/vg/swap
swapon /dev/vg/swap
# LVM SWAP Vergrössern

pvcreate /dev/sdb /dev/sdc /dev/sdd
# To create physical volumes on top of /dev/sdb, /dev/sdc, and /dev/sdd

lvcreate -n vol_projects -L 10G vg00
# The -n option is used to indicate a name for the LV, whereas -L sets a fixed size and -l (lowercase L) is used to indicate a percentage of the remaining space in the container VG.

mkfs.ext4 /dev/vg00/vol_projects
# create a filesystem on top of it

lvreduce -L -2.5G -r /dev/vg00/vol_projects
# resizing each filesystem

lvextend -l +100%FREE -r /dev/vg00/vol_backups
# resizing each filesystem

vgextend vg00 /dev/sdd
# Adding the remaining PV from our initial setup (/dev/sdd).

blkid /dev/vg00/vol_projects
# to find out what its UUID (a non-changing attribute that uniquely identifies a formatted storage device) is

#==============================##==============================#
# CMD LVM						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░