[systemd-devel] systemd read-only RootFS for flash-menory usage ?

Lennart Poettering lennart at poettering.net
Mon Jul 21 08:50:29 PDT 2014


On Sat, 19.07.14 16:04, lux-integ (lux-integ at btconnect.com) wrote:

> Greetings,
> 
> I have a computer with  these
> --OS Linux 64bit BLFS  Linux
> --relatively recent version of systemd
> --no hard disk  but instead   compact flash disk
> 
> 
> I am running vanilla systemd ( i.e.  as compiled from source code   and 
> without any   change in scripts ) successfully.
> 
> I want to protect the flash card by minimisng the amount of writes and  erases 
> so I want to create  a /var partition in RAM for logfiles and mount   
> /var on booting  as R/W and the rest as readonly.  I have a number of 
> questions:-
> 
> 
> --Can systemd be run from a read-only root filesystem ?

Sure.

> --If the   suggestion above  (/var in RAM   and   rest  of FS is RO) is not 
> feasible  is there an alternative/better solution?

It's totally feasible. Very recent systemd versions should be able to
set up the most basic stuff in /var automatically, if it is unpopulated
at boot, like it is if you make it a tmpfs. 

Just make /var a tmpfs via fstab and things should mostly work.

Note though that some third-party packages might have problems though if
/var is flushed on every boot. But via some tmpfiles snippets it should
be relatively easy to reconstruct the bits that are necessary for those
at boot.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list