Skip to content

Instantly share code, notes, and snippets.

@jlyon
Last active December 23, 2015 09:19
Show Gist options
  • Save jlyon/6614073 to your computer and use it in GitHub Desktop.
Save jlyon/6614073 to your computer and use it in GitHub Desktop.
Resizing Amazon AWS EC2 instance hard drive
  • SSH into instance, see where HDD is mounted (/dev/sda1?)
  • Stop instance
  • Detach volume
  • Create snapshot
  • Create new volume from snapshot
  • Attach new volume as /dev/sda1 (or similar)
  • SSH into the volume: sudo resize2fs /dev/sda1

Reference: http://stackoverflow.com/questions/9306829/increasing-aws-ec2-ubuntu-instance-disk-space

To mount an additional drive

sudo mkdir -m 000 /vol
echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
sudo mount /vol

Reference: http://stackoverflow.com/questions/11535617/add-ebs-to-ubuntu-ec2-instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment