1

I have a 1 TB hdd but when I run df -h my root partition is only 888G big.Parted -l shows the following

3      32.2GB  1000GB  968GB   primary               raid

mdstat shows this

md2 : active raid1 sdb3[1] sda3[0]
  945363832 blocks super 1.2 [2/2] [UU]

But when I run resizefs it reports that the filesystem is full and can't be enlarged as follows.

sudo resize2fs  /dev/md2
resize2fs 1.42.9 (4-Feb-2014)
The filesystem is already 236340958 blocks long.  Nothing to do!

Any ideas how to get around this? I really need the rest of the hdd for backups.

  • What fs you are trying to resize , filesystem type? – Ijaz Ahmad Khan Jan 5 '16 at 12:13
  • The fs is ext4. – Wayne Gemmell Jan 5 '16 at 12:15
  • What's the output of df (without -h)? – Dominik R Jan 5 '16 at 12:19
  • Umount it first , then run the resize command and the reboot the box , and then report the size by df -h – Ijaz Ahmad Khan Jan 5 '16 at 12:22
  • 1K Blocks /dev/md2 930398424 797672312 85441540 91% / 4K Blocks /dev/md2 232599606 199418144 21360319 91% / So, with 4K blocks it more or less adds up to resize2fs output. – Wayne Gemmell Jan 5 '16 at 12:24
2

There's nothing wrong here.

  • Parted shows a size of 968 gigabytes.
  • resize2fs says the filesystem is 236340958 blocks big.
  • One block is 4096 bytes
  • 236340958 * 4096 = 968052563968 So, exactly 968 gigabytes.

The confusing thing: df shows you gibibytes, not gigabytes (https://en.wikipedia.org/wiki/Gibibyte).

  • 968 GB = 901 GiB

The last 13GB can be attributed to filesystem overhead

Edit:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.