Contents
- Why is the filesystem still full after enlarging the disk?
- Which storage layers need more space?
- How do you identify the correct disk and filesystem?
- What should you prepare before changing boundaries?
- How do you extend a partition safely?
- How do you grow ext4 or XFS without LVM?
- What changes when the server uses LVM?
- How do you confirm the expansion succeeded?
- Which mistakes should you avoid, and how can you plan ahead?
- How does CH-J Tools help with disk expansion?
- Frequently asked questions
Why is the filesystem still full after enlarging the disk?
You enlarge a virtual disk from 40 GiB to 80 GiB in the hosting panel, but df still reports roughly the old capacity. The extra space exists at the disk layer; the partition or filesystem above it still ends at its previous boundary. This is expected when the guest has not expanded those layers automatically.
The task is to follow the storage path for the full mount point and enlarge each layer that still limits it. This guide covers ordinary Linux partitions and conventional LVM logical volumes with ext4 or XFS. Commands use Ubuntu and Debian package names. Device names are examples, not defaults to copy onto an unknown server.
Choose either the plain-partition route or the LVM route after inspection. If you discover encryption, software RAID, a thin pool or a different filesystem, stop and prepare a procedure for that layout before changing anything.
Which storage layers need more space?
A filesystem stores files inside a block device. That device might be a partition directly, or a logical volume built from space managed by LVM. Increasing a lower layer does not guarantee that every layer above it has grown.
- Disk: the virtual hardware capacity presented by the hypervisor or provider and detected by Linux.
- Partition: a region of the disk whose start and end are recorded in the partition table.
- LVM physical volume and volume group: the storage LVM can allocate, including extents that are still free.
- Logical volume and filesystem: the block device allocated to a particular filesystem and the space that filesystem can use.
Without LVM, skip its layers. If LVM already has enough free extents, you can extend the logical volume without enlarging the disk or partition. A physical volume on a whole disk also has no partition to extend. Identify what exists rather than creating missing layers.
How do you identify the correct disk and filesystem?
Start with the mount point that needs space. These read-only commands inspect the root filesystem; replace / with /var or another target when appropriate. The final three commands apply when LVM is installed and used.
findmnt -T / -o SOURCE,FSTYPE,TARGET
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
df -hT /
sudo pvs
sudo vgs
sudo lvs -o lv_path,lv_size,segtype,devicesFor example, a plain-partition server after a disk upgrade might show the following simplified lsblk output. These sizes illustrate the mismatch, not a required layout:
NAME SIZE TYPE FSTYPE MOUNTPOINTS
sda 80G disk
sda1 1G part ext4 /boot
sda2 39G part ext4 /Here the disk is larger than its partitions, and / lives directly on /dev/sda2. If findmnt instead names a device under /dev/mapper and lsblk shows an lvm device, trace that logical volume back through pvs and lvs. Confirm its volume group and physical volume; one group can span several disks.
If the disk itself still has its old size, stop here. Confirm the provider changed the intended disk, then follow its guest rescan instructions or schedule a reboot with console access. Recheck the disk size before touching partitions.
What should you prepare before changing boundaries?
A wrong device or partition boundary can make the server unbootable or destroy data. Have a tested recovery path and a backup outside the affected disk before running growth commands. Partition-table and LVM metadata backups do not contain your files.
- Confirm a recent backup can be restored. For databases, use an application-consistent backup or a coordinated snapshot; a VM snapshot alone may not provide the recovery you need.
- Arrange access to the hypervisor or provider console and time for recovery or a reboot. Record the current disk, partition, mount and LVM details outside the server.
- On Ubuntu or Debian, install the required tools before the maintenance window. Use the appropriate filesystem package for your target.
- Inspect and save the existing partition table, then enlarge the virtual disk through the provider or hypervisor if that has not already been done.
sudo apt update
sudo apt install cloud-guest-utils e2fsprogs xfsprogs
sudo sfdisk --dump /dev/sdaThe last command only prints partition metadata. Save that output somewhere independent of this disk. The example assumes /dev/sda has already been identified as the correct disk. Ensure the server has enough working space for package management and temporary files; do not delete unfamiliar application data to make room.
How do you extend a partition safely?
For the plain-partition example, inspect the proposed change with growpart before applying it. The disk and partition number are separate arguments. Partition 2 on an NVMe disk would use /dev/nvme0n1 2, while the resulting partition device is /dev/nvme0n1p2.
sudo growpart -N /dev/sda 2Check that the proposal preserves the starting sector and increases the end into free space immediately after the partition. It must describe the partition you identified earlier. If another partition follows it, growpart cannot move that partition out of the way. Resolve that layout separately instead of forcing the operation.
Apply the following change only after checking the dry run against your saved layout and backup. Do not delete and recreate a live partition by guessing its original starting sector.
sudo growpart /dev/sda 2
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS /dev/sdaRun the commands separately and stop if growpart reports an error. Confirm Linux now sees the larger partition before continuing. If the kernel cannot update its view of an in-use partition, schedule a reboot and inspect again. A changed partition table on disk is not enough while the kernel still uses the old size.
How do you grow ext4 or XFS without LVM?
Use this section only when the filesystem sits directly on the enlarged partition. Check the filesystem type again with findmnt. Run just the command for that type, with the confirmed device or mount point.
For ext4 directly on /dev/sda2, resize2fs without a size argument expands to the available device size. Online expansion is supported on normal modern Linux ext4 installations, so a mounted root filesystem can usually remain mounted:
sudo resize2fs /dev/sda2For XFS mounted at /, grow the data section through its mount point. XFS must be mounted for this operation; if the target is mounted at /srv, use /srv instead:
sudo xfs_growfs -d /Do not run resize2fs against XFS or against a partition containing an LVM physical volume. A refusal to resize needs investigation of the actual layer and any reported errors, not a force option. Filesystem growth changes existing storage; formatting commands are never part of this procedure.
What changes when the server uses LVM?
This separate example assumes /dev/sda3 contains a conventional LVM physical volume and /dev/ubuntu-vg/ubuntu-lv is the target logical volume. Confirm those names and the layout with pvs and lvs first. For a partition-backed physical volume, use the partition checks above with partition number 3:
sudo growpart -N /dev/sda 3Review the proposal before applying it. After the partition grows and Linux reports its new size, pvresize makes that capacity available to LVM. Run each command separately and inspect failures before continuing:
sudo growpart /dev/sda 3
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS /dev/sda
sudo pvresize /dev/sda3
sudo pvs
sudo vgsIf the physical volume occupies a whole disk, skip growpart and use that confirmed disk as the pvresize argument. If the volume group already had sufficient free space, skip both operations. For a conventional logical volume, the following example adds 10 GiB; confirm at least that much free space exists in the correct group:
sudo lvextend -r -L +10G /dev/ubuntu-vg/ubuntu-lvThe -r option also requests filesystem growth using the installed helper tools. Inspect both the logical volume and filesystem afterwards. If the volume grew but filesystem resizing failed, diagnose that failure and grow the filesystem on the logical volume, not on /dev/sda3. Do not repeat +10G blindly. The alternative -l +100%FREE allocates all remaining free extents in the group, including space you might want for other volumes.
How do you confirm the expansion succeeded?
Repeat the original observations and compare every relevant layer. Check the actual mount point rather than assuming / is the filesystem you changed. Use the LVM commands only for an LVM layout:
findmnt -T / -o SOURCE,FSTYPE,TARGET
df -hT /
df -i /
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
sudo pvs
sudo vgs
sudo lvs -o lv_path,lv_sizeThe filesystem should now report increased total capacity, and the service using it should work normally. Its available space will not equal the nominal disk increase exactly: filesystem metadata, ext4 reserved blocks and unit rounding affect the numbers. df -i checks inode usage separately; a full filesystem can also involve exhausted inodes.
If df still shows the old total, trace the path again. A larger disk with an unchanged partition needs partition work; a larger LVM physical volume with an unchanged logical volume needs allocation; a larger logical volume with the old filesystem total needs filesystem growth. Read the command output instead of repeating the whole sequence.
Which mistakes should you avoid, and how can you plan ahead?
- Do not use mkfs, wipefs, pvcreate or a partition-table creation command on existing storage to make it larger. These can overwrite the structures that make your data accessible.
- Do not reduce a partition or logical volume to undo a growth operation. Shrinking needs its own filesystem-specific plan. Do not assume an XFS expansion can be reversed; check the operations supported by your installed kernel and tools.
- Do not run e2fsck against a mounted ext4 filesystem. If errors require a repair, plan a maintenance window and use rescue access with the filesystem unmounted.
- Do not apply this simple LVM sequence through LUKS, RAID or a thin pool. Extra layers and allocation rules need their own verified steps before filesystem growth.
- Do not remove a swap or recovery partition merely because it blocks expansion. Consider adding another disk or migrating data under a separate, reviewed plan.
For future changes, monitor both filesystem usage and the free extents in each volume group. Leave headroom for application growth and keep storage-layout records with your recovery documentation. Separating rapidly growing application data can make later capacity changes easier to assess.
Keep a record of the commands and resulting sizes after each change. A successful expansion is also a useful point to check backup coverage: new data will soon occupy the additional space, and your recovery process must still cover the complete service.
How does CH-J Tools help with disk expansion?
Disk Manager in CH-J Tools shows Linux disks with partitions, filesystems, LVM and LUKS layers. After a disk has been enlarged, it can propose automatic expansion.
- Changes are queued for you to review as a plan.
- Before executing the plan, the application reads the server state again and stops if it no longer matches.
- It saves partition-table metadata before a change. That metadata does not replace a backup of your data.
- Windows servers are detected and refused as unsupported.
Frequently asked questions
Do I have to reboot after enlarging a Linux disk?
Not always. The guest must first detect the larger disk and partition. ext4 can usually grow online, and XFS grows while mounted. A reboot may be needed if the guest cannot refresh the device or partition size safely.
Why does growpart report NOCHANGE?
The partition may already fill the available space, another partition may follow it, or the disk may still appear unchanged. Very small increases can also fall below its growth threshold. Compare the disk size, partition layout and dry run before retrying.
Does lvextend -r guarantee the filesystem grew?
It requests filesystem resizing as part of the operation, but that step can fail. Compare lvs with df. If only the logical volume grew, resolve the filesystem error instead of allocating more space again.
Can I expand a disk containing LUKS encryption with these commands?
Not with this sequence alone. First identify where the encrypted mapping sits relative to LVM and the filesystem. Its usable size must also be updated in the correct order using a procedure for that layout.
Is a VM snapshot enough before resizing?
Only if it provides the recovery guarantees you need and you have tested restoration. Snapshots can share the same storage failure domain and may not be application-consistent. Keep an independent data backup and a documented recovery path.