[RFC] Four solutions to NAND fillup
Guylhem Aznar
olpc at guylhem.net
Fri Jul 25 11:46:34 EDT 2008
Hello
A suggestion for similar problems, which I experienced in the past for
other hardware.
The /var tree is mostly used for logs and caches - stuff that could be
discarded at reboot. And usually, there's a lof ot them (see with du
-ksh)
There are some important subdirs that however should be kept.
What I did :
/var is a link to some directory mounted as shmfs (there are various
ones, take the one you prefer)
when no shm is mounted, this directory contain a "skeleton" /var to
keep some apps happy during a reboot or in case something bad happen,
like removing kernel shmfs support
as soon as the first script is run and a shmfs is mounted, the
skeleton /var is untarred. takes 1 second
"important" subdirs that should be kept (you decide which) are links
to normal locations. I use /srv. The symlinks are in the var skeleton
tarball
Of course the solution can be simplified and improved, like by keeping
/var intact and instead using symlinks and a skeleton tarball for
stuff you know you want to discard at reboot (/var/log...) but this
approach forces me to consider each situation individually.
By default whatever is not a symlink to a stable location (/srv) will
automatically be discarded on next reboot.
This may not be very pretty, but it is quite usefull. This provides
room for fixing the situation because a simple reboot clears the log,
giving enough space to at least run some delete commands.
Guylhem
More information about the Devel
mailing list