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
awk printf
Viewed 15358 times since Wed, Aug 19, 2020
RHEL: Forgotten ’root’ password / using single-user to gain access
Viewed 7619 times since Sat, Jun 2, 2018
20 IPtables Examples For New SysAdmins
Viewed 2271 times since Fri, May 15, 2020
Index » Community Contributions » System encryption using LUKS and GPG encrypted keys for arch linux
Viewed 3286 times since Fri, Jul 13, 2018
ZFS: Snapshots and clones on zfs filesystems
Viewed 3173 times since Sun, Jun 3, 2018
RHEL: ACLs basics
Viewed 6322 times since Sun, May 27, 2018
YUM How to use yum command on CentOS/RHEL
Viewed 7279 times since Thu, Oct 25, 2018
Linux – delete the LUN and remove traces from OS
Viewed 3700 times since Tue, May 22, 2018
ubuntu How to Reset Forgotten Passwords in Ubuntu 16.04
Viewed 3497 times since Tue, Dec 8, 2020
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 4840 times since Thu, Apr 18, 2019