1

I can determine an unmounted partition of ext4 with tune2fs, but I don't know how to do it with an xfs partition, I wonder if it's that right:

# blockdev --getsize64 /dev/sdb5
465567744
# blockdev  --getbsz /dev/sdb5
4096


# xfs_db -c "freesp -s"  /dev/sdb5 | sed  -n -r  's/(total free blocks )(.*)/\2/p)
35981

So, I calculate the used space in MB so:

# bc -q
35981*4096
147378176
last/1024/1024
140
465567744/1024/1024
444
444-140
304

It results in 304 MB

However if I mount the partition, it shows:

df -h /dev/sdb5
S.ficheros     Tamaño Usados  Disp Uso% Montado en
/dev/sdb5        441M   323M  118M  74% /xfs

There are 19MB of difference, why?

2

Your Answer

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

Browse other questions tagged or ask your own question.