[oe] Making /var/lib persistent

Jamie Lenehan lenehan at twibble.org
Wed Apr 18 09:02:36 UTC 2007


On Tue, Apr 17, 2007 at 12:02:03AM +0200, Koen Kooi wrote:
> Hi,
> 
> Marcel Holtmann just pointed me to the fact that OE mount /var as tmpfs for
> almost all machines, which wipes /var/lib at boot, which will break bluez and
> dpkg.
> 
> What would be the best way to preserve /var/lib (and maybe others) across boots?

This has been brought up a few times and no one has really had a good
answer for it. I think /var/lib at a minimum needs to be made
persistent.

After thinking about it a bit I've got the following proposal:

 - make /var a standard directory (no tmpfs)

 - make /var/volatile a tmpfs filesystems (or /var/tmpfs)

 - symlink things that are to be made volatile from /var into
   /var/volatile

So the default /var would end up looking like this:

 /var/volatile       tmpfs mount
 /var/volatile/lock  *
 /var/volatile/run   *
 /var/volatile/tmp   *
 /var/volatile/cache *
 /var/volatile/log   *
 /var/backups
 /var/lib
 /var/lock           symlink to /var/volatile/lock
 /var/run            symlink to /var/volatile/run
 /var/tmp            symlink to /var/volatile/tmp
 /var/cache          symlink to /var/volatile/cache
 /var/local
 /var/log            symlink to /var/volatile/log
 /var/spool
 /var/www

* == created by the existing volatiles system

(According to the FHS /var/tmp should also persist over reboots.)

This also has an advantage in the situation where I want to make
something persistent I just have to break the symlink. So for the
logs for example I could just have "rm /var/log && mv
/var/volatile/log /var/log" and from then on the logs would remain.

-- 
 Jamie Lenehan <lenehan at twibble.org>




More information about the Openembedded-devel mailing list