CharlieC3
7/21/2017 - 7:36 PM

Resize LVM

Resize LVM

#!/bin/bash

# Review some info
lsblk # List blocks
pvs # Physical volumes
vgs # Volume Groups
lvs # Logical volumes
df -h # Display filesystem

# Determine filesystem type
cat /etc/fstab

# Expand the physical disk size
pvresize /dev/xvdk

# Resize the logical volume, adding 1000GB
lvresize -L +1000G /dev/vgArtifactoryVol0/dp_mgmt_data1

# Resize the filesystem to match lvm - ONLY FOR ext3 and ext4 filesystems
resize2fs /dev/vgArtifactoryVol0/dp_mgmt_data1

# Resize the filesystem to match lvm - ONLY FOR xfs filesystems
xfs_growfs /dev/vgArtifactoryVol0/dp_mgmt_data1