I have a doubt about boot process, is possible set boot partition from boot if /dev/root fails? like a grub select. I prefer no use berryboot and my install is noobs based. My idea is set a boot partition failover for data corruption on SD card. Any ideas?
2 Answers
You need to edit /boot/cmdline.txt
and define root=PARTUUID=
, for example root=PARTUUID=1e4c4b75-02
You can have multiple partitions, up to 3 (except boot one), with different OS.
To find your destinated PARTUUID you can use this command:
ls -l /dev/disk/by-partuuid/
Each of rootfs partitions have to have own /etc/fstab
with its PARTUUID
You can prepare two folders /boot/os1
and /boot/os2
with separated kernels
/cmdline.txt
. Than just move content of needed os to /boot and it works just like full separated dual boot.
No. You could (I believe this is what something like berryboot probably does; I haven't used it) load a minimal root fs, possibly from an initramfs, present the user with options, and then switch the root filesystem (which is what initramfs kernels always do), but obviously there is a bit of work involved.
Alternately, you could write your own bootloader code, but this is even more work, and may require some proprietary knowledge (I'm not sure).
-
I think you can load busybox (grub, or that new bootloader) onto the boot partition, from which you can then use some logic to start a kernel on any other parition. Just something I read somewhere. But you need to compile the
boot.img
with all this.. that didnt look to easy for me. Commented Dec 2, 2015 at 19:40 -
@ppumkin No, you would need a kernel before busybox, which can be used as a drop-in for init without needing a rootfs. It can't act as it's own kernel. So similar to the initramfs idea. Note you can built an initramfs into the kernel, presumably one including busybox -- although don't think there would be much advantage to that, because you might as well just load an initramfs from the first partition.– goldilocks ♦Commented Dec 2, 2015 at 19:44
-
Ahh.. right. So I wonder if he could put a busybox kernel on the default parition where Raspbain would be (EXT2) not on the (FAT), and from the busybox chain load the actual kernel he needs, like from NFS or whatever. He could use a 8MB SD Card (if that is even supported) - Yea? Commented Dec 2, 2015 at 19:46
-
raspberrypi.org/blog/boot-from-a-16mb-sd-card - This links to a tutorial where they use a custom bootloader and change something in a text editor to direct from where to chain load the actual kernel. Pretty cool, but the filesytem needs to be mounted/accessible though, ie USB drive. Commented Dec 2, 2015 at 19:49
-
"from the busybox chain load" -> That's sort of what I'm saying about the initramfs -- which normally is basically a lot like busybox, an init plus some utilities (and kernel modules, but the relevant stuff is just built in on the pi). You can do whatever you want in it, it's a tiny OS. That includes various ways to switch the seat of the root filesystem. Except I don't see the point in chainloading a different kernel unless you want something non-linux -- dunno what the options there would be.– goldilocks ♦Commented Dec 2, 2015 at 19:51
cmdline.txt
containsroot=/dev/mmcblk0p2
(at least for Rasbpian different if NOOBS). You can change this to a different partition (provided \etc\fstab is correctly set in the partition). I don't normally bother with multi-boot on a Pi. A 8GB SD costs $7 - I just swap SD).