How to Resize the Root Partition in Linux on Amazon EC2

Check the Root Partition size before resize:

df -h

1The current root partition size is ~8 GB.

After that, stop your instance:

sudo poweroff

2

Go to Volumes on the left-hand EC2 navigation control panel.Right-click on the volume you want to resize and select Create Snapshot.

3Note: Make sure you also check the availability zone.

Fill out the details of the snapshot you are creating.

4

Go to Snapshots on the left-hand EC2 navigation control panel.Right-click on the snapshot you created and select Create Volume from Snapshot.

5

Enter the new size of the partition that you would like to be, select the same availability zone in which your instance is running and click Yes,Create.

6

Go back to the Volumes in the EC2 control panel. Select the old root volume, right click on it and select Detach Volume.

7

Now right click on the new volume that we have just created and select Attach Volume.

8

Please make sure that the volume should be attached as /dev/sda1:

9

Now turn on your instance. Make a note of your partition name, in my case it is /dev/xvda1. Type the resize2fs /dev/xvda1 command.

sudo resize2fs /dev/xvda1

10

After that view the new root partition size.

df -h

11

Yes, it’s work 🙂

Hope this will help you!

Please Remember me in your prayers!

Advertisements

3 responses to “How to Resize the Root Partition in Linux on Amazon EC2

  1. Pingback: [ASK] server - Cannot extend partition in CentOS 6. Second partition is preventing it | Some Piece of Information

  2. Pingback: Cannot extend partition in CentOS 6. Second partition is preventing it – Internet and Tecnnology Answers for Geeks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: