Disk & Storage Management (LVM, RAID)Linux System Administration

How to Safely Extend the Root Partition in Linux — LVM, GParted and Non‑LVM Methods

Running out of space on the root partition is a common problem on Linux servers and desktops. In this guide you will learn how to safely extend the root partition in Linux using multiple approaches: inspecting current usage, backing up critical data, expanding an LVM logical volume, resizing filesystems, and using GParted for non‑LVM systems. The main keyword for this article is “extend the root partition in Linux” and the steps shown below cover practical commands, real example outputs, safety checks, and best practices so you can perform the operation without data loss. Whether you are on Debian, Ubuntu, RHEL, CentOS or Arch, these methods will help you increase root capacity with confidence.

Check Current Disk Usage and Partition Layout

Before you change partitions or volumes, collect information about mounted filesystems and the block device layout. Start by checking disk space and where the root filesystem is mounted. The examples below show how to inspect usage with df, list partitions with fdisk, and display block devices with lsblk. Look for whether root is on an LVM logical volume (recommended for easy resizing) or on a traditional partition. If root is nearly full, record the current sizes and any unallocated space on the disk so you can plan how to extend it.

df -h

Filesystem                     Size  Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root     20G   18G  2.0G  90% /
tmpfs                          2.0G  1.2M  2.0G   1% /run

The -h flag makes sizes human‑readable (KB/MB/GB). The output shows the filesystem path, total size, used and available space, usage percentage, and mount point. Confirm which entry corresponds to / so you know whether it is an LVM logical device or a plain partition.

fdisk -l

Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Device     Boot Start       End   Sectors  Size Id Type
/dev/sda1        2048   41943039 41940992  20G 83 Linux
/dev/sda2    41943040  62914559 20971520  10G 83 Linux
/dev/sda3    62914560 104857599 41914560  20G 83 Linux

The -l flag lists the partition table for each disk. Pay attention to partition offsets, sizes, and whether there's unallocated space at the end of the disk. If you plan to move or resize partitions you must boot from a live environment to avoid modifying a mounted root partition.

lsblk

NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                        8:0    0    50G  0 disk
├─sda1                     8:1    0    20G  0 part /
├─sda2                     8:2    0    10G  0 part /home
└─sda3                     8:3    0    20G  0 part

lsblk shows the kernel device tree with mount points. Use this to confirm which device backs the root filesystem. If the root appears as /dev/mapper/... it indicates LVM; if it is /dev/sda1 it is a standard partition.

Backup Your Root Partition

Always back up before resizing or moving partitions. A consistent copy of root can be made with rsync to another disk, network share, or external drive. The rsync example below demonstrates a safe archive copy that preserves permissions, ownership and device files. If possible create a filesystem snapshot or boot into a live environment to ensure data consistency.

rsync -av --progress / /mnt/backup/root-backup/

sending incremental file list
./
bin/
bin/bash
boot/
etc/
etc/fstab
home/
var/
var/log/
sent 1.23G  received 12.4M  523.4K bytes/sec
total size is 1.41G  speedup is 1.13

The -a flag enables archive mode (recurses and preserves permissions, links, times and ownership), -v is verbose, and –progress shows per‑file progress. The output provides a brief transfer summary including total bytes sent/received and speedup.

If Root Is on LVM — Safe Online Expansion

If your root filesystem is inside LVM you can usually extend it without unmounting (online) as long as the filesystem supports online grow (ext4 and XFS do). The general steps are: (1) ensure there is free extents in the volume group (or add a new PV to the VG), (2) extend the logical volume, and (3) grow the filesystem. The commands below demonstrate identifying LVM devices, extending an LV by 10G, and resizing the filesystem for both ext and XFS types.

lsblk

NAME                          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                             8:0    0    60G  0 disk
└─sda2                          8:2    0    60G  0 part
  ├─vg_root-lv_root           253:0    0    20G  0 lvm  /
  └─vg_root-lv_home           253:1    0    30G  0 lvm  /home

This confirms the root volume is an LVM logical volume located at /dev/vg_root/lv_root. With this verified, you can extend the LV when the volume group has free space or after adding a new physical volume.

sudo lvextend -L +10G /dev/vg_root/lv_root

  Size of logical volume vg_root/lv_root changed from 20.00 GiB (5120 extents) to 30.00 GiB (7680 extents).
  Logical volume lv_root successfully resized

Here -L +10G increases the LV size by 10 GiB. The command adjusts the logical volume metadata; the filesystem still needs to be expanded to use the newly allocated space.

sudo resize2fs /dev/vg_root/lv_root

resize2fs 1.45.5 (07-Jan-2020)
Resizing the filesystem on /dev/vg_root/lv_root to 7864320 (4k) blocks.
The filesystem on /dev/vg_root/lv_root is now 7864320 blocks long.

Use resize2fs for ext2/3/4 filesystems. It can usually grow an ext filesystem while mounted (online) when supported. The output confirms the new block count and successful resize.

sudo xfs_growfs /

meta-data=/dev/mapper/vg_root-lv_root isize=512    agcount=4, agsize=131072 blks
data     =internal
grown filesystem from 20971520 to 31457280 blocks

For XFS filesystems use xfs_growfs and specify the mount point. XFS supports online growing, and the output indicates the filesystem was grown to the new block count.

When Root Is Not on LVM — Using GParted and Live Media

Non‑LVM root partitions require unmounting to resize. The safest way is to boot from a Live USB running GParted. The typical workflow: (1) boot live media, (2) use GParted to shrink a neighboring partition (for example /home) to create unallocated space, (3) move or expand the root partition into the freed space, and (4) apply changes and reboot. Moving partitions can take a long time and carries risk—always have a verified backup. If partitions are protected by encryption or special boot setups (EFI, GRUB, RAID) consult distro-specific guidance.

Important tips for non‑LVM resizing: ensure there is no RAID metadata on the disk, update /etc/fstab if partition UUIDs change, reinstall or update GRUB if the partition order changed, and run a filesystem check (fsck) after resizing.

Shrinking Another Partition to Free Space — Key Considerations

Shrinking another partition (like /home) to free space for root requires these checks: ensure the partition you will shrink has enough free space to safely reduce its filesystem, run filesystem-specific shrink tools (for ext4 use resize2fs while unmounted), and always perform the operation from a live environment. If the neighborhood contains logical volumes or LVM PVs, use LVM tools to shrink and move PVs rather than raw partition edits. Never trust a single copy—backup and verify before proceeding.

Verification and Cleanup

After any resize operation reboot (if necessary) and verify the new sizes and free space with df -h and lsblk. If you used GParted from live media ensure the filesystem is consistent and that bootloader configuration points to the correct UUID or device. Remove any temporary backup mounts and reconcile snapshot or backup retention policies.

df -h

Filesystem                     Size  Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root     30G   18G   11G  62% /
tmpfs                          2.0G  1.2M  2.0G   1% /run

Confirm the root filesystem now reports the expected larger size and increased available space. The output indicates the extension succeeded and usage percentage has dropped.

Conclusion

Extending the root partition in Linux can be straightforward when planned carefully. If your system uses LVM, online expansion (lvextend + filesystem grow) is the most flexible and least risky option. For non‑LVM systems, using GParted from live media is an accessible approach but requires unmounting the root filesystem and careful handling of partition moves. Always back up before any disk operations, verify disk layout with lsblk and fdisk -l, and pick the method that matches your environment. Following the procedures above will help you safely reclaim or add space to the root filesystem and keep your system running reliably.

2 Comments

  1. Great, practical guide to extending the root partition — one suggestion: add a quick section on handling XFS vs ext4 and when to boot from a live USB with GParted before resizing.

    1. Hi Alexander,

      Thanks for your feedback! You’re absolutely right, adding a section on the differences between XFS and ext4 would definitely make this guide even more comprehensive. I'll consider including a brief comparison of their resizing capabilities and the nuances of booting from a live USB when dealing with non-LVM systems. Great suggestion!

      Let me know if there’s anything else you’d like to see covered!

Odgovori na Rasho Poništi odgovor

Vaša email adresa neće biti objavljivana. Neophodna polja su označena sa *