[systemd-devel] [PATCH RFC] namespace: make sure ReadWriteDirectories are actually writable

Lennart Poettering lennart at poettering.net
Fri Feb 14 03:15:13 PST 2014

On Fri, 27.12.13 10:18, Michael Olbrich (m.olbrich at pengutronix.de) wrote:

> Currently adding directories to ReadWriteDirectories= only restores the
> original mount flags. So e.g. setting ReadOnlyDirectories=/usr and
> ReadWriteDirectories=/usr/local works as expected if the underlying file
> system was writable. However, setting ReadWriteDirectories= has no effect
> if the underlying file system is mounted read-only.
> This patch changes that by explicitly remounting the bind mount.

Hmm, so, if the underlying fs is read-only we shouldn't really change

However, it should be possible to simply mount the root mount point
read-only while leaving the backing fs writable. or in other words,
there's a difference between "mount / -o rw,remount" and "mount --bind /
-o rw,remount". The fprmer changes the file system itself, the latter
only the mount point. 

Unfortunately you cannot make this happen with pure fstab, so, you need
to manually invoke that from some service during boot. 


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list