0

I have 100GB device on AWS but my root partition where I have website running is just 8GB and I need more. How can I resize it to take the rest of the space without losing all files and re-install OS again?

Can I really use e2resize /dev/xvda1 as stated here? Expanding root partition on AWS EC2

Should I go with this manual? https://linuxacademy.com/blog/linux/resizing-root-partition-on-linux-in-amazon-ec2/

Or with this one? https://stackoverflow.com/a/24030938/1464297

Community
  • 1
  • 1
Paul Denisevich
  • 2,329
  • 14
  • 19

3 Answers3

1

I haven't found e2resize to be necessary after resizing the boot device, but that might depend on the OS you're running (I've only done it on Ubuntu 14.04 instances). But it's best to check that after you've mounted the new volume anyway, as described in Amazon's own documentation about this.

The steps shown by the linuxacademy post match the way I've done it in the past with good results, although I use the AWS CLI instead of the console. In case you prefer to use the CLI as well, I wrote an article about which commands to run (scroll down to the non-Cloudformation solution). Regardless of using the console or CLI, the reason for choosing this method over the other one is that you won't make changes to your original EBS so you can always revert to it if anything goes wrong.

1

You probably want to run resize2fs instead of e2resize, but they should do the same job. It will increase the fs to the maximum partition size (100GB in your case)

Most linux distributions in Amazon (or other cloud providers) have a set of services that are run at boot time that take care of this (and other things). Most precisely the cloud-init tools.

cristi
  • 2,019
  • 1
  • 22
  • 31
0

maybe this will help:

The steps were:

Stop the instance

detach volume

modify volume

re-attach volume (specify /dev/sda1)

start the instance

in ssh run

$ df -h

to verify the partition was reconfigured

source:

https://forums.aws.amazon.com/thread.jspa?messageID=212121

Community
  • 1
  • 1
Vijayant Katyal
  • 642
  • 2
  • 12
  • 22