4

I've followed instructions here exactly: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html for "Example: Extending the file system of NVMe EBS volumes" trying to grow a disk from 10 GB to 20 GB.

When I get to step 6, sudo xfs_growfs -d /, I get xfs_growfs: / is not a mounted XFS filesystem

Tried rebooting instance but that didn't help.

lsblk yields:

NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme0n1      259:0    0   20G  0 disk
├─nvme0n1p1  259:1    0 19.9G  0 part /
├─nvme0n1p14 259:2    0    3M  0 part
└─nvme0n1p15 259:3    0  124M  0 part /boot/efi

df -h outputs:

Filesystem       Size  Used Avail Use% Mounted on
udev             224M     0  224M   0% /dev
tmpfs             47M  2.2M   45M   5% /run
/dev/nvme0n1p1    20G  9.1G  9.6G  49% /
tmpfs            233M     0  233M   0% /dev/shm
tmpfs            5.0M     0  5.0M   0% /run/lock
tmpfs            233M     0  233M   0% /sys/fs/cgroup
/dev/nvme0n1p15  124M  262K  124M   1% /boot/efi
tmpfs             47M     0   47M   0% /run/user/1000

Notice the available space on the /dev/nvme0n1p1 device says 49% but according to the Used/Avail columns it should be more like 99%.

StevieD
  • 514
  • 8
  • 24
  • Looks fine to me, nvme0n1p1 is listed as 20G with 9.1G used and 9.6G available. What's the problem exactly? For standard Linux instances a reboot tends to trigger the file system to expand to take up all the space in the EBS volume, I did it yesterday with an EC2 Amazon Linux 1 instance. – Tim Sep 30 '20 at 07:49
  • 1
    It's not an XFS filesystem. – Michael Hampton Sep 30 '20 at 12:36

3 Answers3

5

Got this error when using it on a file system that wasn't XFS.

Had to use this instead (for ext4 volumes).

sudo resize2fs /dev/xvda1
M3RS
  • 171
  • 5
2

As @MichaelHampton commented, it may not be an XFS system.

The AWS guide you mentioned should really indicate either

  1. the difference between XFS (step 7) and ext4 (step 8) more clearly and that those two steps are mutually exclusive
  2. that "a reboot tends to trigger the file system to expand to take up all the space in the EBS volume" as @Tim said
arturomp
  • 121
  • 3
0

Well, I rebooted again and then created a 1 GB file with fallocate -l 1G test.img to see if it worked and it did. df -h output now looks good:

Filesystem       Size  Used Avail Use% Mounted on
udev             224M     0  224M   0% /dev
tmpfs             47M  1.6M   45M   4% /run
/dev/nvme0n1p1    20G   11G  8.6G  55% /
tmpfs            233M     0  233M   0% /dev/shm
tmpfs            5.0M     0  5.0M   0% /run/lock
tmpfs            233M     0  233M   0% /sys/fs/cgroup
/dev/nvme0n1p15  124M  262K  124M   1% /boot/efi
tmpfs             47M     0   47M   0% /run/user/1000
StevieD
  • 514
  • 8
  • 24