0

I created an AWS EC2 Linux instance with 8GB root volume. Then I increased the EBS volume to 9GB and it went to the completed state. It's a small volume, so the resize took a couple of minutes to complete.

Now I try to extend extend the linux file system after resizing the volume using the instructions mentioned here. But, I get the below error message. I tried two times, the entire process. But it's all the same.

The filesystem is already 2096635 (4k) blocks long.  Nothing to do!

Here is the screen shot of the image.

enter image description here

Can someone help me?

Praveen Sripati
  • 32,799
  • 16
  • 80
  • 117

2 Answers2

3

Just reboot the instance because it automatically resizes your root filesystem on boot.

I tried it myself. Here is the instance with an 8GB volume:

[ec2-user@ip-172-31-15-216 ~]$ lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0   8G  0 disk 
└─xvda1 202:1    0   8G  0 part /

[ec2-user@ip-172-31-15-216 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        236M   56K  236M   1% /dev
tmpfs           246M     0  246M   0% /dev/shm
/dev/xvda1      7.8G  985M  6.7G  13% /

After modifying the EBS Volume:

[ec2-user@ip-172-31-15-216 ~]$ lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0   9G  0 disk 
└─xvda1 202:1    0   8G  0 part /

[ec2-user@ip-172-31-15-216 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        236M   56K  236M   1% /dev
tmpfs           246M     0  246M   0% /dev/shm
/dev/xvda1      7.8G  985M  6.7G  13% /

After the reboot:

[ec2-user@ip-172-31-15-216 ~]$ lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0   9G  0 disk 
└─xvda1 202:1    0   9G  0 part /

[ec2-user@ip-172-31-15-216 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        236M   56K  236M   1% /dev
tmpfs           246M     0  246M   0% /dev/shm
/dev/xvda1      8.8G  984M  7.7G  12% /

See also: increase EC2 EBS volume after cloning - resize2fs not working

Community
  • 1
  • 1
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
1
# http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage_expand_partition.html
# Before goging to do this, detach and attach the root volume to anothe instance
# Note:
#   1) Before detach the volume, please make a note of device name which going to
#      detch from the machine, why because we should mention same name when attaching back, otherwise data will be lost
#   2)

# Identifying device name which we want to expand
lsblk

# Running parted command on the device
sudo parted /dev/xvdf

# Changing the parted units of measure to sectors.
unit s

# Run the print command to list the partitions on the device
print
# if it shows warning, chose fix

# Delete the partition entry for the partition using the number (1) from the previous step
rm 1 # number 1 will change based the partition we want to delete

# Create a new partition that extends to the end of the volume
mkpart Linux 4096s 100%

# Run the print command again to verify your partition
print

# Check to see that any flags that were present earlier are still
# present for the partition that you expanded. In some cases the boot
# flag may be lost. If a flag was dropped from the partition when it was expanded,
# add the flag with the following command, substituting your partition number and the flag name.
# For example, the following command adds the boot flag to partition 1
set 1 boot on

#Run the quit command to exit parted.
quit

# verfiying the device
sudo e2fsck -f /dev/xvdf1
  • before proceeding the above steps. you show detach from source machine and attach to another machine. after done the above steps reattach same volume with source machine – Kanagaraj Dhanapal Mar 11 '17 at 09:18