Expanding a Root Partition

This procedure describes how to expand a root partition using the Offline Resize method. You must unmount the filesystem and reboot the VM during this procedure.

If you want to resize a data partition or an LVM volume, see Expanding a Linux Data Partition or Expanding an LVM Data or Root Volume.

  1. If necessary, use your hypervisor tools to expand the root disk so that there is sufficient room to resize it to the desired size. You might also have to push the "swap" partition forward, if it is immediately after the root partition.
  2. Extend the root partition using the fdisk or partx command.

    Warning: This is very critical operation. Make sure you do not change the starting offset of the partition while you are manipulating the partition table.

    # fdisk /dev/sda

  3. Reboot the VM to force the system to read the new partition table.