LVM basic

LVM

SCAN a new disk
ls -l /sys/class/scsi_host/
grep mpt /sys/class/scsi_host/host?/proc_name
fdisk -l
echo "- - -" > /sys/class/scsi_host/host2/scan
 

OVERVIEW OF DISKS and PARTITIONS
lsblk
 
Summary of Volume  Groups
vgs (Volume Group Status)
 

Summary of Logical Volumes
lvs (Logical Volume Status)
 

 Volume Group
 Logical Volume
vgdisplay
vgdisplay vg_gsp_1
lvdisplay
lvdisplay vg_gsp_1
vgextend vg_gsp_1 /dev/sdc1


vgreduce vg_gsp_1 /dev/sdc1
lvextend /dev/vg_gg1/lv_root /dev/sdc1
lvextend --size +2G /dev/vg_gsp_1/lv_gpdisk_1

lvreduce /dev/vg_gg1/lv_root /dev/sdc1
vgcreate vg_gsp_1 /dev/sdb1

lvcreate -L 6G -n lv_gpdisk_2 vg_gsp_1
lvcreate -n lv_gpdisk_2 -l 100%FREE vg_gsp_1
lvremove /dev/vg_gsp_1/lv_gspvol_001

  mkfs -t ext4 /dev/vg_gsp_1/lv_gpdisk_1
mkfs.xfs /dev/vg_gsp_1/lv_gpdisk_1
resize2fs /dev/vg_gg1/lv_root


SHRINK VOLUME
umount /gspmount1
resize2fs -p /dev/vg_gsp_1/lv_gspvol_001 1G
e2fsck -f /dev/vg_gsp_1/lv_gspvol_001
resize2fs -p /dev/vg_gsp_1/lv_gspvol_001 1G
lvreduce -L 1G /dev/vg_gsp_1/lv_gspvol_001
mount /dev/vg_gsp_1/lv_gspvol_001 /gspmount1
INCREASE ROOT
vgdisplay vg_rhce
lvdisplay vg_rhce
vgextend vg_rhce /dev/sdc1
lvextend /dev/vg_rhce/lv_root /dev/sdc1
lsblk
df -h
resize2fs /dev/vg_gg1/lv_root   or xfs_growfs /dev/vg_gg1/lv_root
df -h

 
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
RHEL: How to rebuild and/or patch a RPM package
Viewed 8827 times since Sat, Jun 2, 2018
How To Create a Linux Swap File
Viewed 2532 times since Fri, Jun 8, 2018
Fałszujemy rozpoznania skanerów #2
Viewed 3046 times since Mon, May 21, 2018
HowTo: Find Out Hard Disk Specs / Details on Linux
Viewed 3601 times since Mon, Jan 28, 2019
Extending Linux LVM partitions - scripts
Viewed 6612 times since Sun, May 20, 2018
Using Kerberos security with Server for NFS
Viewed 9845 times since Wed, Jun 27, 2018
RHEL: GPT/MBR partition tables (using disks larger than 2 TiB)
Viewed 12405 times since Sun, May 27, 2018
chrt command: Set / Manipulate Real Time Attributes of a Linux Process
Viewed 11177 times since Mon, Feb 17, 2020
How to configure an SSH proxy server with Squid
Viewed 3205 times since Sun, Dec 6, 2020
HOWTO: Use SSL/port 465 in smarthost stunnel
Viewed 3912 times since Fri, Sep 28, 2018