LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-28-2008, 01:16 PM   #1
fancylad
Member
 
Registered: Mar 2008
Distribution: slackware
Posts: 175

Rep: Reputation: 19
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.
 
Old 09-28-2008, 04:37 PM   #2
jan61
Member
 
Registered: Jun 2008
Posts: 235

Rep: Reputation: 47
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
 
Old 09-28-2008, 04:54 PM   #3
fancylad
Member
 
Registered: Mar 2008
Distribution: slackware
Posts: 175

Original Poster
Rep: Reputation: 19
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.
 
Old 09-28-2008, 05:07 PM   #4
jan61
Member
 
Registered: Jun 2008
Posts: 235

Rep: Reputation: 47
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
 
Old 01-27-2017, 08:04 AM   #5
sowjanyapuppala
LQ Newbie
 
Registered: Jan 2017
Posts: 2

Rep: Reputation: Disabled
-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
 
Old 01-27-2017, 10:20 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 15,644

Rep: Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128Reputation: 5128
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
 
1 members found this post helpful.
Old 01-28-2017, 06:26 AM   #7
sowjanyapuppala
LQ Newbie
 
Registered: Jan 2017
Posts: 2

Rep: Reputation: Disabled
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 View Post
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
 
  


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: /proc/xxxx/task: No such file or directory King4lex Linux - Software 5 04-14-2007 08:42 AM
#include <task.h> : No such file or directory Eileen Programming 1 04-20-2006 04:26 AM
cannot open /proc/bus/usb/devices, No such file or directory aspartat Linux - Software 2 11-02-2005 01:57 PM
/proc/splash: no such file or directory longnam Slackware 1 05-14-2005 04:39 AM
proc/splash: No such file or directory asianboi2k Linux - Software 3 11-04-2003 09:20 AM

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

All times are GMT -5. The time now is 11:14 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
Open Source Consulting | Domain Registration