Intro: Control Your Multiboot OS Remotely Using Only SSH (no Keyb/monitor Connected to the Pi)
Description: If you have 2 (or more) operating systems on your pi's SSD card, you can remotely select which partition you want your pi to boot up into on the next reboot.
Instructions: I wanted to use my old pi1 as a mini server for various things that require a GUI using raspbian and also be able to take it next door and watch something while i was running on my treadmill using raspbmc. Without a keyboard and mouse though to select which OS i want to boot into, i had to think of an easy to do that. So i did some research and figured out a shell script that i can use to manually switch the boot record to boot on Raspbian or Kodi using the console from my PC (putty).
This way i can just type : bootin kodi and the next time the pi boots it will boot on the Kodi partition, and bootin raspbian to go back to Raspbian on the next boot.
Here is the script and instructions on how to use it.
- Just log in with root privileges or do : sudo nano /bin/bootin,
- Copy paste my script, press Ctrl+X to save and exit.
- The do: sudo chmod +x /bin/bootin to make it executable.
- You will have to do this in both partitions (raspbian and kodi). One partition is in plain / path, and the other should be inside /media/root0/bin. So basically in the end you will have 2 bootin files...One in /bin and one in /media/root0/bin
- Then type bootin to see the commands.
- Instructions how to adapt the script with your partition numbers are in the script. Make sure you get your partition numbers right !!