It’s pretty easy to mis-configure something and render one of your servers unbootable. Luckily, with the wonders of PXE, it’s pretty easy to boot into a system rescue tool and fix the problem. Here’s how.
PXE stands for “Preboot eXecution Environment”, and every Cloud Server can be made to boot into this instead of booting into the installed operating system. You just need to hit
CTRL + B as it first starts to boot.
So hit the
Send CtrlAltDel button in the graphical console to start a reboot of your system if you can. If you broke things so hard this doesn’t work, you’ll need to stop and start your server using the manager action menu (this kicks you out of the graphical console, so you’ll need to be quick to bring it back up in time after a start!)
PXE itself is a pretty limited environment, so we just use it to boot into a proper system rescue tool. To get that tool we’ll need networking configured, which is easy with dhcp. Just type:
Now we can tell PXE to download a system rescue image into memory and boot from it. We provide a local copy of SystemRescueCD for this exact purpose, and we provide a little PXE script to make it easy to use. Just type:
And it’ll be downloaded and booted for you
During boot it’ll ask what keyboard mapping you want; United Kingdom is number
Now that SystemRescue is booted, you can mount your Cloud Server’s filesystem and fix whatever you broke. The server’s disk is
/dev/vda and most of our Linux images have the first partition,
/dev/vda1, as the main filesystem.
So just make a mount point and mount it:
mkdir /mnt/vda1 mount /dev/vda1 /mnt/vda1
If you’re rescuing a Windows server, then it’s probably partition 2, so
If you have a more advanced storage layout like LVM then it’s a little trickier, but SystemRescue should have all the tools you need.
When you’re done, just type
reboot and the filesystem will be unmounted and your server will reboot back into it’s operating system!
SystemRescue starts up an ssh daemon by default, so just set a password by running
passwd root and you can ssh into the rescue environment. Handy if you just want to just take a copy of your data from an unbootable system.
Last updated: 25 Apr 2016 at 09:23 UTC