LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   du: cannot access '/proc/4972/task/4972/fd/4': No such file or directory' (https://www.linuxquestions.org/questions/linux-general-1/du-cannot-access-proc-4972-task-4972-fd-4-no-such-file-or-directory-672916/)

fancylad 09-28-2008 12:16 PM

du: cannot access '/proc/4972/task/4972/fd/4': No such file or directory'
 
Today I noticed that my 28G / partition was 99% full. Yesterday it was at 9.5G. I tried using du and this is what I got:

Quote:

root@gentoo ~ $ du -sh /
du: cannot access `/proc/4972/task/4972/fd/4': No such file or directory
du: cannot access `/proc/4972/task/4972/fdinfo/4': No such file or directory
du: cannot access `/proc/4972/fd/4': No such file or directory
du: cannot access `/proc/4972/fdinfo/4': No such file or directory
9.3G /
Then when I tried "df -h" it said that I was still using like 26G of my drive. I tried rebooting and now "df -h" jibes with the output of "du -sh /"; however, what do these error messages with du mean? I know that 4972 is a PID and when I check under /proc that file is not there. So why is du saying that it can't access it? Every time I run "du -sh /" I keep getting the same error message but with a different PID.

jan61 09-28-2008 03:37 PM

Moin,

/proc is a pseudo filesystem; it's a part of your RAM and contains information for every existing process. So, if a process does not exist anymore when du tries to count it, or if a process has closed a file descriptor (subdirectory fd or fdinfo) in the meantime, you get this message. You must keep in mind, that du will at first build a list of files and directories to count and later will count their sizes. Meanwhile there will be a lot of changes on your system - processes are finished, file descriptors are closed and so on.

You should use the -x option of the du command to prevent it from searching mounted filesystems while examining the root partition.

Jan

fancylad 09-28-2008 03:54 PM

thanks for the tip of using -x. i was looking for a way to do this. i also don't get the error messages this way. not sure why though.

jan61 09-28-2008 04:07 PM

Moin,

/proc is (like every other filesystem) mounted on / (directly or in a subdirectory) while your system is running. That's why it is not longer searched when you use the -x option. It makes sense to use this option every time you want to check the disk usage of a filesystem. Mounted filesystems never occupy even a byte in the filesystem you want to examine - it will give you the wrong amount if you include mounted filesystems in your calculation.

Use df or mount to check, which filesystems are mounted and where they are mounted. You'll see: they are all accessible from /.

Jan

sowjanyapuppala 01-27-2017 07:04 AM

-x option of du is not working as expected
 
hi, Can someone help my why -x option is not working and still trying to access mounted files.

/# du -shx ./*
6.7M ./bin
18M ./boot
158G ./data
0 ./dev
6.1M ./etc
2.5G ./home
0 ./initrd.img
60K ./itunes
125M ./lib
4.0K ./lib64
16K ./lost+found
12K ./media
4.0K ./mnt
4.0K ./opt
du: cannot access `./proc/15099/task/15099/fd/4': No such file or directory
du: cannot access `./proc/15099/task/15099/fdinfo/4': No such file or directory
du: cannot access `./proc/15099/fd/4': No such file or directory
du: cannot access `./proc/15099/fdinfo/4': No such file or directory

pan64 01-27-2017 09:20 AM

please do not hide all threads, open a new one. Also if you found this thread please read it especially the last line:
Quote:

Use df or mount to check, which filesystems are mounted and where they are mounted.
http://catb.org/~esr/faqs/smart-questions.html

sowjanyapuppala 01-28-2017 05:26 AM

Got all the filesystems mounted and locations. proc is on / and hence with -x option it didn't filtered. Thanks.
 
Got all the filesystems mounted and locations. proc is on / and hence with -x option it didn't filtered. Thanks.

Quote:

Originally Posted by pan64 (Post 5660989)
please do not hide all threads, open a new one. Also if you found this thread please read it especially the last line:

http://catb.org/~esr/faqs/smart-questions.html



All times are GMT -5. The time now is 02:52 AM.