LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-26-2009, 01:56 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
A question about checking HD


I use 'df -h' and get:
Code:
[root@s003ap02-test ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root
                      3.0G  2.3G  551M  81% /
/dev/sda1              99M   15M   80M  16% /boot
none                  3.0G     0  3.0G   0% /dev/shm
/dev/mapper/vg_root-lv_home
                      496M  153M  318M  33% /home
/dev/mapper/vg_root-lv_opt
                      7.9G  3.3G  4.3G  43% /opt
/dev/mapper/vg_root-lv_tmp
                      496M   83M  389M  18% /tmp
/dev/mapper/vg_root-lv_var
                      2.0G  462M  1.5G  25% /var
It seems the volume root used 2.3 GB. But as I use 'du -shc /*' to check I get:
Code:
[root@s003ap02-test ~]# du -shc /*
6.1M    /bin
14M     /boot
4.0K    /cjtemp
236K    /dev
14M     /etc
143M    /home
8.0K    /initrd
102M    /lib
17M     /lib64
28K     /logs
16K     /lost+found
16K     /media
12K     /mnt
3.2G    /opt
7.3G    /proc
209M    /root
18M     /sbin
8.0K    /selinux
8.0K    /srv
0       /sys
72M     /tmp
1.4G    /usr
411M    /var
13G     total
Here one can see the /root just used 209 M.

Why?
 
Old 11-26-2009, 02:14 AM   #2
Unknown_User
Member
 
Registered: Jan 2003
Location: EU (UK)
Distribution: Ubuntu 14.x, Raspbian, Kali
Posts: 226

Rep: Reputation: 30
You are not comparing like-for-like so they won't be the same - The second output shows details of your local filesystem but the first relates to mapped directories.

Despite having similarities such as the 'root' title they are logically (and possibly physically) seperate.
 
Old 11-26-2009, 02:54 AM   #3
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
df will indicate usage on each partition mounted in your system. One partition have to be mounted as / and is often called "root".

du on the other hand will indicate haw much space each file or directory uses. On / partition is usually folder called /root which is "home" for root user (but it can have its separate partition).

So if you want the results to match each other you would have to add all folders on one partition together (i.e. to get your / size you will have to add size of all folder listed in du output except /boot /home /opt /tmp and /var which are on separate partitions)
 
  


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
newbie log checking question tv1 Linux - Security 7 08-23-2007 12:34 PM
SQL question - checking for NULL? BrianK Programming 2 04-13-2007 11:11 AM
Question about update-checking syntax for all distros Anonycat Linux - Distributions 0 03-11-2007 09:42 AM
Newbie Question - Checking Kernel Version squall1986 Fedora 3 11-14-2006 03:28 PM
Checking LCD monitor question satimis Linux - General 0 08-25-2003 03:19 AM


All times are GMT -5. The time now is 04:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration