Sometimes you just need more than the 8 GB EBS volume that Amazon provides with Amazon Linux. Sure you can just create another volume and attach it somewhere, but sometime it’s just easier to have one big drive.
The following instructions are used to create a 64 bit Amazon Linux AMI with a boot drive up to 1 TB in size.
Servers can then be rapidly deployed from your new custom AMI.
Create Base SystemStarting from
Launch a new instance.
If you’d like, login and update system
SSH to new Instance with key, login as ec2-user
shutdown -h now
Build AMIIn EC2 console create a snapshot of the root EBS volume.
Create an ESB volume from that snapshot with the new desired size. (Please ensure it is in the same Availability Zone as the instance)
Detach the root 8 GB EBS volume and attach the newly created EBS volume to /dev/sda1 on the instance.
Start the instance and then login.
Resize the disk to get the rest of the expanded disk
sudo resize2fs /dev/sda1
From the EC2 console, click on the Instance and Create AMI from the running Instance.
There you have it!