LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 09-10-2011, 12:59 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 2,927

Rep: Reputation: 45
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, 01:09 AM   #2
NoStressHQ
Member
 
Registered: Apr 2010
Location: Lausanne - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware Leet - 32/64bit
Posts: 271

Rep: Reputation: 87
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 01:10 AM.
 
Old 09-10-2011, 01:16 AM   #3
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,314

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
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 01:29 AM.
 
Old 09-10-2011, 02:19 AM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 2,927

Original Poster
Rep: Reputation: 45
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 02:24 AM.
 
Old 09-11-2011, 12:29 PM   #5
rg3
Member
 
Registered: Jul 2007
Distribution: Slackware Linux
Posts: 498

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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 02:34 AM
[SOLVED]xbindkeys giving wrong mapping information narnie Linux - Hardware 1 04-08-2010 12:37 AM
Done with RHCT, but made mistake by giving wrong mail id. Pls help... pappupolyster Linux - Certification 3 09-30-2009 12:18 PM
uname giving wrong info ddu_ Linux - Newbie 2 06-14-2007 09:05 PM
df giving minus numbers!!!!!!!!!!!!! humbletech99 Linux - General 6 05-16-2006 08:50 AM


All times are GMT -5. The time now is 11:07 AM.

Main Menu
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