Enlarge AWS EC2 root partition

From Nearline Storage
Jump to: navigation, search

When I provisioned a CentOS VM in AWS EC2 it has an 8GB root partition, even when I set the disk size to 100GB. This recipe will extend that partition to fill the disk:

# fdisk /dev/xvda <<END
u
d
n
p
1
2048

w
END
# reboot
# (after reboot)
# resize2fs /dev/xvda1
# df -h / # should now be entire EBS volume