You are Here: FAQ ->Dedicated Servers->Linux Root Server->Recovery Tool->Article #7


WebHosting 5.0 This article is for 1&1 Linux WebHosting only.


How to restore the server using the rescue system (older systems)




If you accidentally misconfigured your server or it won't start up properly for any
reason please use the Recovery-Tool to restart the Root-server bypassing its
internal hard drive.

Please note
!Do not run file system repairs on partitions that are mounted as this

will destroy the data!


Prerequisite: Root-Server has to boot up in the Rescue-System

The Rescue System is a Linux system that runs on a RAM-Disk. A connection with 
your Root-Server will look something like this (with your IP address instead of 172.17.1.1):

user@machine:~$ ssh root@172.17.1.1
Password: XXXXX
Welcome to pureserver rescue disk

If you are using a unix/linux/mac from a terminal. If you are using a windows machine you will

need to connect with an ssh client such as putty.

Remote Server Access Using Secure Shell (SSH)

From here you can partition your internal hard drive or edit incorrect settings.
The following is the standard partitioning of the internal hard drive:

root@pureserver-rescue:~# fdisk -l
Disk /dev/hda: 16 heads, 63 sectors, 58168 cylinders
Units = cylinders of 1008 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 66 530113+ 83 Linux
/dev/hda2 67 321 2048287+ 82 Linux swap
/dev/hda4 322 5005 37624230 5 Extended
/dev/hda5 322 959 5124703+ 83 Linux
/dev/hda6 960 1597 5124703+ 83 Linux
/dev/hda7 1598 5005 27374728+ 83 Linux
root@pureserver-rescue:~#

First of all you should run a filesystem check to fix any errors in the file
structure.

Please note
!Do not run file system repairs on partitions that are mounted as this will destroy the data!


rescue:~# fsck /dev/hda1

hda5, hda6, and hda7 are XFS and use different methods to be checked.

rescue:~# xfs_check /dev/hda5
rescue:~# xfs_check /dev/hda6
rescue:~# xfs_check /dev/hda7

If the curser simply returns to the

rescue:~#

then there were no detectable problems. If this does report errors you will first want to mount and umount the drives. Replace x with the partition that

reported an error.

rescue:~# mount /dev/hdax /mnt
rescue:~# umount /dev/hdax

Then check the partition again. If there are still problems with 5, 6, or 7 you will need to run xfs repairs on these partition. Using the -L option does

run the risk of data loss so it is recommended that you use this option if you have backups of the data or the data is already irretrievable.

rescue:~# xfs_repair -L /dev/hdax

Now you can mount the internal hard drive into the /mnt directory and change into
the system on the partition:

rescue:~# mount /dev/hda1 /mnt
rescue:~# mount /dev/hda5 /mnt/usr
rescue:~# mount /dev/hda6 /mnt/var
rescue:~# mount /dev/hda7 /mnt/home

One of the things you can check here is:

ensure that the partitions are not full with

rescue:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/ram0 252M 218M 34M 87% /
tmpfs 998M 4.0K 998M 1% /dev/shm
/dev/hda1 950M 137M 765M 16% /mnt
/dev/hda5 4.7G 2.1G 2.6G 46% /mnt/usr
/dev/hda6 4.7G 4.4M 4.7G 1% /mnt/home
/dev/hda7 221G 111M 221G 1% /mnt/var

if any of these

/dev/hda1 950M 137M 765M 16% /mnt
/dev/hda5 4.7G 2.1G 2.6G 46% /mnt/usr
/dev/hda6 4.7G 4.4M 4.7G 1% /mnt/home
/dev/hda7 221G 111M 221G 1% /mnt/var

are at or near 100% this will cause problems and you will want to remove data to create more free space. You can search for large files with the find

command. So if the /mnt/var partition is full you would use

rescue:~# find /mnt/var -size +1000M

to search for files larger then 1000MB. If you do not find anything decrease the size to 750M and look again.

Now you can repair and/or configure your Root-Server in /mnt

So if you need to make a proper database dump of your mysql databases you could start mysql

rescue:~# /etc/init.d/mysqld start

Please note
Remember you are running the everything out of the RAM and so have less memory to work with then normal. So start as few services as possible to accomplish what you need to accomplish.


After you have finished restoring your root server you need to execute the
following commands to restart your Root-Server:

to exit the chroot environment

rescue:~# exit

umount the file system

rescue:~# umount -al

Do not forget to unmount your internal hard drive after the restore and BEFORE you
restart the server. Also remember to change your Root-Server back to normal boot
mode from your Control Panel. You have the option of rebooting from inside the recovery tool or just chaning the boot image by either selecting the reboot

now option or not. If you do not select the reboot now option it will only change the boot mode.

rescue:~# shutdown -r now



Print Article
How useful was this article?
(From 5 = Very Useful to 1 = Not useful at all):
1 2 3 4 5