Rackspace cloud servers - linux rescue mode

This post is regarding rescue mode in Rackspace cloud servers, particularly for Linux systems.  Normally, we can find everything at Rackspace cloud servers knowledge base, but it seems there is no article available on Linux rescue environment there, and somebody who hasn’t worked on Linux much, rescue environment might become daunting.  So, I decided to write one here.

When do I require rescue environment?

First of all, you only require rescue environment when your system has become non-bootable, means something is terrible wrong with the server, it could be either file system corruption, boot files corruption, configuration errors.  There are lots of cases where linux system can become non-bootable.  Most of the times, if linux system encounters any problem during booting time, it will drop you to a maintenance mode environment where you can login with your root password and check for any errors.  The problem with maintenance mode are a) your system is read-only b) most of the services are not working, like SSH. c) you can’t copy your data over the network. d) you have to work on console which is slower than SSH login.

So, in such cases you can always bring your server up in rescue environment and debug the issues with SSH login from your desktop and copy any files from your server for recovery purposes as well.

What is Rescue mode?

Rescue mode grants you full access to your non-bootable server’s filesystem. You can use it to modify problem in configuration files or to use scp to copy data from the slice to a remote location.

For somebody familiar with Linux, rescue mode is similar to booting into single-user mode with networking enabled.

Getting your server into Rescue mode.

You have to login into your cloud servers account at https://manage.rackspaceloud.com.  Click on Hosting->Cloud Servers, then you can click on the server which you want to enable rescue mode.  Once you click on your server, you will see a screen similar to below image, where you can click the Rescue button.

As you can see Rackspace has done well by putting everything in the above message.  It pretty much explains the whole rescue process there, but as always people are too quick to click enter and never read it.  So, I have put the snapshot so that you will give it a read while you are it. :)

Notice that rescue environment is limited to 90 minutes only.  So you only have 3 hours to fix your server or copy the data.  Of course, you can go back again into rescue mode as many times as possible.  I guess, this time limit is there only to prevent misuse of rescue environment.

Once the rescue mode build process is complete, your screen should look similar to above, and your system is in rescue mode.  You will receive an e-mail from Rackspace cloud support with new password to login into rescue mode.

Once you have received the new password, you can actually SSH into your public IP and use new password to login into rescue environment.

As you can see fidk -l command in rescue environment show three disks.

/dev/sdb1 = this is the rescue disk /dev/sda1 = this is our server disk, size of 10.2GB, my current server disk size.  It could be different if your server has a larger disk. /dev/sda2  =  this is swap disk, as you can see from the size of 536MB

Now, what we need to do is mount /dev/sda1 to a directory into rescue environment.  Once /dev/sda1 is mounted to for example /mnt.  Then you can access all your files under /mnt

Likewise, if you made some wrong entries into your /etc/fstab and due to which your system is not booting.  Now in rescue environment you can edit your fstab at  /mnt/etc/fstab, and make the required corrections.

That’s it!  Once you are done editing/fixing, then you can exit the rescue mode by clicking “Exit Rescue Mode” link in your server details page.

Please post any comments if this helped you anyway and also if you see some issues and some things are needed to changed.

– Sandeep Sidhu

w