Skip to content

Server Does Not Boot: Recovery via Rescue

In this article

Diagnostics via the Console

If the server does not respond via SSH or RDP, first find out at which stage the boot process stops:

Reboot the server and watch the output. Typical symptoms:

Message on screen Cause Section
You are in emergency mode, Give root password for maintenance error in /etc/fstab or a corrupted file system File system errors
grub rescue>, No bootable device, error: unknown filesystem corrupted bootloader GRUB does not load
dracut-initqueue timeout, (initramfs), Unable to find root device corrupted initramfs Corrupted initramfs
Kernel panic - not syncing problem with a new kernel Kernel panic

Accessing the System from Rescue Mode

Rescue mode boots the server into a separate recovery system without affecting the data on the disks. It is available on all dedicated (Bare Metal) servers and on VPS with at least 3 GB of RAM, and only for Linux-based operating systems.

  1. In the server card, go to the Rescue Mode tab, select an image, and click Enable Rescue and reboot.
  2. Connect to the server via the Console tab.
  3. Find the root partition:

    lsblk -f
    
  4. If software RAID or LVM is used, activate them:

    mdadm --assemble --scan
    vgscan && vgchange -ay
    
  5. Mount the root partition, then /boot and, on UEFI systems, /boot/efi (substitute the device names from the lsblk output):

    mount /dev/mapper/vg-root /mnt
    mount /dev/sda1 /mnt/boot
    mount /dev/sda15 /mnt/boot/efi   # UEFI only
    
  6. Bind the system directories and switch to the installed OS environment:

    for d in dev proc sys run; do mount --bind /$d /mnt/$d; done
    chroot /mnt /bin/bash
    

After making fixes, leave the chroot with exit, unmount the partitions (umount -R /mnt), and reboot the server. Rescue mode is disabled on the next reboot.

File System Errors and Emergency Mode

Most often, the system drops into emergency mode because of an /etc/fstab entry that refers to a missing disk or an incorrect UUID (for example, after a disk was replaced or removed).

  1. In Rescue mode, check the file system. The partition must be unmounted:

    fsck -y /dev/sda2          # ext4
    xfs_repair /dev/mapper/vg-root   # XFS (CentOS, AlmaLinux, Rocky Linux)
    
  2. Mount the root partition and compare the UUIDs in /mnt/etc/fstab with the blkid output.

  3. Fix the incorrect UUID or comment out the line for the non-existent disk. For additional disks, add the nofail option so that a missing disk does not block the boot:

    UUID=1234abcd-... /data ext4 defaults,nofail 0 2
    

Tip

If the console shows the emergency mode prompt, you can fix /etc/fstab without Rescue: enter the root password, run mount -o remount,rw /, edit the file, and run reboot.

GRUB Does Not Load

Reinstall the bootloader from the chroot (see Accessing the System from Rescue Mode). First determine the boot mode: if the /sys/firmware/efi directory exists in the Rescue system and the installed OS has a /boot/efi partition, UEFI is used; otherwise it is BIOS (Legacy).

Debian/Ubuntu:

# BIOS: specify the disk, not a partition
grub-install /dev/sda
# UEFI
grub-install --target=x86_64-efi --efi-directory=/boot/efi
update-grub

CentOS ⅞, AlmaLinux, Rocky Linux:

# BIOS
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg
# UEFI: reinstall the bootloader packages instead of grub2-install
dnf reinstall grub2-efi-x64 shim-x64   # use yum on CentOS 7
grub2-mkconfig -o /boot/efi/EFI/<almalinux|rocky|centos>/grub.cfg

Note

On AlmaLinux/Rocky Linux 9 and later, /boot/efi/EFI/<distribution>/grub.cfg is a stub that points to /boot/grub2/grub.cfg, so generate the configuration with grub2-mkconfig -o /boot/grub2/grub.cfg.

If the disks are combined into software RAID 1, install the bootloader on each disk of the array (/dev/sda, /dev/sdb).

Corrupted initramfs

A dracut-initqueue timeout error or the (initramfs) prompt after a kernel update usually means that the initramfs image was not built completely — for example, because /boot ran out of space. Rebuild it from the chroot:

Debian/Ubuntu:

update-initramfs -u -k all

CentOS ⅞, AlmaLinux, Rocky Linux:

dracut -f --regenerate-all

Full Boot Partition

If the /boot partition is full, a new kernel and initramfs are installed with errors. Check the free space with df -h /boot and remove old kernels:

After cleaning up, rebuild the initramfs as described above.

Kernel Panic After a Kernel Update

Boot the previous kernel version:

  1. Reboot the server and open the console.
  2. In the GRUB menu, select Advanced options (Debian/Ubuntu) or the previous entry in the kernel list (RHEL family). If the menu is not displayed, hold Shift (BIOS) or press Esc (UEFI) during boot.
  3. Once booted, set this kernel as the default:

    # CentOS 7/8, AlmaLinux, Rocky Linux
    grubby --info=ALL | grep -E "^index|^kernel"
    grubby --set-default /boot/vmlinuz-<version>
    

    On Debian/Ubuntu, remove or reinstall the problematic kernel package (apt remove linux-image-<version>) and run update-grub.

Repairing Windows Boot

Rescue mode is not available for Windows, so use a Windows Server installation ISO image: Mounting an ISO Image on a VPS or Mounting ISO using IPMI.

  1. Boot from the ISO and select Repair your computer in the console.
  2. Run Startup Repair. If that does not help, open Command Prompt and run:

    bootrec /fixmbr
    bootrec /fixboot
    bootrec /rebuildbcd
    
  3. On UEFI systems, recreate the boot files (check the system partition's drive letter in diskpart → list volume):

    bcdboot C:\Windows /f ALL
    
  4. Check the system files: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows.

When to Contact Support

You can contact technical support in two ways: by email from the address specified in your account, or through the Help Center in the Invapi control panel by creating a ticket (how to create a ticket).

Create a ticket for technical support if:

  • the console or Rescue mode is unavailable;
  • lsblk in Rescue mode does not show the disks, or dmesg contains I/O errors (I/O error) — the disk may be faulty;
  • the server does not pass POST or does not see the boot device after the bootloader has been reinstalled.

If you do not need the data or have an up-to-date backup, it is faster to reinstall the server or restore it from a backup or snapshot.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×