AWS Recipe: Increase EC2 Volume Size

AWS Recipe: Increase EC2 Volume Size

tech recipes from a girl geek…

Outgrown your current volume size on your Amazon Web Service EC2 instance? Here’s the recipe to get the volume size you need:

login to your AWS console
▪ navigate to Instances > Instances
▪ select your EC2 instance
▪ in the Description area, click on the SDA1 link
▪ make note of the volume number
▪ navigate to Elastic Block Store > Volumes
▪ right click on the volume with the Volume ID that matches your instance
▪ select Create Snapshot
▪ it may take some time to create the snapshot…be patient 
▪ navigate to Instances > Instances
▪ select your instance and right click on it and select Stop
▪ when both the instance is shut down, and the snapshot is complete, go on to the next step
▪ navigate to Elastic Block Store > Snapshots
▪ select the Snapshot you just created
▪ right click on the Snapshot and select Create Volume from Snapshot
▪ in the pop-up window, select the size for your new volume in GB or TB
select the SAME availability zone as your Instance (ie us-east-1a)
select the Snapshot you just created (most likely is already selected)
▪ click Yes, Create
▪ navigate to Elastic Block Store > Volumes
▪ right click on the current volume your instance is attached to and select Detach
▪ when the new Volume Creation is complete, right click on the new Volume and select Attach Volume
select the Instance you are attaching it to (should be shut down)
▪ change the value in Device from whatever it currently is to /dev/sda1
▪ click, Yes, Attach
▪ navigate to Instances > Instances
▪ right click on your instance and select Start
▪ navigate to Network & Security > Elastic IPs
▪ select the IP that was previously attached to this instance
▪ right click and select Associate
▪ select your instance
▪ now, login to your instance via SSH
▪ from the command line, enter df -h
▪ note, your disk space will be the SAME as it was before. It needs to be expanded.
▪ from the command line, enter sudo resize2fs /dev/sda1
▪ this process may take a bit of time. once again, be patient…
▪ when it’s complete, enter df -h again. It will now be the expanded volume size.
▪ when you are satisfied that the new volume and instance work correctly:
   ▪ you can delete the previous volume:
      ⁃ navigate to Elastic Block Store > Volumes
      ⁃ right click on your previous volume and select Delete Volume
   ▪ and you can delete the Snapshot you created
      ⁃ navigate to Elastic Block Store > Snapshots
      ⁃ right click on the Snapshot and select Delete Snapshot

For the next course…Plesk

If you are using the Plesk control panel on your instance, you will need to update your internal IP

▪ login to Plesk
▪ navigate to Server Management > Tools & Settings
▪ under Tools and Resources, select IP Addresses
▪ click the Reread IP button and your new AWS internal IP will be displayed
▪ (your public IP should already be there from before)
▪ navigate to Hosting Services > Subscriptions
▪ for each Subscription
   – click the link ⁃ select Change Hosting Settings
   ⁃ select the new Internal IP from the drop-down menu
   ⁃ click OK
▪ navigate to Server Management > Tools & Settings
▪ under Tools and Resources, select IP Addresses
▪ delete the previous internal IP that you will no longer be using
• select the new internal IP address and choose the default domain for the IP  
• navigate to Server Management > Tools & Settings
• under Server Management, select Restart Server

After the server restarts, the process should be complete!

dessertDessert

• go enjoy a nice cup of coffee, or go for a short walk – or better yet, a bike ride! you deserve it!

Leave a Reply