LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   /proc and disk usage, strange messages (https://www.linuxquestions.org/questions/linux-from-scratch-13/proc-and-disk-usage-strange-messages-576940/)

m4mach 08-14-2007 03:54 AM

/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

stress_junkie 08-14-2007 05:34 AM

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.

m4mach 08-14-2007 05:39 AM

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?

pixellany 08-14-2007 05:40 AM

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.

m4mach 08-14-2007 05:42 AM

But du /proc works fine in my Debian distro.

pixellany 08-14-2007 05:48 AM

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?

m4mach 08-14-2007 05:52 AM

Quote:

Originally Posted by pixellany (Post 2858354)
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

pixellany 08-14-2007 06:13 AM

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"

m4mach 08-14-2007 06:37 AM

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

pixellany 08-14-2007 06:54 AM

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

gilead 08-14-2007 06:57 AM

Never mind... :)

pixellany 08-14-2007 07:02 AM

OR.....
du --exclude=*/proc*

m4mach 08-14-2007 07:14 AM

Quote:

Originally Posted by gilead (Post 2858402)
Never mind... :)

What never mind?

OK, thanks I will try this

gilead 08-14-2007 01:50 PM

Quote:

Originally Posted by m4mach (Post 2858413)
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.


All times are GMT -5. The time now is 06:43 AM.