I know I could use initrd/initramfs to do whatever needed, but I would like to avoid this option, if possible.

I need to have a "normal" working rootfs (on an SD card of an embedded system, if it matters). If, for any reason, booting won't succeed (e.g.: kernel is unable to cleanly mount this system) it should attempt booting from a "recovery" rootfs (SquashFS on Flash) which will be responsible for restoring the "normal" filesystem and restart.

Is something like this available without resorting to initramfs?

Reason why I don't want initrd/initramfs is because of limitations in Flash size.


You can use the "recovery" system for the same purpose as the initramfs. It's nearly the same thing.

Of course it won't be loaded into RAM the same way an initramfs is, but that's the only difference, and it can still serve the same purpose – mount the real rootfs, check if it seems okay, pivot_root into it, and execute its /sbin/init. If the mount fails, it performs recovery.

(And vice versa, you could remove the squashfs filesystem and just put all recovery tools into the initramfs instead – if the device has enough RAM to hold them.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.