• Easily increase the size of your Ubuntu EBS boot volume with only console

    So you have run out of space on your EBS boot volume on Amazon’s EC2 and you do not know what to do? I will walk you through the steps you need to follow in order to easily increase the size of the default Ubuntu EBS boot drives (/dev/sda1) using just the Amazon webservices console. There is no need to use the ec2 command line tools, and you will only need to run one little command on the remote server when complete.

    If you haven’t picked a distribution of Ubuntu to use yet, you can see a list of all the officially supported ones at https://cloud.ubuntu.com/ami/. Assuming you have chosen an instance type and you have customized your server we move on to the next step.

    Login to the Amazon webservices console, and navigate to the instance you want to increase the size of the system drive. Get the EBS ID of your sda1 drive.

    Now switch to the EBS volumes on the left menu and find the EBS ID of the drive you want to change. Select that drive, and at the top of the page select “Create Snapshot”. Take note of the Snapshot ID.

    Select “Create Volume”, and specify the NEW Size, Zone and use the Snapshot which you just created.

    Once the new volume is created, you STOP (not TERMINATE!) the instance with the drive you want to replace. You then DETACH the existing EBS device and attach the new one. Now start up your instance again (you are almost complete).

    Once the instance has rebooted, you need to login and run one of the following commands via SSH depending on your filesystem. In some newer systems Ubuntu will automatically take care of this step, but not always. You can check by running the df -h command. If you are using the full capacity of the new EBS drive you can skip this step.

    # ext3 root file system (most common)
    sudo resize2fs /dev/sda1
    sudo resize2fs /dev/xvda1
    # XFS root file system (less common):
    sudo apt-get update && sudo apt-get install -y xfsprogs
    sudo xfs_growfs /


    Leave a reply