Is it possible to have dual boot partitions on usb stick switchable by berryboot loader via vnc.
I need to have a backup boot partition with raspbian Bootable on it.
So that if my primary partition crashes for some reason I can boot to Part2 and reinstall part 1.
This I have to be able to do remotely via ssh or vnc to the berryboot loader to switch the boot partition.
Is there another boot loader out there that has this option?.
The bootloader would be on the 4gb micro sd card and would have an 8gb USB stick with two partitions.
Is this achievable? Or is there a better way too do it?
-
I'm adding this as an answer, instead of a comment due to my lack of reputation, but in regards to compiling grub 4 u-boot, it fails to compile. I get an error stating "Relocations not implemented for A32 ("ARM") instruction set yet" I have attempted this on a 2 and a 1+ with the same result. Is this something that anyone has ran into here?– David SmithCommented Aug 15, 2016 at 18:16
2 Answers
a simple way is to use Grub for ARM.
UPDATE: It works with a help of U-boot, so the uBoot actually boots up a Grub kernel, take a look here - it's a full step-by-step guide I used when I was working with G4A+uBoot, it is not so hard to compile. To achieve the exact task you want you use fdisk
to make 2 boot partitions and the rest is for your main system. You're booting the first boot partition, it works, make a sync/copy if the upgrades are made and tested to be working OK. To rollback - just as usual with grub - just use another boot menu option.
UPDATE#2: you can use UART TTY to have a console or just make a button-press to send a keycodes. It's a simple way of restoring hopelessly-broken system. The more complicated ways are :
- using uBoot you can try to get grub.conf over network like this way - it works, I checked
- you can boot an intermediate image via Grub or even the uBoot - a third boot partition - with SSH and/or VNC server enabled, wait for connection for some time - and then using
kexec()
system call fire-up the boot variant you need. Or - if the connection is made - you can switch in a script which kernel image will be booted. - a rescue system can be loaded via tftp and executed, so you will have your SSH or VNC environment to fix your boot.
-
-
@SteveRobillard My pleasure! feel free to ask further questions - especially this topic was digged by me deeply, so I can help in troubleshooting Commented Mar 24, 2016 at 22:14
-
The question requires that it works over VNC or SSH. Will this? Commented Mar 26, 2016 at 8:49
-
So if the uboot fails to boot partition 1 can I ssh to grub and switch to partition 2?– M NewtonCommented Mar 26, 2016 at 12:58
-
A better way to do this is BerryBoot. It will give you a boot menu and an easy way to add/remove operating systems. It uses squashfs images for the OS, and an overlay for the changes. This way, both OSes share the same space, but they are still separate. Also, you can reset any of them to their original state easily.
To create a squashfs image of the latest raspbian, you can use my script: https://github.com/geek1011/BerryBootImageCreator
-
Can Berryboot be used to make a custom UI for the OS selection menu?– callistoCommented Feb 28, 2019 at 9:28