Du -sh in / message

 
Thread Tools Search this Thread
Operating Systems Linux SuSE Du -sh in / message
# 1  
Old 01-22-2014
Du -sh in / message

I have cloned a zLinux server and whenever I issue the command 'du -sh' on the / it always gives the below message:
Code:
du: cannot access `./proc/3721/task/3721/fd/4': No such file or directory
du: cannot access `./proc/3721/task/3721/fdinfo/4': No such file or directory
du: cannot access `./proc/3721/fd/4': No such file or directory
du: cannot access `./proc/3721/fdinfo/4': No such file or directory

Question is how to remove this message or how to correct it. In other servers it does not appear. I'm running SLES 11 SP3.

thanks in advance.

Last edited by Franklin52; 01-23-2014 at 03:40 AM.. Reason: Please use code tags
# 2  
Old 01-23-2014
You certainly don't want it digging into /proc/, its contents aren't real files at all, it's a virtual filesystem which shows kernel and process statistics. It's a really bad idea to trawl it even when it's not spitting errors. /sys/ is another virtual filesystem, one unique to linux, which you should avoid trawling. I'd advise you to fix this problem on all your servers, even the ones not complaining.

What exactly are you trying to do? Are you trying to measure the size of the / filesystem alone? du -shx / should do that, the -x will prevent it from wandering into different filesystems (including virtual ones like /proc and /sys).
# 3  
Old 01-23-2014
Instead of
Code:
du -shx /

please consider the much more efficient
Code:
df -h /

To explicitly exclude /proc, you can do
Code:
du -sh --exclude="/proc" /

# 4  
Old 01-24-2014
Thanks all..im trying to check my mountpoints and doing a display of all the files sizes.. I know that the one in the /proc are all dynamic system files being created when servers are started or IPLed.. what i'm worry is that will it give me problem in the future whenever i display or use the "du -sh"..any way to resolved to prevent it from appearing again?
# 5  
Old 01-24-2014
I don't think you can avoid above problem if you want to include /proc despite the warnings. What happened in your case is that process 3721 disappeared in the middle of du's access, so du read the directory info but couldn't read the data. BTW, the result is meaningless, as no disk space is used by /proc.
# 6  
Old 01-24-2014
Quote:
Originally Posted by schizoprenics
Thanks all..im trying to check my mountpoints and doing a display of all the files sizes.. I know that the one in the /proc are all dynamic system files
No, that is wrong.

They are not files. They are not "created" or "deleted". They are completely imaginary -- and should never be trawled because they include sensitive settings which can potentially alter your system configuration by accessing them.

Have you tried my suggestion yet? If need be you can run du for each mountpoint, using a loop.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Ssmtp -t < /path/to/the/message.txt (How to format message.txt for html email)

ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets, Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies

2. Programming

[XQuery] How to Convert from JSON Message to XML Message with XQuery

Hi guys, I'm in a job of converting a restful webservice to soap. Tool for convertation uses XQuery. Now i need to convert a message like this: { "firstName": "John", "midName": null, "lastName": "Smith", "married": false, "address": { "streetAddress": "21 2nd... (5 Replies)
Discussion started by: tien86
5 Replies

3. Programming

Help with message class

May I know how to create message class in order to store input data from the command line, so that the output will come from this class? (4 Replies)
Discussion started by: eel
4 Replies

4. Programming

message and method

Differentiate between the message and method. (2 Replies)
Discussion started by: robinglow
2 Replies

5. Solaris

What is this message!?

While logged on to a box, I got the message: Broadcast Message from oracle (pts/4) on hostname.xx-xxxx.xxx Thu Mar 19 19:00:38... root: Will system be available for use tonight? n -----> this was my response ksh: n: not found Where does this originate from? Did somebody send it to my... (6 Replies)
Discussion started by: FeNiCrC_Neil
6 Replies

6. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies

7. Solaris

scp message

Hi, I will copy a file with /usr/bin/scp -v /tmp/gaga venus:/tmp The result is: PVER1 GERR00Unkonw switch supplied Wath's the matter Thank's a lot Urs (2 Replies)
Discussion started by: MuellerUrs
2 Replies

8. Programming

Message queues

Hi all, I've been trying for hours to figure out how to turn my 2-program (one to send and one to receive) "chat system" using message queues, into a single program where each concurrent component (entity) will both send and receive messages. PLEASE give me a hand with this, I'm starting to... (9 Replies)
Discussion started by: mgchato
9 Replies

9. UNIX for Dummies Questions & Answers

Welcome Message

I have a regular user account in one of the solaris machines. I have been trying to display a message when I log on by modifying my .profile file e.g. +-------------+ .profile +--------------+ echo "Welcome <user>" echo "Today is: "`date` etc. etc. The message keeps on popping... (0 Replies)
Discussion started by: run_time_error
0 Replies

10. UNIX for Dummies Questions & Answers

message

Hello I installed solaris 9, but when I reboot the box, I got this message WARNING:add_spec:No major number for mpt WARNING:add_spec:No major number for mpt WARNING:add_spec:No major number for mpt WARNING:add_spec:No major number for mpt WARNING:add_spec:No major number for mpt ... (2 Replies)
Discussion started by: lo-lp-kl
2 Replies
Login or Register to Ask a Question