Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to resize2fs EB volume fails [closed]

I have a 200GB EBS volume and am trying to increase the space available. I followed the instructions on: http://www.hellersoftware.com/2012/resize-ebs-volume-attached-to-amazon-web-services-ec2-instance/ and managed to create a snapshot and create a new EBS based on that snapshot.

Everything is peachy, except when I do:

# resize2fs /dev/sdf

I get

resize2fs 1.40.8 (13-Mar-2008) resize2fs: Bad magic number in super-block while trying to open /dev/sdf Couldn't find valid filesystem superblock. 

Not sure what's going on there, but my new volume still only shows 200GB, when in fact it's an 800GB volume.

like image 494
Shamoon Avatar asked Nov 13 '12 14:11

Shamoon


People also ask

How long does it take to resize EBS volume?

An EBS volume of size 1 TiB can typically take up to 6 hours to be modified. However, the same volume might take 24 hours or longer in other situations. The time it takes for volumes to be modified doesn't always scale linearly.

Can you downsize an EBS volume?

The answer is NO. It is impossible to decrease EBS volume size. When you have 100GB EBS and you decide to modify it into 30GB you will get error : The size of a volume can only be increased, not decreased .


1 Answers

The OP stated that he was using the XFS filesystem. The tool resize2fs works with ext2, ext3 and ext4 only.

There's a similar tool available for the XFS filesytem called xfs_growfs. You'll most likely have to install it first

sudo yum install xfsprogs.x86_64 --assumeyes 

then mount your filesystem

sudo mount -t xfs /dev/sdf /vol 

now you can extend the filesystem

sudo xfs_growfs /vol 

df -h should now show more available space

I hope this helped :)

Tip: ext4 filesystem is the recommended filesystem for EBS volumes ( for the future )

like image 81
Michel Feldheim Avatar answered Oct 02 '22 15:10

Michel Feldheim