LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 10-30-2004, 11:23 PM   #1
sandrobr
LQ Newbie
 
Registered: Oct 2004
Location: Brazil
Distribution: Red hat, Fedora
Posts: 3

Rep: Reputation: 0
Question The command "df -h" no show me the size of partition true!


Hi,

I be the following problem: When I execute the command "df -h" the system show me the size from partition /home (size full=1Gb) with 64MB idle, and 936MB Avail. But, when I execute "du -h -s" the system show me only 240MB in use in /home.

I use Red Hat AS 2.1!

Can somebody help me?
 
Old 10-31-2004, 01:29 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Re: The command "df -h" no show me the size of partition true!

Quote:
Originally posted by sandrobr
When I execute the command "df -h" the system show me the size from partition /home (size full=1Gb) with 64MB idle, and 936MB Avail. But, when I execute "du -h -s" the system show me only 240MB in use in /home.
With no arguments, "df" reports the space used and available on all currently
mounted filesystems (of all types). Otherwise, "df" reports on the filesystem
containing each argument file.

The command "du" reports the amount of disk space used by the specified files,
and by each directory in the hierarchies rooted at the specified files. Here `disk
space used' means space used for the entire file hierarchy below the specified file.

From where did you issue the command "du -h -s" ? Look at this example:
Code:
mingdao@james:~/downloads$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             4.7G  2.7G  2.1G  56% /
/dev/sda2              59G  2.4G   57G   5% /home
/dev/sda7             2.9G   33M  2.9G   2% /distro
/dev/hda1             9.3G  3.7G  5.7G  39% /XP
/dev/hda2             9.3G  4.4G  5.0G  47% /PROGRAMS
/dev/hda3              38G   37G  1.5G  97% /DATA
mingdao@james:~/downloads$ du -h -s
1.4G    .
mingdao@james:~/downloads$ du -h -s /home
2.4G    /home
Could you have issued "du -h -s" from some directory other than /home ?

And I assume when you said "idle" you meant "used" instead?
 
Old 10-31-2004, 05:47 PM   #3
sandrobr
LQ Newbie
 
Registered: Oct 2004
Location: Brazil
Distribution: Red hat, Fedora
Posts: 3

Original Poster
Rep: Reputation: 0
Alright Chinaman, thanks through your reply!


Size Used Avail Use%
The /home is with 1.0G 916M 66M 94% now.

See you the exact problem below so that understand: (Look /home!)

[root@tomate1 root]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 2.0G 470M 1.4G 25% /
/dev/sda1 152M 19M 125M 14% /boot
/dev/sda10 19G 4.0G 13G 23% /data
/dev/sda6 1.0G 916M 66M 94% /home
/dev/sda9 4.9G 823M 3.8G 18% /opt
none 2.0G 0 1.9G 0% /dev/shm
/dev/sda7 1.0G 87M 895M 9% /tmp
/dev/sda3 2.0G 946M 975M 50% /usr
/dev/sda5 2.0G 665M 1.2G 35% /var
tomate6:/backup/tomate1
166G 83G 75G 53% /backup

[root@tomate1 root]# du -h -s /home/
231M /home

You know what may is happening?
 
Old 10-31-2004, 06:25 PM   #4
Joubert79
Member
 
Registered: Jul 2004
Location: Manchester, UK
Distribution: Gentoo
Posts: 46

Rep: Reputation: 15
Perhaps a file has been removed that some process has open. Try using lsof to trace the culprit and perhaps restart the process that holds the file descriptor. Otherwise a reboot should sort the problem.
 
Old 10-31-2004, 06:50 PM   #5
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Quote:
Originally posted by sandrobr
Alright Chinaman, thanks through your reply!


Code:
                               Size   Used   Avail Use%
  The /home is with 1.0G  916M   66M  94%  now.
See you the exact problem below so that understand: (Look /home!)

Code:
[root@tomate1 root]# df -h
Filesystem            Size   Used   Avail Use% Mounted on
/dev/sda2             2.0G  470M  1.4G  25% /
/dev/sda1             152M   19M  125M  14% /boot
/dev/sda10             19G  4.0G   13G  23% /data
/dev/sda6             1.0G  916M   66M  94% /home
/dev/sda9             4.9G  823M  3.8G  18% /opt
none                      2.0G     0    1.9G   0% /dev/shm
/dev/sda7             1.0G   87M  895M   9% /tmp
/dev/sda3             2.0G  946M  975M  50% /usr
/dev/sda5             2.0G  665M  1.2G  35% /var
tomate6:/backup/tomate1
                         166G   83G   75G  53% /backup

[root@tomate1 root]# du -h -s /home/
231M    /home
You know what may is happening?
No I don't know. Perhaps the other gentleman can help you more.

When you post output from command line, use [_code_] before it
and [_/code_] after it (both without the underscores) so that the
formatting will be easier to read. Or use the Code button above the
Post Reply window. I've "coded" your output so you can see the
difference. Of course, it doesn't take out the added spaces.

And I almost forgot again -

Welcome to LQ!
 
Old 11-02-2004, 01:57 PM   #6
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
Your problem might be that you need to run fsck (file system check) on the partition. I had a similar problem on a reiserfs file system. After running reiserfsck on it, the problem disappeared.
 
Old 11-03-2004, 07:06 AM   #7
sandrobr
LQ Newbie
 
Registered: Oct 2004
Location: Brazil
Distribution: Red hat, Fedora
Posts: 3

Original Poster
Rep: Reputation: 0
LinuxGeek,

Your hard disk was SCSI or IDE when had the problem?

Alessandro.
 
Old 01-03-2005, 03:31 AM   #8
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
It was IDE. Wouldn't SCSI disks also be susceptible if someone pulled the plug when you're writing to the disk?

Last edited by LinuxGeek; 01-03-2005 at 03:38 AM.
 
  


Reply



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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
How to set the size of icons for "Starterbar" in "Gdekslets" Blue Jacket Linux - Software 4 11-23-2005 02:42 AM
Need help changing size of "/" Partition wardialer Mandriva 1 04-22-2005 12:55 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 08:31 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 09:01 AM.

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
Open Source Consulting | Domain Registration