LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 08-14-2007, 03:54 AM   #1
m4mach
Member
 
Registered: Jul 2007
Location: Poland
Distribution: Debian
Posts: 45

Rep: Reputation: 15
/proc and disk usage, strange messages


When I do:
Code:
du -sh /proc
I can see this:
Code:
du: cannot access `/proc/1005/task/1005/fd/4': No such file or directory
du: cannot access `/proc/1005/task/1005/fdinfo/4': No such file or directory
du: cannot access `/proc/1005/fd/4': No such file or directory
du: cannot access `/proc/1005/fdinfo/4': No such file or directory
0	/proc
The question is why du is accessing a file or directory that does not exists?? I've seen in the web that several people have the same warnings, but I couldn't find a solution
 
Old 08-14-2007, 05:34 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
The /proc system is a window into the kernel. Running du on /proc doesn't make any more sense than running fsck on the graphic card. Garbage in: garbage out.
 
Old 08-14-2007, 05:39 AM   #3
m4mach
Member
 
Registered: Jul 2007
Location: Poland
Distribution: Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Well I don't run du /proc normally, but du / and the proc is there anyway. And I don't want these garbages in the output

So, you think It is a problem with the kernel?
 
Old 08-14-2007, 05:40 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
How to think of it?? In Linux and Unix, one concept is that "everything is a file". That works to a point--ie there are some file-related commands that work with /proc (e.g. "more"). But the "virtual files" like proc are really just structures in memory, so they don't use the disk. Thus du is not going to work.
 
Old 08-14-2007, 05:42 AM   #5
m4mach
Member
 
Registered: Jul 2007
Location: Poland
Distribution: Debian
Posts: 45

Original Poster
Rep: Reputation: 15
But du /proc works fine in my Debian distro.
 
Old 08-14-2007, 05:48 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
I stand corrected...but it is not telling you the disk utilization---ie all that stuff is not on your disk.
The "files" that don't exist---can you see them by browsing thru the /proc tree?
 
Old 08-14-2007, 05:52 AM   #7
m4mach
Member
 
Registered: Jul 2007
Location: Poland
Distribution: Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pixellany View Post
The "files" that don't exist---can you see them by browsing thru the /proc tree?
No, I don't. And those numbers: .../proc/1005/task... inreases by one at every du execution

Last edited by m4mach; 08-14-2007 at 05:54 AM.
 
Old 08-14-2007, 06:13 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
do ps -e and see if the process IDs you are seeing are actually the ones for du. Perhaps du can't "look at itself"
 
Old 08-14-2007, 06:37 AM   #9
m4mach
Member
 
Registered: Jul 2007
Location: Poland
Distribution: Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Yes but I can't catch du while running, Cannot send it to the background. I have not X yet

EDIT:
Let's assumend it is it's ID, how to get rid of this warnings? When I run du / I don't want to see this garbages

Last edited by m4mach; 08-14-2007 at 06:44 AM.
 
Old 08-14-2007, 06:54 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
du / | grep -v /proc/
OR
du / 2>/dev/null

the first one just bypasses all the output containing "/proc/", but still gives the total for /proc
the second one send all errors to /dev/null
 
Old 08-14-2007, 06:57 AM   #11
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
Never mind...

Last edited by gilead; 08-14-2007 at 06:58 AM. Reason: Too slow on the post button...
 
Old 08-14-2007, 07:02 AM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
OR.....
du --exclude=*/proc*
 
Old 08-14-2007, 07:14 AM   #13
m4mach
Member
 
Registered: Jul 2007
Location: Poland
Distribution: Debian
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by gilead View Post
Never mind...
What never mind?

OK, thanks I will try this
 
Old 08-14-2007, 01:50 PM   #14
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
Quote:
Originally Posted by m4mach View Post
What never mind?

OK, thanks I will try this
Please ignore my other post - I removed the original content because it didn't add anything new.
 
  


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
/proc/partitions disk usage Fippy Linux - General 4 07-25-2008 09:17 AM
CPU, Memory usage in Linux from /proc ruj.sabya Linux - General 1 03-05-2007 09:03 AM
CPU usage from /proc/stat Rohan Nakar Linux - Newbie 3 01-25-2007 12:49 AM
Comuting CPU usage from /proc ziggyboy Linux - Software 1 09-27-2004 12:52 PM
finding cpu usage with /proc breadcrust Programming 16 06-18-2004 05:53 PM


All times are GMT -5. The time now is 09:11 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration