LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-10-2011, 01:59 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,265

Rep: Reputation: 49
Is df giving wrong numbers?


Kernel 2.6.21.5, slackware 12.0
du belongs to coreutils.
coreutils 6.9

Hi:
How can this be?
Code:
semoi@darkstar:~/bin$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3              18G   14G  3.3G  81% /
/dev/hda1              20G  9.2G   11G  47% /xp
/dev/hdc              1.6G  1.6G     0 100% /mnt
semoi@darkstar:~/bin$
I don't understand the Use = 81% datum. 14 / 18 = -0.77 < 0.81. If you think its a rounding error,
Code:
semoi@darkstar:~/bin$ df   
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3             18097492  13804204   3373972  81% /
/dev/hda1             20472816   9608416  10864400  47% /xp
/dev/hdc               1670664   1670664         0 100% /mnt
semoi@darkstar:~/bin$
13804204 / 18097492 = ~0.76, still well below 0.81 whereas
9608416 / 20472816 = ~0.47, the right figure. I guess du is right, but what is the cause of the discrepancy?
 
Old 09-10-2011, 02:09 AM   #2
NoStressHQ
Member
 
Registered: Apr 2010
Location: Lausanne - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware Leet - 32/64bit
Posts: 317

Rep: Reputation: 109Reputation: 109
The % is about the effective used space...
Try (18-3.3) / 18
Or (18097492 - 3373972) / 18097492

and you get the right "used percentage"...

Edit: On the disk, the files spend "round blocks" so many tiny files lose some space...

Last edited by NoStressHQ; 09-10-2011 at 02:10 AM.
 
Old 09-10-2011, 02:16 AM   #3
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,495

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
ext* filesystems reserve 5% of the space by default: this is done to let daemons run to allow you, for example, a n ssh login into the host also with a 100% full filesystem.

Last edited by ponce; 09-10-2011 at 02:29 AM.
 
Old 09-10-2011, 03:19 AM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,265

Original Poster
Rep: Reputation: 49
I see. Size - (Used + Avail) = 919316. And 919316 / Size = 0.051, and sure enough, if I do it in bytes, I get 0.050! Fine arithmetics, thanks.

Last edited by stf92; 09-10-2011 at 03:24 AM.
 
Old 09-11-2011, 01:29 PM   #5
rg3
Member
 
Registered: Jul 2007
Distribution: Slackware Linux
Posts: 514

Rep: Reputation: Disabled
More specifically, the space is not reserved for any daemon but for the superuser. See the -m option explanation in "man mke2fs".
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nginx giving a 403 error. I don't know what's wrong. arco123 Linux - Server 2 02-08-2011 03:34 AM
[SOLVED]xbindkeys giving wrong mapping information narnie Linux - Hardware 1 04-08-2010 01:37 AM
Done with RHCT, but made mistake by giving wrong mail id. Pls help... pappupolyster Linux - Certification 3 09-30-2009 01:18 PM
uname giving wrong info ddu_ Linux - Newbie 2 06-14-2007 10:05 PM
df giving minus numbers!!!!!!!!!!!!! humbletech99 Linux - General 6 05-16-2006 09:50 AM


All times are GMT -5. The time now is 01:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration