[systemd-devel] fully volatile running from ram

Lennart Poettering lennart at poettering.net
Wed Apr 26 14:08:21 UTC 2017


On Tue, 25.04.17 13:13, jr (darwinskernel at gmail.com) wrote:

> hello,
> 
> in a fully-volatile boot scenario /usr from a physical disk gets mounted on
> top of an instance of a tmpfs. my first question is why is that necessary?
> (the tmpfs part i mean)

I am not sure I grok what you are trying to say? tmpfs is how on Linux
you can easily have a volatile file system, as it lives entirely in
memory and never hits the disk (admittedly modulo swapping).

> my second question is, would it be possible to do the same but rather than
> mounting the /usr *populate* the said tmpfs with OS tree from said physical
> disk, preferably in a blocked or fs cached setup (db-cache or bcachefs). i
> realise that this can be done easily in initrd or even initramfs can hold
> the /usr but the problem there is when we boot "developmen" and not
> "production" in which case we want updates to be written to disk.

I am not grokking this question either, but keeping the whole OS in
memory of course means you need a lot of memory. Moreover depending on
disk speeds it means your boot will be quite slow, as you copy stuff
over every single time before you can boot.

If you copy things around like that during boot the best thing would
be to do it in the initrd, as otherwise you are running the system
already, that you are about to prepare for running, and dropping open
references the the old files is hard (though not entirely impossible,
after all there is "systemctl daemon-reexec" and things).

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list