[NTLUG:Discuss] /var out of space-Still-....help please

Christopher Browne cbbrowne at hex.net
Fri Oct 20 22:05:51 CDT 2000


On Fri, 20 Oct 2000 11:31:27 CDT, the world broke into rejoicing as
"Dan Carlson" <dmcarlsn at yahoo.com>  said:
> After the manual cleanup and installing the latest updates the problem has
> not recurred on my system.  The rpm updates should kill the processes for
> you, but they won't delete the offending directories.  In my case one of the
> directories was 10 MB and the other was 12 MB.  These were the sizes of the
> directory files themselves, not the size of their content!  I was unable to
> switch into either of these directories, so I don't know how many files each
> contained, but the numbers had to be extremely large.  I would execute a cd
> command to switch into them, but after several HOURS of waiting, the command
> still hadn't completed and I would have to kill it.

Howling [expletives not-bothered-with; make up your own]!
A TEN MEGABYTE DIRECTORY.   WOW!!!!

That is spectacularly horrible.

If that happened on RHAT/Mandrake, with their "log rotaters," that
represents Yet Another Strike against them for only half debugging what
they deploy.

I suggest, as a thought, the following:

If these directories are, indeed, so dramatically full of [um, rubbish],
three actions are indicated, in order to keep from needing to do
cruel and unusual things to get the system back up and running:

1.  Start by renaming the offending directories and recreating new
ones, so that existing processes have a place to put logs while the
process is under way.

Such as:
# mv /var/log /var/log.trash
# mkdir /var/log
# chmod a+rx /var/log

2. Then, it is necessary to clean out the offending directory by
deleting the files one by one. 

Don't try doing
  # rm /var/log.trash/*
because that is just going to hang up because there are so many files.

Two alternatives present themselves; read manual pages for find and
xargs if you wish to verify the workings of this:

# find /var/log.trash -print | xargs rm
   The first part sends all the filenames in /var/log.trash to
   standard output; the "xargs" part grabs this in reasonably
   bitesized chunks and generates an "rm" command that nukes
   a _feasible_ number of files at each shot.

# find /var/log.trash -exec 'rm \{\}\;'
   This runs "rm" on each file that is found.

I think I prefer the "xargs" method; it minimizes the number of
processes spawned.

3.  Lastly, delete /var/log.trash

# rmdir /var/log.trash

The 3-step process may need to be repeated for /var/spool/mqueue.
--
cbbrowne at acm.org - <http://www.ntlug.org/~cbbrowne/lsf.html>
Dickson's Gardening Rule: When weeding,  the best way to make sure you
are removing a weed  and not a valuable plant is to  pull on it. If it
comes out of the ground easily, it is a valuable plant.



More information about the Discuss mailing list