LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-24-2007, 05:27 AM   #1
ioanv
LQ Newbie
 
Registered: Mar 2005
Location: Buc, Romania
Distribution: Red Hat 9
Posts: 10

Rep: Reputation: 0
df reports wrong disk space


Hi

When I check the free space on my disk on a linux box running Fedora 6, here is what i get:

Filesystem Size Used Avail Use% Mounted on
/dev/hda3 36G 33G 368M 99% /
/dev/hda1 99M 27M 68M 28% /boot
tmpfs 248M 0 248M 0% /dev/shm


The problem is with hda3 which seems to be missing aprox. 2.6 GB

Here is the df without parameters:

[root@core /]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 36733400 34460772 376560 99% /


Also df -i

Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/hda3 9484160 243686 9240474 3% /
/dev/hda1 26104 48 26056 1% /boot
tmpfs 63357 1 63356 1% /dev/shm

Here is the lsof output grep deleted

[root@core /]# lsof -n | grep deleted
gpm 2163 root 0u CHR 136,0 2 /dev/pts/0 (deleted)
gpm 2163 root 1u CHR 136,0 2 /dev/pts/0 (deleted)
gpm 2163 root 2u CHR 136,0 2 /dev/pts/0 (deleted)
prefdm 2349 root 0u CHR 136,0 2 /dev/pts/0 (deleted)
prefdm 2349 root 1u CHR 136,0 2 /dev/pts/0 (deleted)
prefdm 2349 root 2u CHR 136,0 2 /dev/pts/0 (deleted)
gdm-binar 2414 root 0u CHR 136,0 2 /dev/pts/0 (deleted)
gdm-binar 2449 root 0u CHR 136,0 2 /dev/pts/0 (deleted)
gconfd-2 2683 root 12wW REG 3,3 609 785034 /tmp/gconfd-root/lock/0t1187859141ut913216u0p2683r2088433233k3215284296 (deleted)
ktorrent 2684 root 184u REG 3,3 17 523547 /tran/downloads/torrent/Attack.Force.2006.WS.DVDRip.XviD-iNT/New Text Document (2).txt (deleted)
mc 14318 root cwd DIR 22,65 0 2321985 /hdd2/tran (deleted)
3 14415 root txt REG 3,3 830676 785046 /tmp/upxBKA15LFAOB5 (deleted)


As you can see nothing of that size. So what could be wrong? Were are the 2.6 GB?

P.S. Even stranger here is du -sh
[root@core /]# du -sh
43G .

Best regards
Vlad

Last edited by ioanv; 08-24-2007 at 05:43 AM.
 
Old 08-24-2007, 05:45 AM   #2
exit3219
Member
 
Registered: May 2005
Location: Moldova
Distribution: Kubuntu
Posts: 199

Rep: Reputation: 30
Salut de peste Prut

As far as I know the file-system reserves a percentage of space for its own purposes, e.g. keeping backups of its internal data structures. There is also the lost+found directory which is used to store files during recovery.

I think these can be modified with tune2fs, but I've never tried it myself, so do it at your own risk.
 
Old 08-24-2007, 06:42 AM   #3
Pearlseattle
Member
 
Registered: Aug 2007
Location: Switzerland
Distribution: Gentoo
Posts: 711

Rep: Reputation: 80
Or perhaps you have a lot of files which are smaller than 1KB (or whatever block size you have), but your system is perhaps formatted with 1KB block size (I don't trust df's statement "Filesystem 1K-blocks"), therefore any file smaller than 1KB still allocates a full block. Therefore, if you sum up the blocks you get a 99% usage, even if not the whole blocks are used (therefore your 2.6GB vanish in nirvana).
If what I wrote is correct, the only way for you to get back some of the space is to format the partition using a smaller block size - e.g.512 bytes - but this will have an impact on performance:
- with smaller blocks, reading very small files will be faster, as less bits have to be read.
- with smaller blocks, reading big files will be slower, as less bits can be read at once.

Hope what I wrote is correct...

It should somehow be possible to display the block size used by the partition (perhaps when it is mounted with "mount -v"?) and list and sum up all files which are smaller than 1K. Any clue how?
Sorry, don't have Linux here at work and cannot give you any examples... .
 
Old 08-24-2007, 08:44 AM   #4
ioanv
LQ Newbie
 
Registered: Mar 2005
Location: Buc, Romania
Distribution: Red Hat 9
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by exit3219 View Post
Salut de peste Prut

As far as I know the file-system reserves a percentage of space for its own purposes, e.g. keeping backups of its internal data structures. There is also the lost+found directory which is used to store files during recovery.

I think these can be modified with tune2fs, but I've never tried it myself, so do it at your own risk.
I don't think this is the case. Lost+found is empty and i have never seen a linux box that uses 2 GB for internal backups and on top of that that does not overrides/discard this backup in case you run out of space. For me, when I fill the whole hard drive, it does nothing, I mean it is not like a recycle bin or smth like that (which btw is empty), it just says disk size:36; used: 34; free=0

Last edited by ioanv; 08-24-2007 at 08:47 AM.
 
Old 08-24-2007, 08:46 AM   #5
ioanv
LQ Newbie
 
Registered: Mar 2005
Location: Buc, Romania
Distribution: Red Hat 9
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Pearlseattle View Post
Or perhaps you have a lot of files which are smaller than 1KB (or whatever block size you have), but your system is perhaps formatted with 1KB block size (I don't trust df's statement "Filesystem 1K-blocks"), therefore any file smaller than 1KB still allocates a full block. Therefore, if you sum up the blocks you get a 99% usage, even if not the whole blocks are used (therefore your 2.6GB vanish in nirvana).
.
I thought of that myself but I am positive that there is no such prcess running on my box that could create such files. Also please not that this is a rather new situation, I mean it wasn't like that from the begining (when i've installed the system).
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cedega game install reports wrong disk space fatbastige Linux - Software 2 09-20-2005 08:19 AM
df reports wrong disk usage Mathieu_G Linux - General 4 04-13-2005 02:44 PM
USB external Disk reports wrong size alans Linux - Hardware 1 03-17-2005 08:57 AM
Samba: Windows reports wrong free space avantman42 Linux - Networking 2 11-17-2003 09:48 AM
SCSI-controller reports wrong disk size Gardener Linux - Hardware 2 08-13-2002 08:23 PM


All times are GMT -5. The time now is 03:02 PM.

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