3

I've used resize2fs /dev/sda3 300G to shrink an ext4-partition to 300GB. Then I used parted resizepart 3 310G to shrink the partition size in the partition table to 310GB, slightly bigger than it's new actual size. Now I want to expand the physical filesystem to fill the whole partition size (300GB), but resize2fs gives me an error:

# resize2fs /dev/sda3
resize2fs 1.43.4 (31-Jan-2017)
Resizing the filesystem on /dev/sda3 to 75673865 (4k) blocks.
resize2fs: Can't read a block bitmap while trying to resize /dev/sda3
Please run 'e2fsck -fy /dev/sda3' to fix the filesystem after the aborted resize operation.

But e2fsck just reports that the size of /dev/sda3 in the partition table doesn't match it's actual size, and aborts. When I leave out the -y-flag, I can force it to not abort, but after that I get an error for each block that is outside the actual filesystem:

Error reading block x (Invalid argument) while getting next inode from scan. Ignore error?

with x ranging from 75673865 (the first block outside the physical partition) to 78643200 (the last block in the filesystem size according to the superblock).

I don't think I have to manually ignore all of these errors, do I? How can I get resize2fs to expand the partition?

LukeLR
  • 1,483
  • 1
  • 14
  • 28

0 Answers0