MaruOpsInfrastructure and AI notes

About (Korean)Contact (Korean)

Expand a Linux Root Partition Without LVM: growpart and resize2fs

Hard disk and Intel SSD on the desk

Reference photo · Hard disk and Intel SSD on the desk · Photo: machu. / Source / CC BY-SA 2.0 · Resized for listings; illustrative photo, not the tested environment

When root is directly on /dev/sda2 or /dev/nvme0n1p2, expansion does not involve LVM commands. Grow the virtual disk, extend the partition into adjacent space, then expand the matching filesystem. Verify that the required free space is immediately after the partition.

The target is an extension of XFS or ext4 on top of a regular partition without LVM·Encryption·RAID middle layer. First check the structure on Rocky Linux 9 and Ubuntu 24.04·26.04. If / is LVM, use the procedure in LVM root extension.

Linux operation articles seen together · Rocky 9 Fixed IP · Ubuntu 24.04 Netplan · Ubuntu 26.04·nmtui·systemd service·log·LVM root extension·general partition root Expand

On this page

1. Check the root device and empty space behind it

findmnt -no SOURCE,FSTYPE,OPTIONS /
df -hT /
df -ih /
lsblk -e 7 -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS

The main example in this article is /dev/sda2 → ext4 → /. If the device name and file system are different, replace them with the actual values. The total disk size, partition size, and file system size of df do not need to be the same value. There are also metadata and unit differences, but if large differences remain, check which steps are not reflected.

확장 전: [ EFI / sda1 ][ 루트 / sda2                  ]
디스크 확장 후: [ EFI / sda1 ][ 루트 / sda2 ][ 미할당 공간 ]
파티션 확장 후: [ EFI / sda1 ][ 루트 / sda2                     ]
마무리: sda2 안의 ext4 또는 XFS를 늘림

If there is a swap/recovery/other data partition behind it, the space added to the end of the disk may not be attached to the root. In that case, growpart will not extend the root beyond other partitions. Do not skip anything by changing the starting sector or deleting or recreating the partition.

2. Prepare backups and tools

VMs and data are backed up to another storage location in a restorable form. Expanding a virtual disk is usually easier than shrinking it, but if it fails, it cannot be restored by reversing the commands. If / is full, first secure the space necessary for installation and metadata recording.

# Rocky Linux 9
sudo dnf install -y cloud-utils-growpart xfsprogs e2fsprogs util-linux parted
# Ubuntu 24.04 / 26.04
sudo apt update
sudo apt install -y cloud-guest-utils xfsprogs e2fsprogs util-linux parted
sudo sfdisk --dump /dev/sda > partition-table-before.sfdisk
sudo parted /dev/sda unit s print free

Dumps are also stored in other storage locations. A partition table dump is not a backup of file contents. parted is used to check placement. If a GPT-related modification question arises after expansion, we check the status and handle it, and do not add an auto-correction option without knowing what it means.

3. Increase virtual disk in VMware

With the Workstation VM shut down, specify the target size using the Expand function of the Hard Disk and reboot. Check the documentation for the product you are using for restrictions such as actual menus and snapshots/encryption. Even if the virtual disk file grows, the file system in / does not automatically become the same size. Broadcom’s Disk Expansion Guide explains this difference.

lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS /dev/sda
sudo blockdev --getsize64 /dev/sda
sudo parted /dev/sda unit s print free

Make sure that the total disk size is larger than before and that there is contiguous space available immediately after the end of the root partition. If even the disk size remains the same in the OS, a proper rescan or reboot comes first. Also check to see if other virtual disks have been enlarged in VMware.

4. Increase the end of the partition with growpart

The example below assumes root is on /dev/sda2 and contiguous space is available immediately after it. The -N option displays the proposed change only. Verify the target and confirm that the starting sector is preserved before applying the actual change.

sudo growpart -N /dev/sda 2
sudo growpart /dev/sda 2
lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS /dev/sda
sudo blockdev --getsize64 /dev/sda2
root partitionDisk number to be inserted into growpartext4 extension target
/dev/sda2/dev/sda 2/dev/sda2
/dev/vda1/dev/vda 1/dev/vda1
/dev/nvme0n1p2/dev/nvme0n1 2/dev/nvme0n1p2

Do not enter the last p2 of the NVMe device as an argument. At this stage, what is growing is the end of the partition and the filesystem may still be at its previous size. If the kernel did not recognize the new partition size, check the device size again after the required reboot. You can check -N and argument format in the growpart manual.

5. Finish according to the file system format.

findmnt -no SOURCE,FSTYPE /

If ext4, specify the device path

sudo resize2fs /dev/sda2

Extend ext4 with the partition actually growing. It assumes a normal file system with online expansion supported. If there are errors that require separate offline checking, they are checked in the recovery environment. Do not force e2fsck on mounted /. The resize2fs manual, , also explains that this command does not change the partition table itself.

If XFS, specify the mount point

sudo xfs_growfs /

Runs only for XFS. This is not the order in which both ext4 commands and the previous ext4 command are executed. XFS expansion is performed while mounted, and shrinking is not supported as of RHEL 9. Check the device size and mount status based on the XFS extension document.

6. Confirm and close

findmnt -no SOURCE,FSTYPE,OPTIONS /
df -hT /
df -ih /
lsblk -o NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINTS
sudo journalctl -k -b -p warning --no-pager

Since the operation does not create a new partition, a typical simple expand preserves the existing UUID and fstab path. Do not run mkfs or replace fstab with the new device name you guessed. Verify that the app can write the file and that it mounts successfully after the planned reboot.

If NOCHANGE appears or there is another partition behind it

statusNext check
The entire disk size remains the same.Recognition status of hypervisor target disk and OS
The partition is already as large as the end of the diskCheck if there are any file system expansion steps left.
There is another partition behind the rootReview offline relocation, restoration, and migration plans
LUKS·LVM·RAID layers discoveredSwitch to expansion order including that layer
Read-only/I/O errorCheck storage device and file system failures first

The decision to remove swap or other partitions at the back should be handled as a separate task after checking whether the partition is used, fstab, and booting dependencies. Even if storage space is urgent, partition movement is not performed impromptu on the operating route.

If the capacity increase is focused on specific app data, you can also consider a design that uses a new disk as a dedicated path for that data. This is a data migration operation that requires a service stop, consistent copy, permissions/SELinux, fstab, and a recovery plan. You don’t just mv a directory and link to it. If journal growth is the cause, also check the storage policy of systemd service/log .

Verification range · 2026-10-18: The virtual boot disk of Ubuntu 24.04.5 VM was increased from 8GiB to 10GiB, and the ext4 partition and file system of the actual / was expanded. XFS was checked by increasing a separate regular partition from 2GiB to 3GiB and comparing the SHA-256 of the existing files. We did not perform verification by booting Rocky Linux 9 and Ubuntu 26.04 respectively to extend the root partition.

Download the network·systemd example file·Netplan YAML, bundled scripts that read service·environment files and storage structures. Change the address and device name to match the actual environment. It does not include scripts to auto-expand disks.