Friday, August 26, 2011

How to force EC2 root partition to fill EBS volume completely

At some point I noticed that my new great m1.large EBS backed EC2 instance is not completely utilizing root volume (8GB), it was just 2GB only. I can guess the reason of this problem and it's a long story. In two words -- this instance were created from EBS AMI which is done by converting S3 backed AMI. Anyway here it is: 8GB volume and only 2GB root.

Luckily there is a very simple solution. If your root filesystem is Ext3 or Ext4 (assuming /dev/sda1 device):
resize2fs /dev/sda1
If you use XFS then run following command (didn't try it myself but it have to work):
xfs_growfs /
The same commands are required if you decide to increase your root partition at some point.

0 comments: