Have you ever wanted to change the kernel/distribution of a running server but you don't have access to boot media or pxe mechanisms? I had come across a solution many moons ago, but lost the link to how it could be accomplished.
The basic mechanism relies on being able to SSH into a server, remain in a console environment, build a ram based environment, unmount and rebuild the drive environment, then reboot from the modified drive environment.
Now, within the space of a week, I came across two links which describe, or at least of scripted explanations to the process:
- reload.sh found on github with 192 stars (as of this writing), and links to the next one as it's source of influence
- takeover.sh, also found on github but with 5808 stars (as of this writing), and has some Hacker News background -- "A script to completely take over a running Linux system remotely, allowing you to log into an in-memory rescue environment, unmount the original root filesystem, and do anything you want, all without rebooting. Replace one distro with another without touching a physical console."
I have not yet personally evaluated these scripts for my own use. But I will be sure to run the procedure in a protected, reproducible test environment prior to attempting the procedure in something resembling a production environment.