sudo e2fsck -f /dev/sdX1
sudo resize2fs /dev/sdX1 50G
sudo dumpe2fs -h /dev/sdX1 | grep -E 'Block (size|count)'
With fdisk
, print the partition table first with p
, then delete the old partition with d
and create a new one with the same partition number at the same start sector and +50G
for the end sector. Finally, verify the output with p
and write to disk with w
.
Note that the fdisk
p
output shows you the unit and sector size (generally units are sectors of 1). You should verify that the final p
output’s Sectors column matches block size * block count / sector size in bytes
.