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 09-13-2019, 05:28 AM   #1
dhar_bikramtm
LQ Newbie
 
Registered: Sep 2019
Posts: 12

Rep: Reputation: Disabled
Issue for matching disk space


when i make "df -h" and as per shown below / size is not matching with "du -sh /".Kindly explain why is it or anything else ?? It is a solaris.

"SunOS abc 5.10 Generic_141444-09 sun4v sparc SUNW,Netra-T2000"


Filesystem size used avail capacity Mounted on
/dev/md/dsk/d10 6,8G 5,7G 1,1G 84% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 5,8G 1,6M 5,8G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/platform/SUNW,Netra-T2000/lib/libc_psr/libc_psr_hwcap1.so.1
6,8G 5,7G 1,1G 84% /platform/sun4v/lib/libc_psr.so.1
/platform/SUNW,Netra-T2000/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
6,8G 5,7G 1,1G 84% /platform/sun4v/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
swap 5,8G 7,4M 5,8G 1% /tmp
swap 5,8G 32K 5,8G 1% /var/run
/dev/md/dsk/d30 267G 6,8G 258G 3% /export/home
-bash-3.00$



-bash-3.00$ cd /
-bash-3.00$
-bash-3.00$ pwd
/
-bash-3.00$ du -sh
9,6G .
-bash-3.00$
 
Old 09-13-2019, 05:51 AM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,320

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
the df is showing the space on the mount points
the du -sh is showing everything

I assume you did a cd /, i.e. you are at the root

Code:
df -h /
du -sxh /
du --help
Code:
-x, --one-file-system    skip directories on different file systems
 
Old 09-13-2019, 05:53 AM   #3
dc.901
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 599

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by dhar_bikramtm View Post
when i make "df -h" and as per shown below / size is not matching with "du -sh /".Kindly explain why is it or anything else ?? It is a solaris.

"SunOS abc 5.10 Generic_141444-09 sun4v sparc SUNW,Netra-T2000"


Filesystem size used avail capacity Mounted on
/dev/md/dsk/d10 6,8G 5,7G 1,1G 84% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 5,8G 1,6M 5,8G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/platform/SUNW,Netra-T2000/lib/libc_psr/libc_psr_hwcap1.so.1
6,8G 5,7G 1,1G 84% /platform/sun4v/lib/libc_psr.so.1
/platform/SUNW,Netra-T2000/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
6,8G 5,7G 1,1G 84% /platform/sun4v/lib/sparcv9/libc_psr.so.1
fd 0K 0K 0K 0% /dev/fd
swap 5,8G 7,4M 5,8G 1% /tmp
swap 5,8G 32K 5,8G 1% /var/run
/dev/md/dsk/d30 267G 6,8G 258G 3% /export/home
-bash-3.00$



-bash-3.00$ cd /
-bash-3.00$
-bash-3.00$ pwd
/
-bash-3.00$ du -sh
9,6G .
-bash-3.00$
This is quite common; take a look at this: https://community.oracle.com/thread/3749664
 
Old 09-13-2019, 05:56 AM   #4
dhar_bikramtm
LQ Newbie
 
Registered: Sep 2019
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Firerat View Post
the df is showing the space on the mount points


I assume you did a cd /, i.e. you are at the root

Code:
df -h /
du -sxh /
du --help
Code:
-x, --one-file-system    skip directories on different file systems



@dhar_bikramtm

but it gives a error and what are you mean by everything as " the du -sh is showing everything" kindly explain


-bash-3.00$ df -h /
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d10 6,8G 5,7G 1,1G 84% /
-bash-3.00$
-bash-3.00$
-bash-3.00$ du -sxh /
du: illegal option -- x
usage: du [-a] [-d] [-h|-k] [-r] [-o|-s] [-H|-L] [file ...]
-bash-3.00$
-bash-3.00$

it is a solaris

Last edited by dhar_bikramtm; 09-13-2019 at 05:57 AM.
 
Old 09-13-2019, 06:08 AM   #5
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,320

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Regards the error
you will need to read the manpage for du on solaris and workout how to to get du to look at only the one filesystem.

I already hinted at what I mean by everything

Code:
  -x, --one-file-system    skip directories on different file systems
total up the used reported by df, does it match what was reported by du?

you will need to work out how to get du to ignore things on other file systems ( or mountpoints if that makes more sense to you )
 
1 members found this post helpful.
  


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
Find/grep command to find matching files, print filename, then print matching content stefanlasiewski Programming 9 06-30-2016 05:30 PM
Matching patterns or partial pattern matching yaplej Programming 6 12-16-2012 10:21 AM
[SOLVED] awk with pipe delimited file (specific column matching and multiple pattern matching) lolmon Programming 4 08-31-2011 12:17 PM
[SOLVED] Matching two tables of non-matching sizes astroumut Programming 3 03-03-2011 07:05 AM
Perl Script needed to be reversed to output matching, not non-matching 0bfuscated Programming 2 07-20-2010 10:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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