Btrfs – missing space, what is taking it up

btrfs

I have a Netgear NAS device which uses btrfs filesystem.

du reports all the files on md device taking up 1.37 TB.

btrfs fi df says, that it's taking up 1.53 TB.

I cannot figure out where does 0.16 TB go. On Netgear forums metadata has been mentioned, however btrfs fi df outputs metadata as a separate line, and only taking up 2GB.

How can I figure this out?

Best Answer

This situation can be caused by file fragmentation. You can try to solve it by going to the terminal and then type:
sudo umount /dev/sdxy
and then
sudo btrfs filesystem defrag /dev/sdxy
In these commands sdxy is the correct designation of the partition with the problem. For example it might be something like this: 'sda5'. Make sure you check the correct designation before you try anything.

Related Question