Trying to resize2fs EB volume fails [closed]
Asked Answered
C

1

33

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.

Coffin answered 13/11, 2012 at 14:52 Comment(6)
what's the output of mount, df -h and fdisk -l /dev/sdf? Are you able to mount the volume?Donyadoodad
I can mount it and df -h says: /dev/sdf 200G 187G 14G 94% /vol ` fdisk -l /dev/sdf Disk /dev/sdf: 858.9 GB, 858993459200 bytes 255 heads, 63 sectors/track, 104433 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000000 Disk /dev/sdf doesn't contain a valid partition table`Coffin
Are you using the ext filesystem?Donyadoodad
not sure - how would i find out?Coffin
either grep "/dev/sdf" < /etc/fstab or mount the volume and type mount | grep "/dev/sdf"Donyadoodad
/dev/sdf on /vol type xfs (rw)Coffin
D
84

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 )

Donyadoodad answered 13/11, 2012 at 23:3 Comment(3)
xfs_growfs worked for me on centos 7Pricefixing
fsadm resize worked for meArcherfish
for some reason i needed to do sudo growpart /dev/xvda 1 before sudo xfs_growfs /vol.Killy

© 2022 - 2024 — McMap. All rights reserved.