I have a solaris 10 box on which /proc is a part of /
The problem is that my / partition is getting full mainly
due to /proc getting a lot of files.
My question is : Can I delete files/directories in /proc directory.
If not what could be the other way round to clean up /proc so that I can
free some of the resources.
Upon closer inspection of /proc it contains directories in the name of running PIDs. In my case Apache which has about 35 processes running (shown in ps -ef). These directories are large (some of them are about 700MB or less).
I wonder if these instances of Apache are making my / filesystem full.
Stop looking at /proc as your issue - as Perderabo stated,
Take a look at filesystem full what to look for. Don't try anything that you are not SURE of. Removing files from a system is not something you want to do unless you know what you are doing/deleting.
Look for core or tar files that may have been put on by another person. Since /var and /usr are separate filesystems, don't bother checking them. Check /etc (be CAREFUL!!!) and /opt.
Look at the final field on your df listing. Those are your separate filesystems. Stuff in /proc, /usr, /var, /zone_1, and so on is not in /. And stuff in /proc is nowhere except in memory. As you say, it is your pids. You can delete stuff in /proc by killing processes, but this will not help you. /proc is not a real filesystem, it is a way to access your processes as if they were files.
/ should not grow very much. Has it grown in, say, the past 10 days? Then get a list of files in / modified in the past 10 days...
find / -mount -type f -mtime -10
This will probably be a short list and it should tell you where the problem is.
The /proc system in Solaris uses procfs. Think of it as any other vfs, but instead of representing data on disk, it represents the process structure of running applications. The reason you are seeing it as taking up space is because procfs contains a representation of a given processes address space, as, and as such can be quite large.
Also, keep in mind the command you issued traverses mounted filesystems.
Finally, as the title suggested, "everything is a file." This is a fundamental Unix design principle. It is why devices, ports, virtual terminals, etc, are all accessed as files and through standard system calls like open(), for example. /proc is just extending the "everything is a file" principle to include processes for ease of access. It makes creating (and using) tools like 'pgrep', 'pkill', 'preap' (a personal fav), 'pmap', etc., easy.
Since /export is part of / on your system and home directories are usually in /export/home on Solaris you might want to check the home directories of your users for new files that are taking up too much space. The same can be said for /opt where some applications may be storing things like log files.
Seg, du command that I run does not care wether directories are on separate partitions or not. On this server, /usr, /opt, /export/home, and /var are all on their own partitions so removing things from them would not solve my problem.
I have found stuff to remove for now until we rebuild this old server with an appropraite size /.
Thanks all.
Sara-sh,
I was responding to the original poster. I see now that you resurrected an old thread to bring up your point- my reply was not intended to match your situation.
Thanks Bejo, that is a good point. However the quetion is, was there any disk space released as a result of the reboot, was there more space in / directory after the reboot?
Thanks again ...
Um, rebooting and making "/proc going to normal again" is flawed reasoning and not sound advice technically. /proc appears to grow larger as your machine runs because it contains a representation of running applications memory (NOT DISK) space. So, rebooting makes /proc smaller because you're no longer running those applications. As soon as you start running applications again, /proc will grow as memory gets addressed. This is normal behavior!
>>> /proc has nothing whatsoever to do with disk space. <<<
Side note: don't reboot Unix machines arbitrarily, it makes Unix admins sad.
I am having the similar problem too. proc and dev have taken up huge amount of the space. Will a reboot clear dev too? Currently /home2, 3 and 4 are on different slices.
I guess that I will try one more time... /proc is an illusion. It does not actually consume disk space.
If you create a new process with, say pid 1234 and it is using 300 MB of memory, /proc/1234 will magicly pop into existence and it will be 300 MB in size. But you did not lose any disk space. Not one byte.
Now, kill pid 1234 and /proc/1234 will vanish. But you won't get back even one byte of disk space. /proc/1234 is just a way to treat a process as if it was a data file. This makes stuff like debuggers very easy to write.
/dev, on the other hand, is probably a real problem. It is usually caused by someone doing something like:
tar cvf /dev/wrong-name-for-tape-drive /big/collection/of/files