GParted is the graphical partition editor for Linux. It can create, delete, resize, move and format partitions on most filesystems. On a desktop or from a live USB it’s the easiest tool for the job. On a headless server you’ll use command-line tools that do the same things — both are covered below.
Back up first. Resizing and moving partitions rewrites disk structures. A power cut or mistake can destroy data. Always have a current backup before you start.
Key concepts
- Partition table: GPT (modern, recommended) or MBR (legacy). See GPT explained.
- Partition: a section of the disk.
- Filesystem: the format inside a partition (ext4, XFS, NTFS, FAT32…).
- Unallocated space: disk space not in any partition.
Resizing a partition means changing both the partition and the filesystem inside it. GParted does both in one step.
Using GParted
Install it (apt install gparted) or boot the GParted Live ISO — required when you need to change the partition your system is running from.
Shrink a partition
- Select the partition, choose Partition → Resize/Move.
- Drag the right edge left, or enter a smaller size.
- Click Resize/Move, then Apply (the green tick). Nothing changes until you apply.
ext4 and NTFS can be shrunk. XFS cannot be shrunk.
Grow a partition
- There must be unallocated space directly after the partition. Move other partitions if necessary.
- Resize/Move, drag the right edge to the end, Apply.
Create a new partition
- Select unallocated space, Partition → New.
- Choose size, file system (ext4 for Linux data) and a label.
- Apply, then add it to
/etc/fstabusing its UUID (blkid).
When a partition can be changed while mounted
| Operation | ext4 | XFS | NTFS |
|---|---|---|---|
| Grow while mounted | Yes | Yes | No (unmount) |
| Shrink | Unmounted only | Not possible | Unmounted only |
That’s why growing a server’s root disk is easy online, but shrinking needs a live/rescue environment.
On a server: command-line equivalents
Grow the root partition after a disk upgrade
When your VPS disk gets bigger (for example after a plan upgrade), the extra space is unallocated at the end. Grow the partition and filesystem without a reboot:
lsblk # e.g. vda 120G, vda1 60G
apt install -y cloud-guest-utils # provides growpart
growpart /dev/vda 1 # grow partition 1 to fill the disk
resize2fs /dev/vda1 # ext4
# xfs_growfs / # XFS instead
df -h /
If the root filesystem is on LVM, grow the partition, then pvresize, lvextend -r -l +100%FREE /dev/vg/root.
Create and format a partition on a new disk
parted /dev/vdb --script mklabel gpt mkpart data ext4 0% 100%
mkfs.ext4 -L data /dev/vdb1
mkdir -p /data
echo "UUID=$(blkid -s UUID -o value /dev/vdb1) /data ext4 defaults,noatime 0 2" >> /etc/fstab
mount -a
Shrink or move partitions on a server
These require the filesystem to be unmounted. On a VPS, boot into the provider’s rescue mode or mount the GParted ISO through the control panel (if available), then use GParted or resize2fs + parted resizepart. If this isn’t available, the safest approach is: back up, reinstall with the layout you want, restore.
Common problems
- “Unable to satisfy all constraints on the partition” — not enough contiguous free space, or alignment. Leave a little extra room.
- Swap partition in the way — turn it off (
swapoff -a, or right-click → Swapoff in GParted), move or delete it, then recreate it. Or replace it with a swap file — see swap file vs swap partition. - System doesn’t boot after changes — the bootloader or
/etc/fstabrefers to old partition identifiers. Use UUIDs in fstab and reinstall GRUB from a rescue system if needed.
Summary
GParted makes partitioning visual and safe as long as you back up and apply changes deliberately. On servers, growpart and resize2fs/xfs_growfs handle the most common task — using new disk space — without downtime. For Windows systems, see Windows disk partition management.