Rescue mode may be used to perform many tasks related to system recovery and disk management. For example, if your primary filesystem becomes corrupted for any reason, you may use rescue mode to perform a filesystem check on it. Other uses include formatting disk images to use different filesystems, copying data between disk images, and downloading files from a disk image via SSH/SFTP.
Based on the Finnix recovery distribution, rescue mode proves an easy to use and safe environment for performing such tasks. Additionally, as rescue mode boots using an image supplied by the host your Linode resides on, it does not use any of your Linode's disk space quota.
Click the "Rescue" link in the Linode Manager to access the rescue mode screen.
On the "Rescue" tab, your Linode's disk images will be automatically assigned to devices. You may adjust this configuration before clicking the "Reboot into Rescue Mode" button to proceed.
You will be returned to your Linode's Dashboard tab once the rescue mode boot job is entered into the job queue. Next, visit the "Remote Access" tab. If you wish to use the in-browser AJAX console to access your system in rescue mode, click "Launch Lish Ajax console" under the "Console Access" section. You may also access the Lish console via a traditional SSH client. More information on doing so may be found in our Lish guide.
Once your Linode has booted into Finnix, its console should resemble the following example.
Rescue mode may be used to accomplish a variety of system recovery and maintenance tasks. For example, you may use it to run a fsck on a disk image. Please note that running fsck on mounted disks is potentially extremely destructive; make sure you haven't mounted (or have unmounted) a disk prior to running filesystem checks on it.
To mount a disk and view or edit its contents, you may use commands similar to the following example, adjusting the device name to match the one you assigned to the disk before launching rescue mode. Disks that contain a single ext3 filesystem will have mount points under /media in the rescue environment's /etc/fstab file by default.
mount /dev/xvdc ls /media/xvdc
Rescue mode can be handy for manually creating filesystems, custom partitioning schemes, or LVM setups that aren't directly supported by the Linode Manager interface. It should be noted that such configurations are unsupported, especially for things like the Linode backup service. In the example below, rescue mode is used to create an XFS filesystem on a disk.
If you wish to copy files to another system using rescue mode, you can set the root password and start an SSH server by issuing the following commands.
passwd /etc/init.d/ssh start
Once the SSH server has started, you may access any mounted disks via SFTP using the client of your choice by logging in as "root" to your Linode's IP address.
As Finnix is based on Debian, you may use the apt package management system to install additional software in the temporary rescue environment. For example, you may install and run the htop utility by issuing the following commands:
apt-get update apt-get install htop htop
You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
This guide is licensed under a Creative Commons Attribution-NoDerivs 3.0 United States License.
Last edited by Dave Eaton on Wednesday, June 29th, 2011 (r2287).
