How to rescue my server | Scaleway


#1

How to rescue my server

This page shows you how to boot a C1 server in rescue mode. The rescue mode allows you to debug your server.

Requirements

  • You have an account and are logged into cloud.scaleway.com
  • You have configured your SSH Key
  • You have a server

A rescue bootscript is available to help you debugging your server. The rescue bootscript creates a ramdisk with the content of a downloaded rootfs. You will have access to all your disks and will be able to perform debug/rescue actions.

important: If you attach the rescue bootscript while your server is running, you will have to reboot the server to apply changes.

Step 2 - Select the rescue bootscript

In the Control Panel, click “Servers” in the left panel.

Select the server you want to start in rescue mode and click on the “Off” button. In the server details, display advanced options.

The list of available bootscripts appears. Select the rescue bootscript Rescue. Validate.

Power on your server. In a few seconds, your server will be running in rescue mode.

Step 2 - Identify NBD server and port

Your server is now running and you have to connect and mount the volumes that require debug/rescue actions.

The NBD client requires the IP address and the port number of our NBD server exporting your volume. These settings are available from your server details page on the control panel.

The above picture shows the IP address and the port number required to export the volume in our example.

Step 3 - Connect & Mount volumes that require debug / rescue action

Connect a block device

An instance of the NBD client must be started for each block device to import.

For instance:

root@c1-X-Y-Z-T:~# nbd-client 10.1.0.44 4321 /dev/nbd1
Negotiation: ..size = 9536MB
bs=1024, sz=9999998976 bytes
root@c1-X-Y-Z-T:~# fdisk -l -u /dev/nbd1
Disk /dev/nbd1: 100.0 GB, 99999997952 bytes
255 heads, 63 sectors/track, 12157 cylinders, total 195312496 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: 0x00000000

In the above example, nbd-client 10.1.2.21 4129 /dev/nbd1 connects to the NBD server. The output of fdisk -l -u /dev/nbd1 command shows that the block device /dev/nbd1 is attached to the server with success.

Mount a block device

To mount the device manually as /mnt/volume0, run the following commands:

root@c1-X-Y-Z-T:~# mkdir -p /mnt/volume0
root@c1-X-Y-Z-T:~# mount /dev/nbd1 /mnt/volume0

The server is now running in rescue, the volume that requires debug/rescue action is mounted in the /mnt/volume0. You are now be able to perform debug/rescue actions on this volume editing files in the /mnt/volume0 folder.

Try this tutorial on your own C1 server TRY IT


This is a companion discussion topic for the original entry at https://www.scaleway.com/docs/perform-rescue-action-on-my-server/