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
VMWare tools free
Viewed 8961 times since Mon, Jul 16, 2018
20 Practical Examples of RPM Commands in Linux rpm
Viewed 7911 times since Mon, Feb 18, 2019
linux ssh How to Hide the OpenSSH Version Details when Telnet to Port 22
Viewed 4626 times since Wed, Apr 22, 2020
Linux – delete the LUN and remove traces from OS
Viewed 3453 times since Tue, May 22, 2018
tcpdump usage examples
Viewed 2225 times since Fri, Jul 27, 2018
Df command in Linux not updating actual diskspace, wrong data
Viewed 2777 times since Wed, May 30, 2018
RHCS6: Create a new Logical Volume / Global Filesystem 2 (GFS2)
Viewed 2154 times since Sun, Jun 3, 2018
Linux – How to check the exit status of several piped commands
Viewed 2874 times since Wed, Jul 25, 2018
debian Install a newer kernel in Debian 9 (stretch) stable
Viewed 1716 times since Sun, Sep 23, 2018
Red Hat 8 How to Set Up Automatic Updates for CentOS 8
Viewed 3588 times since Fri, Sep 25, 2020