LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-09-2010, 01:40 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
A question about checking partition size


I use df -h to list the partition size and I get:
Code:
[root@s003ap03 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root
                      3.0G  2.1G  757M  74% /
/dev/sda1              99M   17M   77M  18% /boot
none                 1004M     0 1004M   0% /dev/shm
/dev/mapper/vg_root-lv_home
                      496M   67M  404M  15% /home
/dev/mapper/vg_root-lv_opt
                      2.5G  1.9G  455M  82% /opt
/dev/mapper/vg_root-lv_tmp
                      496M  117M  354M  25% /tmp
/dev/mapper/vg_root-lv_var
                      2.0G  485M  1.4G  26% /var
One can see the partiton '/opt' is 1.9 G in use.

Then I change to /opt and use 'du -h --max-depth=1' to list the detail and I get:
Code:
[root@s003ap03 opt]# du -h --max-depth=1
8.0K    ./jboss
199M    ./JIRA_TR
559M    ./JIRA_RU
40M     ./.cjournals
12M     ./.BackupExpressChangeJournal
2.4M    ./.BackupExpressJob
477M    ./BackEx
93M     ./netiq
16K     ./lost+found
1.4G    .
Here just show 1.4G in use. Where is the 500 MB?
 
Old 07-09-2010, 02:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

From the du manpage:
Quote:
`--max-depth=DEPTH'
Show the total for each directory (and file if -all) that is at
most MAX_DEPTH levels down from the root of the hierarchy. The
root is at level 0, so `du --max-depth=0' is equivalent to `du -s'.
--max-depth=1 is current dir plus one level down. The "missing" 500Mb is probably 2 or more levels down....

Hope this helps.
 
Old 07-09-2010, 02:24 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by druuna View Post
Hi,

From the du manpage:


--max-depth=1 is current dir plus one level down. The "missing" 500Mb is probably 2 or more levels down....

Hope this helps.
No matter what a max-depth I take, it is always 1.4G
 
Old 07-09-2010, 02:41 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

What do you see with the following command: du -ch

The c switch should also show a grand total. The command you gave only shows totals for individual directories (sorry I overlooked that the first time around).

Hope this helps.
 
Old 07-09-2010, 03:22 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by druuna View Post
Hi,

What do you see with the following command: du -ch

The c switch should also show a grand total. The command you gave only shows totals for individual directories (sorry I overlooked that the first time around).

Hope this helps.
Hi,

The du -ch shows a grand total. But at the end the sum is still 1.4G.
 
Old 07-09-2010, 11:34 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Had some time to do a little search and came up with this: du vs df -- Huge difference (here at LQ).

Hope pixellany's answer helps.

Last edited by druuna; 07-09-2010 at 02:09 PM. Reason: fixed typo
 
  


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
Dual booting with vista, checking on the partition space question?? lemendoza Linux - Newbie 3 08-27-2009 05:17 PM
Question on setting swap partition(size and spltting it to 2 drives) Arodef Linux - Software 4 11-16-2004 04:15 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM
partition size question? Lleb_KCir Linux - General 2 05-23-2004 09:21 AM
fdisk partition size differs from mounted partition size jimieee Linux - General 3 10-15-2003 03:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:01 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
Open Source Consulting | Domain Registration