Server recovery

Prev Next

Available in VPC

This document describes how to recover a server that does not boot properly.

Enter Single Mode

For any of the following situations, enter Single mode and recover the server:

To enter Single mode and recover the server, follow these steps:

  1. Select a server to boot from the server list, and then click [Force stop].
    server-ts-repair-vpc-01_ko.png
  2. Click [Start] to boot the stopped server, and click [Server connection console].
    server-ts-repair-vpc-02_ko.png
  3. Check how to enter Single mode for each OS to perform the server recovery procedures.

Enter CentOS Single Mode

To enter single mode in CentOS and recover the server, follow these steps:

  1. Enter e in the Select Kernel version page to enter the Edit booting parameter page.
    server-ts-repair-vpc-03

  2. Edit the parameter as follows, press [Ctrl] + [x], and start the OS with the edited booting parameter.
    Edit ro into rw init=/sysroot/bin/bash, and delete rhgb quiet.
    server-ts-repair-vpc-04

  3. Enter single mode.
    server-ts-repair-vpc-05

  4. Run the following commands and mount the partition component of the server:

    :/# chroot /sysroot
    

Enter Ubuntu Single Mode

To enter single mode in Ubuntu and recover the server, follow these steps:

  1. Enter e in the Select Kernel version page to enter the Edit booting parameter page.
    server-ts-repair-vpc-06

  2. Edit the parameter as follows, press [Ctrl] + [x], and start the OS with the edited booting parameter.
    Edit ro into rw single init=/bin/bash.
    server-ts-repair-vpc-07

  3. Enter single mode.
    server-ts-repair-vpc-08

Enter NAVIX, Rocky Linux Single Mode

To enter single mode in Rocky Linux and recover the server, follow these steps:

  1. Enter e in the Select Kernel version page to enter the Edit booting parameter page.
    server-ts-repair-vpc-09
  2. Edit the parameter as follows, press [Ctrl] + [x], and start the OS with the edited booting parameter.
    Edit ro into rw init=/sysroot/bin/bash.
    server-ts-repair-vpc-10
  3. Enter single mode.
    server-ts-repair-vpc-11
  4. Run the following commands and mount the partition component of the server:
    :/# chroot /sysroot
    

Change the boot kernel

To change the boot kernel for each OS and recover the server, follow these steps:

Change the CentOS boot kernel

To change the boot kernel in CentOS, follow these steps. In this section, it is described with the example of changing the boot kernel into CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core):

  1. Run the following commands to check the current kernel settings:
    [root@centos ~]# grub2-editenv list
    saved_entry=CentOS Linux (3.10.0-1127.el7.x86_64) 7 (Core)
    
  2. Run the following command to check the kernel list:
    [root@centos ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
    CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core)
    CentOS Linux (3.10.0-1127.el7.x86_64) 7 (Core)
    CentOS Linux (0-rescue-4bfdd392cea14cb58d22427c1c69c5df) 7 (Core)
    
  3. Change the default boot kernel settings, run the following command, and check the changed kernel settings:
    [root@centos ~]# grub2-set-default "CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core)"
    
    [root@centos ~]# grub2-editenv list
    saved_entry=CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core)
    
  4. Reboot the server, run the following command, and check the kernel:
    [root@centos ~]# reboot
    
    [root@centos ~]# uname -r
    3.10.0-1127.19.1.el7.x86_64
    

Change the Ubuntu boot kernel

To change the boot kernel in Ubuntu, follow these steps. In this section, it is described with the example of changing the boot kernel into 5.4.0-131-generic:

  1. Run the following commands to check the current kernel settings:
    root@ubuntu:~# cat /etc/default/grub | grep GRUB_DEFAULT
    GRUB_DEFAULT=0
    
  2. Run the following command to check the kernel list:
     root@ubuntu:~# awk -F"--class" '/menuentry/ && /with Linux/ {print $1}' /boot/grub/grub.cfg | awk '{print i++ " : " $5,$6,$7,$8}' | sed -e "s/'/ /g"
     0 : 5.4.0-182-generic    
     1 : 5.4.0-182-generic (recovery mode)  
     2 : 5.4.0-131-generic    
     3 : 5.4.0-131-generic (recovery mode)
    
  3. Change the default boot kernel settings, run the following command, and check the changed kernel settings:
    root@ubuntu:~# sed -i 's/GRUB_DEFAULT=.*/GRUB_DEFAULT=saved/g' /etc/default/grub
    
    root@ubuntu:~# grep "GRUB_DEFAULT" /etc/default/grub
    GRUB_DEFAULT=saved
    
    root@ubuntu:~# grub-set-default "Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-131-generic"
    
     root@ubuntu:~# grub-editenv list
     saved_entry=Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-131-generic
    
     root@ubuntu:~# update-grub
     Sourcing file `/etc/default/grub'
     Sourcing file `/etc/default/grub.d/init-select.cfg'
     Generating grub configuration file ...
     Found linux image: /boot/vmlinuz-5.4.0-182-generic
     Found initrd image: /boot/initrd.img-5.4.0-182-generic
     Found linux image: /boot/vmlinuz-5.4.0-131-generic
     Found initrd image: /boot/initrd.img-5.4.0-131-generic
     done
    
  4. Reboot the server, run the following command, and check the kernel:
    root@ubuntu:~# reboot
    
    root@ubuntu:~# uname -r
    5.4.0-131-generic
    

Change the Rocky Linux boot kernel

To change the boot kernel in Rocky Linux, follow these steps. In this section, it is described with the example of changing the boot kernel into Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian):

Note

For Rocky Linux 8, grub2 is used as the default boot loader in the XEN environment, and BootLoaderSpec Configuration (BLSCFG) is the default in the KVM environment. Thus, you must use grub2 commands in the XEN environment, and grubby commands in the KVM environment.

  1. Run the following commands to check the current kernel settings:
    • XEN environment Rocky Linux 8
    [root@rockylinux ~]# grub2-editenv list
    saved_entry=a4746ff35a7a4d2a9f4280ec20051fb6-4.18.0-553.el8_10.x86_64
    boot_success=0
    
    • KVM environment Rocky Linux 8
    [root@kvm-rockylinux ~]# grubby --default-kernel
    /boot/vmlinuz-4.18.0-553.el8_10.x86_64
    
  2. Run the following command to check the kernel list:
    • XEN environment Rocky Linux 8
    [root@rockylinux ~]# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2
    Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian)
    Rocky Linux (4.18.0-553.el8_10.x86_64) 8.8 (Green Obsidian)
    Rocky Linux (4.18.0-477.13.1.el8_8.x86_64) 8.8 (Green Obsidian)
    Rocky Linux (0-rescue-a4746ff35a7a4d2a9f4280ec20051fb6) 8.8 (Green Obsidian)
    
    • KVM environment Rocky Linux 8
    [root@kvm-rockylinux ~]# grubby --info=ALL | grep ^kernel
    kernel="/boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64"
    kernel="/boot/vmlinuz-4.18.0-553.el8_10.x86_64"
    kernel="/boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64"
    kernel="/boot/vmlinuz-0-rescue-2faf2183dcf14a70b2b32e1b9fe6e4e9"
    
  3. Change the default boot kernel settings, run the following command, and check the changed kernel settings:
    • XEN environment Rocky Linux 8
    [root@rockylinux ~]# grub2-set-default "Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian)"
     
    [root@rockylinux ~]# grub2-editenv list
    saved_entry=Rocky Linux (4.18.0-553.5.1.el8_10.x86_64) 8.8 (Green Obsidian)
    boot_success=0
    
    • KVM environment Rocky Linux 8
    [root@kvm-rockylinux ~]# grubby --set-default="/boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64"
    The default is /boot/loader/entries/2faf2183dcf14a70b2b32e1b9fe6e4e9-4.18.0-553.5.1.el8_10.x86_64.conf with index 0 and kernel /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64
     
    [root@kvm-rockylinux ~]# grubby --default-kernel
    /boot/vmlinuz-4.18.0-553.5.1.el8_10.x86_64
    
  4. Reboot the server, run the following command, and check the kernel:
    [root@kvm-rockylinux ~]# reboot
    
    [root@kvm-rockylinux ~]# uname -r
    4.18.0-553.5.1.el8_10.x86_64
    

Change the NAVIX boot kernel

To change the NAVIX boot kernel, follow these steps.
In this section, it is described with the example of changing the boot kernel into NAVIX (5.14.0-570.58.1.el9_6.x86_64) Navix 9.6 (Jeongja):

  1. Run the following commands to check the current kernel settings:
    [root@navix ~]# grubby --default-kernel
    /boot/vmlinuz-5.14.0-570.55.1.el9_6.x86_64
    
  2. Run the following command to check the kernel list:
    [root@navix ~]# grubby --info=ALL | grep ^kernel
    kernel="/boot/vmlinuz-5.14.0-570.58.1.el9_6.x86_64"
    kernel="/boot/vmlinuz-5.14.0-570.55.1.el9_6.x86_64"
    kernel="/boot/vmlinuz-5.14.0-570.28.1.el9_6.x86_64"
    kernel="/boot/vmlinuz-0-rescue-54fb700195804c2a9a699ec61684badf"
    
  3. Change the default boot kernel settings, run the following command, and check the changed kernel settings:
    [root@navix ~]# grubby --set-default="/boot/vmlinuz-5.14.0-570.58.1.el9_6.x86_64"
    The default is /boot/loader/entries/54fb700195804c2a9a699ec61684badf-5.14.0-570.58.1.el9_6.x86_64.conf with index 0 and kernel /boot/vmlinuz-5.14.0-570.58.1.el9_6.x86_64
     
    [root@navix ~]# grubby --default-kernel
    /boot/vmlinuz-5.14.0-570.58.1.el9_6.x86_64
    
  4. Reboot the server, run the following command, and check the kernel:
    [root@navix ~]# reboot
    
    Once booting is complete, check the kernel version.
    [root@navix ~]# uname -r
    5.14.0-570.58.1.el9_6.x86_64
    

How to recover data through snapshot when the server cannot be recovered

If the server cannot be recovered by entering Single mode or changing boot kernel, you can recover stored data by creating a new storage in the server you want using a created snapshot.
To recover the data using the snapshot, follow these steps:

  1. See the Create snapshot guide to create a snapshot.
  2. See the Create storage with snapshot guide to create a storage using a snapshot, and mount it on the server.
    Note
    • Because the storage data is read and recovered from the snapshot, skip the disk partition and storage format tasks.
    • If a snapshot was created from another server's default storage for booting or from one of the existing storages of a server with added storage, the identifiers of the original server's storage and the created storage will overlap, making mounting impossible.
    • See Change storage identifier and change the created storage's identifier.
  3. Connect to the path to mount the storage and recover the data.