Portal Home > Knowledgebase > How-to > Dedicated servers > Rescue mode on linux

Rescue mode on linux

To activate the rescue mode log into your client area, go to "My Services", then choose the service you want and use the Netboot and select the 'rescue-mode'. Later restart the server, after a few minutes you will get mail with data allowing you to log into the rescue mode.
Get connected in ssh to your server as usual. The only thing that changes is the password. You must use the temporary root pass which is sent to you via email after the rescue mode.
Now you are connected but your files are not accessible. You have to "mount" the file system.
Usually, /dev/xda1 is your root partition (/) and /dev/xda2 corresponds to /home.
If you use software raid then, /dev/md1 is your root partition (/) and /dev/md3 is /home.

There are the following devices:

  • /dev/sd for SCSI, SATA, Raid Hard
  • /dev/hd for IDE disks
  • /dev/md for RAID Soft
  • /dev/rd/c0d0p for raid Mylex

If you don't know which disk you have, or which is its partition table, you must use the commands: fdisk or sfdisk. Here is an example with the command and the response you will get:

rescue:~# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b28c8

Device Boot Start End Blocks Id System
/dev/sda1 * 4096 20482048 10238976+ 83 Linux
/dev/sda2 20482875 28868804 4192965 82 Linux swap / Solaris
/dev/sda3 28868805 1953517568 962324382 83 Linux


We can see /dev/sda with * which shows that it's the bootable disk.

To mount / of the server, you just need to:

mount /dev/sda1 /mnt/


Now we can edit files /etc/fstab for instance or also /etc/sshd/ssh_config, but if you want to be able to do certain things you must be in root on the system which is installed on the disk and that can not be done in the rescue-mode root.
To carry out these operations you have to use the command chroot:

chroot /mnt


After these modifications, you must go back to the client area to restore in Boot from HD.
When the netboot is selected and validated, we perform a soft reboot of the server.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
SSH how to get connected (Views: 3610)