AWS Knowledge Center Videos: How do I expand an EBS root volume of a Linux instance?

ArticlesBlog

Written by:


hi my name is Alessandro and I am a cloud support engineer here at the AWS Dublin office sometimes customers ask me how to dynamically expanding this volume of their Linux instances because they have run out of space with the EBS elastic volume feature this is dynamically possible in a few clicks let’s get started once you have logged in into AWS console you can move to the ec2 console then click on running instances or instances in the left menu and if you will never use Stone Linux instance what you get is a root volume that you can check in the description tab and clicking on block device here you will see the EBS volume ID then if you right click on it we can open in a different tab and you see a volume which is 8 gigabyte in size GP to type I’m now connected to the Linux instance and you can see the same detail listing the block devices with the common LS VLK you see we have an 8 gigabyte volume if you use the same common with the – LS parameter we can see the file system type in this case it’s an XT 4 because we are running on the Amazon Linux ami I am back in the AWS console and I have selected the volume the root volume of my Linux instance so I’m going to copy from the console the volume ID of my instance I am now logged into another Linux instance where I have my AWS CLI configured in order to modify my Linux root volume I just issued the common AWS ec2 modify – volume test – volume ID and then paste the volume ID that I previously copied in the console and then specify the parameter – – side and the noose desire side press ENTER and you get the new this the source and target volume characteristics if you want to see the progress of this modification you can just issue the common AWS easy to describe – volumes modifications – – volume ID and then again the volume ID previously copied enter if you want to see the modification progress of your volume it will take a while after you issue the initial comment if we then switch back to the AWS console in the volume tab and we refresh the status of the volume we will see the progression state it could take few minutes in order you will be able to see advancing but for the operating system the new free space is immediately available so in order to get this done we go back to the instance tab select the Linux instance and simply reboot it confirming the reboot it will take few minutes to the instance to come up again and the cloud in it will automatically expand the filesystem to the maximum size available independently from the file system type that are you using it could be XT 2 XC 3 XT 4 or x SS which are the file system we support with different Linux versions we are now logged back into the Linux instance after the reboot and if now we try to list the block device you will be able to see that the new site is in place and the filesystem is occupying all the new free space switching back to AWS console on the volume tab if we go to the state we can see that the state is now completed and the volume in use because attached to our instance thanks for watching the video and happy cloud computing from all of us here at AWS

5 Replies to “AWS Knowledge Center Videos: How do I expand an EBS root volume of a Linux instance?”

  1. Arend - says:

    hi Alessandro, if you type it like you did you get the "errror" specify region.

    See my communication on the CLI:

    https://aws.amazon.com/amazon-linux-ami/2017.09-release-notes/
    [[email protected] ~]$ sudo su
    [[email protected] ec2-user]# aws ec2 modify-volume –volume-id vol-07914b623b1b1294f –size 24
    You must specify a region. You can also configure your region by running "aws configure".
    [[email protected] ec2-user]#
    [[email protected] ec2-user]# aws ec2 modify-volume –region eu-central-1b –volume-id vol-07914b623b1b1294f –size 24
    Unable to locate credentials. You can configure credentials by running "aws configure".
    [[email protected] ec2-user]#
    [[email protected] ec2-user]#
    [[email protected] ec2-user]# aws configure
    AWS Access Key ID [None]: AKIAJXGAT6OJ4UREIPCQ
    AWS Secret Access Key [None]: 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
    Default region name [None]: eu-central-1b
    Default output format [None]:
    [[email protected] ec2-user]#
    [[email protected] ec2-user]# aws ec2 modify-volume –region eu-central-1b –volume-id vol-07914b623b1b1294f –size 24

    Could not connect to the endpoint URL: "https://ec2.eu-central-1b.amazonaws.com/"
    [[email protected] ec2-user]#

  2. Arun Nair says:

    Hello ,

    Have the data been safe while expanding the root volume?

    How to reduce the root volume without losing our data? we have tried many tutorials for reducing the volume bt no luck.

    Is it possible to do a video on same?

    Thank you in anticipation for a favourable reply.

  3. jeevanvideos says:

    Is there anyway we can expand EBS volume without rebooting the EC2 instance?

  4. Sanjaya Poudel says:

    when i fire lsblk i see this
    xvda 202:0 0 30G 0 disk
    └─xvda1 202:1 0 8G 0 part / which means when i fire df-h i dont see the change in the partition change ? what didi i miss ?

  5. MrBorderdown says:

    You skipped a MAJOR part. Installing and configuring awscli is a pain in the ass.

Leave a Reply

Your email address will not be published. Required fields are marked *