Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9
CentOS 7 is end of life. Converting a running system from a single root partition to LVM in place means copying the whole system and rebuilding the boot configuration, and a mistake leaves the server unbootable. For most servers there is a safer way.
Do you need LVM?
On a VPS you usually do not. When the disk is enlarged, a plain partition grows just as easily with growpart (see "How to Expand ext2/3/4 and XFS Root Partition on Linux Without LVM ?"). LVM helps when you want to combine several disks, create snapshots, or resize volumes independently.
Recommended: reinstall with LVM and move your data
- Back up your data, databases and configuration (
/etc,/home,/var/www, database dumps). - Install AlmaLinux 9 / Rocky Linux 9 with automatic partitioning: the installer creates LVM volumes by default. On a dedicated server, ask our support team for an LVM layout when ordering or reinstalling.
- Restore your data and settings, and test your services.
Adding LVM storage without reinstalling
If you only need flexible storage for data, keep the root partition as it is and put a second disk under LVM:
pvcreate /dev/vdb vgcreate data /dev/vdb lvcreate -n www -l 100%FREE data mkfs.xfs /dev/data/www mkdir -p /srv/www && mount /dev/data/www /srv/www echo "/dev/data/www /srv/www xfs defaults 0 0" >> /etc/fstab
Later, add another disk with vgextend data /dev/vdc and grow the volume with lvextend -r -l +100%FREE /dev/data/www.
Note: Take a backup before you change partitions or upgrade the operating system. A mistake can make data unreadable or the server unbootable.