Last active
August 30, 2022 11:11
-
-
Save mikerodionov/39226d58395cde516cc37f471c7eb3e4 to your computer and use it in GitHub Desktop.
CentOS LV resize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.microsoft.com/en-us/azure/virtual-machines/linux/resize-os-disk-gpt-partition | |
# LVM Linux (RHEL/CentOS) | |
# Confirm partition type (MBR/GPT) | |
parted | |
# Check available space | |
sudo pvs | |
# Identify LV for / - e.g. sda2 rootvg-rootlv | |
lsblk -f | |
# Check available space within VG | |
vgdisplay rootvg | |
# Resize to use all disk space | |
# Install tools | |
yum install cloud-utils-growpart gdisk | |
# Determine which disk and partition holds the LVM physical volume or volumes (PV) | |
pvscan | |
# Verify partition size - if not all space used expand | |
lsblk /dev/sda4 | |
# Expand partition | |
# Confirm partition N | |
parted -l /dev/sda | |
# Expand partion | |
sudo growpart /dev/sda 2 | |
# Verify partition size | |
lsblk /dev/sda2 | |
# Expand PV | |
pvresize /dev/sda2 | |
# Verify PV size | |
pvscan | |
# List LVs | |
lsblk /dev/sda2 | |
# Expand LV | |
sudo lvresize -r -L +110 /dev/mapper/rootvg-optlv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment