LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 12:56 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
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, 01: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, 01:54 AM   #3
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 99

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:13 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