A disk overflow occurs when too many files fill up the allotted space. This can be caused by a runaway process that creates many unnecessary files. You can use the following procedures to correct the problem:
You must have root user authority to remove processes other than your own.
ps -ef | pgThe ps command shows the process status. The -e flag writes information about all processes (except kernel processes), and the -f flag generates a full listing of processes including what the command name and parameters were when the process was created. The pg command limits output to a single page, so you are not confronted with reams of information scrolling quickly off the screen.
Check for system or user processes that are using excessive amounts of a system resource, such as CPU time. System processes such as sendmail, routed, and lpd seem to be the system processes most prone to becoming runaways.
ps -u
kill -9 1182In this example, the kill command terminates the execution of the process numbered 1182.
rm file1 file2 file3
When an active file is removed from the file system, the blocks allocated to the file remain allocated until the last open reference is removed, either as a result of the process closing the file or due to the termination of the processes that have the file open. If a runaway process is writing to a file and the file is removed, the blocks allocated to the file are not freed until the process terminates.
To reclaim the blocks allocated to the active file without terminating the process, redirect the output of another command to the file. The data redirection truncates the file and reclaims the blocks of memory. For example:
$ ls -l total 1248 -rwxrwxr-x 1 web staff 1274770 Jul 20 11:19 datafile $ date > datafile $ ls -l total 4 -rwxrwxr-x 1 web staff 29 Jul 20 11:20 datafile
The output of the date command replaced the previous contents of the datafile file. The blocks reported for the truncated file reflect the size difference from 1248 to 4. If the runaway process continues to append information to this newly truncated file, the next ls command produces the following results:
$ ls -l total 8 -rxrwxr-x 1 web staff 1278866 Jul 20 11:21 datefile
The size of the datafile file reflects the append done by the runaway process, but the number of blocks allocated is small. The datafile file now has a hole in it. File holes are regions of the file that do not have disk blocks allocated to them.
Use this procedure to fix an overflowing file system in the /usr directory.
rm -f /usr/adm/lp-log rm -f /usr/adm/lw-log
rm -f /usr/spool/uucp/LOGFILE rm -f /usr/spool/uucp/SYSLOG rm -f /usr/spool/uucp/ERRLOG
find /tmp -type f -atime +7 -exec rm -f {} \; find /usr/tmp -type f -atime +7 -exec rm -f {} \;
Use this procedure to fix an overflowing user file system.
find / \( -name "*.bak" -o -name core -o -name a.out -o \ -name "...*" -o -name ".*.bak" -o -name ed.hup \) \ -atime +1 -mtime +1 -type f -print | xargs -e rm -f
The skulker command purges files in /tmp directory, files older than a specified age, a.out files, core files, and ed.hup files. It is run daily as part of an accounting procedure run by the cron command during off-peak periods (assuming you have turned on accounting).
The cron daemon runs shell commands at specified dates and times. Regularly scheduled commands such as skulker can be specified according to instructions contained in the crontab files. Submit crontab files with the crontab command. To edit a crontab file, you must have root user authority.
For more information about how to create a cron process or edit the crontab file, refer to "Setting Up an Accounting System".