[systemd-devel] systemctl switch-root /sysroot without deleting old_root

Richard Maw richard.maw at codethink.co.uk
Sat Nov 7 05:50:18 PST 2015


On Sat, Nov 07, 2015 at 01:55:30PM +0100, Herbert Groll wrote:
> >By some definition, your initial tmpfs isn't an initrd, so you
> >could try
> >removing initrd-release from your cpio image, so it's gone before
> >systemd
> >starts, so it can't cache an invalid result.
> I'm using systemd as initial RAM disk implementation too so the
> switch-root is happening with systemd in initrd mode.

It's possible to do a switch-root without systemd being in initrd mode.

> The only important thing for me in initrd mode is setting up an persistent
> overlay for the initial tmpfs. But maybe I'm better off using a minimalistic
> shell script instead.

That could also work. Be mindful of the difference between switch_root and
pivot_root, the former will also delete the initramfs, but the latter is more
low-level.


More information about the systemd-devel mailing list