growpart - extend a partition in a partition table to fill available space
growpart [options] DISK PARTITION-NUMBER
Options you will use
-N, --dry-run- only report what would be done
-u, --update auto|force|off- tell the kernel about the new size (auto: when the partition is in use)
-v, --verbose- more output
-N, --dry-run- only report what would change
-u, --update auto|force|off|on- how to tell the kernel about the new partition size (default auto: online if possible)
--fudge BYTES- do nothing if the partition would grow by less than this (default 1 MiB)
Examples
$ sudo growpart /dev/nvme0n1 1grow partition 1 to the end of the disk
$ sudo resize2fs /dev/nvme0n1p1then grow the ext4 file system on it
Gotchas
- From cloud-guest-utils. Mind the space:
growpart /dev/nvme0n1 1(disk, then number), not /dev/nvme0n1p1. - After
aws ec2 modify-volume --size, the disk is bigger but the partition and file system are not: growpart the partition, then resize2fs (ext4) or xfs_growfs (XFS) the file system.lsblkshows each layer. - "NOCHANGE: partition 1 is size N. it cannot be grown" = the volume has not grown yet (modification still optimizing is fine; check describe-volumes-modifications).
Try growpart in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.