Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

How can i discover what is making difference between df and du output?

Post Reply
Message
Author
User avatar
postcd
Forum Novice
Forum  Novice
Posts: 51
Joined: Mon Oct 29, 2018 2:02 pm

How can i discover what is making difference between df and du output?

#1 Post by postcd » Sun Nov 11, 2018 12:20 pm

Hello,

how can i discover what is making difference between df and du output?

I had MX 17 on 12GB partition, then i resized to 25G, but after some reboots and like 2 days i am hitting the limit on my "/" partition and df output shows it.
I cleaned what i could but still too much disk used:

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           395M  6.4M  389M   2% /run
/dev/sda2        25G   21G  2.6G  89% /
tmpfs           2.0G   55M  1.9G   3% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1        72G   70G  1.4G  99% /media/lynx/sda1
tmpfs           395M  4.0K  395M   1% /run/user/115
tmpfs           395M   12K  395M   1% /run/user/1000
Though "du -h / --max-depth=1 2>/dev/null|sort -h" shows i am using almost half of the space that df -h claims to be used.

Code: Select all

0	/dev
0	/proc
0	/sys
4.0K	/.cache
4.0K	/.config
4.0K	/lib64
4.0K	/mnt
4.0K	/root
4.0K	/srv
16K	/lost+found
1.5M	/run
14M	/bin
15M	/sbin
28M	/etc
89M	/boot
595M	/opt
734M	/lib
1.3G	/var
1.4G	/home
4.6G	/usr
70G	/media
I already rebooted and i am using "4.15.0-1-amd64" kernel, XFCE 4
Someone advised using "fsck -f /dev/sda2" on unmounted partition. I have not tried it yet.
Other user suggested killing processes: lsof | grep "deleted" | awk '{print $2}' | xargs kill -9
That not helped.

Anyone have idea on commands that can quite precisely showi me where is the difference of space and how to remove it/fix it?
OS: 4.15.4-1~mx17+1 (2018-02-23) x86_64 ; XFCE 4 ; MB: G31M ES2L rev. 2.0 ; GPU: AMD Radeon RX 560 ; full HW specs. as of Oct 30/2018

skidoo
Forum Regular
Forum Regular
Posts: 915
Joined: Tue Sep 22, 2015 6:56 pm

Re: How can i discover what is making difference between df and du output?

#2 Post by skidoo » Sun Nov 11, 2018 5:45 pm

https://www.quora.com/What-is-the-diffe ... F-in-Linux
du:

Disk Usage. It walks through directory tree and counts the sum size of all files therein. It may not output exact information due to the possibility of unreadable files, hard links in directory tree, etc. It will show information about the specific directory requested. Think, "How much disk space is being used by these files?"

df :

Disk Free. Looks at disk used blocks directly in file system metadata. Because of this it returns much faster that du but can only show info about the entire disk/partition. Think, "How much free disk space do I have?"
a longer explanation: http://linuxshellaccount.blogspot.com/2 ... alues.html

User avatar
postcd
Forum Novice
Forum  Novice
Posts: 51
Joined: Mon Oct 29, 2018 2:02 pm

Re: How can i discover what is making difference between df and du output?

#3 Post by postcd » Mon Nov 12, 2018 10:46 am

I already googled before i asked and i am not interested to know the diff€rences between both commands. I asked different question.
If i missed the answer in yours linked article, i apologize but can you qoute it here?
OS: 4.15.4-1~mx17+1 (2018-02-23) x86_64 ; XFCE 4 ; MB: G31M ES2L rev. 2.0 ; GPU: AMD Radeon RX 560 ; full HW specs. as of Oct 30/2018

User avatar
oops
Forum Regular
Forum Regular
Posts: 442
Joined: Tue Apr 10, 2018 5:07 pm

Re: How can i discover what is making difference between df and du output?

#4 Post by oops » Mon Nov 12, 2018 11:14 am

skidoo wrote:
Sun Nov 11, 2018 5:45 pm
...
a longer explanation: http://linuxshellaccount.blogspot.com/2 ... alues.html
To summarize the link above:
...
Summation: du is the better tool to use if you are interested in knowing how much space is actually being used on your filesystem "right now." df is great for "ballpark estimates" and is preferred if you need to know how big df thinks your filesystem is (so it will agree with other incorrect system statistics).
... and differences come from a large spectrum of things explained into this link, but not exhaustively ...
$ inxi -Fxxxz : System: Host:XEON ... Distro: MX-17.1_x64 Horizon

User avatar
postcd
Forum Novice
Forum  Novice
Posts: 51
Joined: Mon Oct 29, 2018 2:02 pm

Re: How can i discover what is making difference between df and du output?

#5 Post by postcd » Mon Nov 12, 2018 11:25 am

Thank You, though it do not bother me how much disk space is actually used. I care about df, because it says disk is full and it makes apps complain it can not save data, so that is why i am asking question i am asking (title of this topic).
OS: 4.15.4-1~mx17+1 (2018-02-23) x86_64 ; XFCE 4 ; MB: G31M ES2L rev. 2.0 ; GPU: AMD Radeon RX 560 ; full HW specs. as of Oct 30/2018

User avatar
timkb4cq
Forum Veteran
Forum Veteran
Posts: 4482
Joined: Wed Jul 12, 2006 4:05 pm

Re: How can i discover what is making difference between df and du output?

#6 Post by timkb4cq » Mon Nov 12, 2018 11:33 am

Try using qdirstat. It's in the main repos.
It gives you a visual view of the disk space (they call it treemap) and lets you burrow down to see where the space is being used.
MSI 970A-G43 MB, AMD FX-6300 (six core), 16GB RAM, GeForce 730, Samsung 850 EVO 250GB SSD, Seagate Barracuda XT 3TB

User avatar
oops
Forum Regular
Forum Regular
Posts: 442
Joined: Tue Apr 10, 2018 5:07 pm

Re: How can i discover what is making difference between df and du output?

#7 Post by oops » Mon Nov 12, 2018 11:36 am

postcd wrote:
Mon Nov 12, 2018 11:25 am
Thank You, though it do not bother me how much disk space is actually used. I care about df, because it says disk is full and it makes apps complain it can not save data, so that is why i am asking question i am asking (title of this topic).
... Maybe you can try to use first mx-cleanup ( or bleachbit default options) to try to have more space.
Ps: ncdu or baobab (into mx-cleanup) can also help you.

Edit: oops too late .... @timkb4cq is faster than me.
$ inxi -Fxxxz : System: Host:XEON ... Distro: MX-17.1_x64 Horizon

Post Reply

Return to “Chat”