X
X
Select Your Currency
₺ Turkish lira $ US Dollar
Skip to content
New Affiliate program: refer customers, earn 20%

ViHyper

How to Extend a Disk in CentOS 7 (LVM)

  • Secure checkout
  • Company invoice
  • Technical support
CentOS 7 1 min read 1576 views

Use the “Copy” button on code blocks to copy commands.

Update note

Official support for CentOS 7 ended on 30 June 2024; security updates are no longer released. For new installations choose a supported distribution such as AlmaLinux or Rocky Linux. The steps below apply to existing CentOS 7 servers.

This guide shows how to add newly allocated disk space to the root partition on a CentOS 7 server that uses LVM. Run the following commands in order:

parted /dev/sda --script mkpart primary $(parted /dev/sda print | grep lvm | awk '{print $3}') 100%
pvcreate /dev/sda3
vgextend cl /dev/sda3
lvextend /dev/cl/root /dev/sda3
xfs_growfs /dev/cl/root

The commands assume the disk is /dev/sda, the new partition is /dev/sda3 and the volume group is named cl. Check your own names with lsblk and vgs before running them, and take a backup first.

Affiliate ProgramFound this useful? Share it and earn.Get 20% commission on orders from customers you refer. Joining is free.Details
Turkey location VDS/VPSCompare Turkey-based virtual servers with SSD.
Plans from $2.56

Can't find the information you are looking for?

Create a Support Ticket

Did you find it useful?

(1576 times viewed / 6 people found it helpful)

Categories


Top