BTRFS : Huge difference between df and du

Kernels & Hardware, configuring network, installing services

BTRFS : Huge difference between df and du

Postby TwiX » 2018-06-08 07:15

Hello,

My root partition uses btrfs (btrfs tools 3.17) on my debian 8 server.

When I check free space available with df, it says 39 G used

Code: Select all
root@dc-doli-sf:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        48G   39G  7.4G  85% /
udev             10M     0   10M   0% /dev
tmpfs           794M   17M  777M   3% /run
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1       472M   33M  415M   8% /boot


With du, less than 10 G used !

Code: Select all
root@dc-doli-sf:/# du -shx
9.8G    .


Code: Select all
root@dc-doli-sf:/# btrfs fi show
Label: 'root'  uuid: 2d0f1565-0d03-4e3c-b0f6-bb6a42636b72
        Total devices 1 FS bytes used 38.66GiB
        devid    1 size 47.80GiB used 43.04GiB path /dev/sda3

Btrfs v3.17


Code: Select all
root@dc-doli-sf:/# btrfs filesystem df /
Data, single: total=41.01GiB, used=38.42GiB
System, DUP: total=8.00MiB, used=16.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, DUP: total=1.00GiB, used=246.77MiB
Metadata, single: total=8.00MiB, used=0.00B
GlobalReserve, single: total=96.00MiB, used=0.00B


I don't know what it is. Do you know how to get rid of that and how reclaim free space ?

Thanks in advanced !

TwiX
TwiX
 
Posts: 1
Joined: 2018-06-08 07:02

Re: BTRFS : Huge difference between df and du

Postby pylkko » 2018-06-09 18:39

Please read the FAQ which explains clearly why "df" does not produce accurate information about disk use on COW filesystems. Then if you do not understand something, come back and ask a question about that specific thing.
User avatar
pylkko
 
Posts: 1314
Joined: 2014-11-06 19:02


Return to System configuration

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable