TB00015 What to do when the root files system fills up

From MagnOogle Magna WIKI

Jump to: navigation, search

Magna Computer Corp. Tech Bullient 15

What to do when the root files system fills up

Every now and than a systems log files or some resource files up the computers root file system. This could be some mail that has gone on the rampage or an extremely large print job tries to spool to the root file system.

The manifestation of this problem is a complete slowdown or standstill in the operation of the system. The 'df -v' command produces something similar to the following:

  #df -v
  Mount Dir  Filesystem              blocks      used      free   %used
  /          /dev/root               800002    800002         0    100%
  /u         /dev/u                  600000    361528    238472    60%
  /u2        /dev/u2                 898808    684110    214698    76%
  /u3        /dev/u3                1000002    558362    441640    55%
  /u4        /dev/u4                1105340   1099156      6184    99%


If it is possible to log or dial-in to the system as root then do so. Otherwise reboot and go into single user mode.

Check the printer spooler to see if there is a large print job. Use the command lp -u to see what print jobs are in the que. If you are in single user mode this command will not work. In that case change to the /usr/spool/lp directory and type dus if you do not have the dus command then type du -s * | sort -n this will give you the largest item last. Switch to that directory if it is a directory OR if it is a file then determine if you can remove it. The most common place to find big files here is "/usr/spool/lp/requests". All the files in the requests directory can be removed BUT you will loose all the print jobs queued.

Next you should find that /usr/spool/lp/logs will have large log files. You can safely null these files out with the following commands:

cp /dev/null /usr/spool/lp/logs/requests
cp /dev/null /usr/spool/lp/logs/lpsched


Next change to /usr/spool then run the 'dus' command to see what the largest directory is. Then handle what is found. It will generally be the last or second last item. Determine if it is

Check the sizes of /etc/wtmp and /usr/adm/syslog and /etc/wtmpx. If any are very large then 'cp /dev/null filename' them.


Other files that can be safely deleted are in /lost+found and /tmp directories.

Directories to try

  • /tmp
  • /usr/spool
  • /lost+found
  • /var/adm
  • /var/spool/mail



Category:SCOUnix

Personal tools

Web www.magnoogle.com