Resizing an LVM partition, especially reducing the root ( / ) partition, requires careful planning because the root filesystem cannot be unmounted while the system is running.
To safely perform this operation, the server must be booted into a rescue environment, allowing administrators to modify disk partitions without risking data corruption.
This guide explains how to safely reduce an LVM root partition using SystemRescueCd.
Prerequisites
Before starting:
- Take a complete backup of your server.
- Ensure console or remote KVM access is available.
- Download SystemRescueCd from:
👉 http://www.sysresccd.org/Download
Step 1: Boot the Server in Rescue Mode
- Burn the SystemRescueCd ISO to a CD/DVD
or - Mount the ISO through:
- KVM
- IPMI
- Remote management console
Reboot the server and enter BIOS/Boot Menu.
- Set CD/DVD or Virtual Media as the primary boot device.
- Save changes and boot into the rescue environment.
- Follow on-screen instructions to load SystemRescue.
Step 2: Identify the Root LVM Partition
Before resizing, identify which LVM partition is mounted as /.
You can verify this using:
Check /etc/fstab
cat /etc/fstab Or display logical volumes
lvdisplay Note the LV Path, which typically appears as:
/dev/<volume-group>/<logical-volume> Step 3: Activate LVM Volumes
In rescue mode, LVM volumes are inactive by default.
Activate all volume groups:
vgchange -a y This makes the logical volumes accessible for maintenance.
Step 4: Perform Filesystem Check
Always check filesystem integrity before resizing.
e2fsck -f /dev/<volume-group>/<logical-volume> Wait for the check to finish completely before continuing.
Step 5: Resize the Filesystem
The filesystem must be reduced before shrinking the logical volume.
Resize it slightly smaller than the final target size (about 85–90%).
resize2fs /dev/<volume-group>/<logical-volume> <new-size> Example
To reduce the partition to 300GB, resize filesystem to 270GB first:
resize2fs /dev/<volume-group>/<logical-volume> 270G Step 6: Reduce the LVM Logical Volume
After shrinking the filesystem, reduce the logical volume:
lvreduce -L 300G /dev/<volume-group>/<logical-volume> Confirm when prompted.
Step 7: Verify the Changes
Verify the updated LVM size:
lvdisplay Ensure the logical volume reflects the new partition size correctly.
Final Step: Reboot the Server
Exit rescue mode and reboot normally:
reboot The system should now boot with the resized root partition.
Important Best Practices
- Always backup data before modifying partitions.
- Never reduce LVM size before shrinking the filesystem.
- Perform operations only from rescue mode.
- Double-check volume names to avoid data loss.
Conclusion
Reducing an LVM root partition requires booting into rescue mode because the root filesystem cannot be unmounted during normal operation. By activating LVM volumes, checking the filesystem, resizing safely, and then reducing the logical volume, administrators can resize partitions without damaging system data.
Need Assistance?
If you require any help during this process, contact the SupportPRO Server Admin.
Partner with SupportPRO for 24/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.
