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:

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.

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).

Instead of

du -shx /

please consider the much more efficient

df -h /

To explicitly exclude /proc, you can do

du -sh --exclude="/proc" /

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?

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.

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.