Documentation Index

Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

Check for Linux VM booting issues by entering the GRUB mode

Prev Next

Available in VPC

If GRUB-related files are corrupted or deleted, Linux may not boot properly and instead enter the GRUB prompt (grub rescue> or grub>). The system may enter GRUB mode for various reasons, and NAVER Cloud does not provide technical support for this issue. For more information on GRUB, see the official document provided by the Linux OS vendor.

Note

In case the system fails to boot and enters the GRUB prompt after updating the entire package with the dnf (yum) update in XEN-based Rockey Linux 8 VM, see Check for booting issues after XEN-based Rocky Linux 8 update.

Caution

Before an OS kernel patch or package update, create and thoroughly validate My server image to apply the kernel patch or package update to actual services.
Any issues caused by OS updates fall under the responsibility of the customer, and technical support for these issues is not provided.
This guide is reference-only to help you troubleshoot issues yourself, and it is applicable in the KVM environment.

Delete grub.cfg file to forcibly enter GRUB mode

Caution

If you perform this on a running VM, the system cannot be recovered and data may be lost. Do not perform the same test on a running VM.
This guide shows how to forcibly enter the GRUB mode for explanatory purposes.

RedHat-based OSes (NAVIX, Rocky Linux, and RedHat Enterprise Linux)

  1. Access the server remotely.
  2. Delete the grub.cfg file.
    • Rocky Linux 8
    [root@kvm-rockylinux810 ~]# rm /boot/grub2/grub.cfg
    rm: remove regular file '/boot/grub2/grub.cfg'? y
    
    • Rocky Linux 9
    [root@kvm-rockylinux96 ~]# rm /boot/grub2/grub.cfg
    rm: remove regular file '/boot/grub2/grub.cfg'? y
    
  3. Reboot the VM.
    [root@kvm-rockylinux810 ~]# sync;reboot
    
  4. If the server does not boot properly, use the Server access console menu in the MC console.
    linux-grub-mode_rocky-01

Ubuntu OS

  1. Access the server remotely.
  2. Delete the grub.cfg file.
    • Ubuntu 22.04
    root@kvm-ubuntu2204:~# rm /boot/grub/grub.cfg
    rm: remove regular file '/boot/grub/grub.cfg'? y
    
    • Ubuntu 24.04
    root@kvm-ubuntu2404:~# rm /boot/grub/grub.cfg
    rm: remove regular file '/boot/grub/grub.cfg'? y
    
  3. Reboot the VM.
    [root@kvm-ubuntu2204 ~]# sync;reboot
    
  4. If the server does not boot properly, use the Server access console menu in the MC console.
    linux-grub-mode_ubuntu-01

How to boot OS after entering GRUB mode

Note

Once in GRUB mode, the system cannot boot under all circumstances.
If you cannot boot the system with the following method, copy the necessary data using the recovery method with Snapshot and return the existing VM.

RedHat-based OSes (NAVIX, Rocky Linux, and RedHat Enterprise Linux)

  1. Check whether the file system can be accessed properly.
    linux-grub-mode_rocky-02

    Note

    Under normal circumstances, you should be able to see the /grub2/grub.cfg file. However, the file is not visible because it was deleted using the rm command.

  2. Inspect the kernel version you want to boot and the associated files.

    • Rocky Linux 8
      linux-grub-mode_rocky-03

    • Rocky Linux 9
      linux-grub-mode_rocky-04

  3. Attempt to boot by entering the following GRUB commands:

    Note

    The following kernels are used in the following example:
    Rocky Linux 8 : 4.18.0-553.51.1.el8_10.x86_64
    Rocky Linux 9 : 5.14.0-570.18.1.el9_6.x86_64
    You can select versions other than this one.

    • Rocky Linux 8
    grub> set root=(hd0,msdos1)
    grub> linux /vmlinuz-4.18.0-553.51.1.el8_10.x86_64 root=/dev/vda2 ro net.ifnames=0 console=ttyS0,115200n8 console=tty0
    grub> initrd /initramfs-4.18.0-553.51.1.el8_10.x86_64.img
    grub> boot
    
    • Rocky Linux 9
    grub> set root=(hd0,msdos1)
    grub> linux /vmlinuz-5.14.0-570.18.1.el9_6.x86_64 root=/dev/vda2 ro net.ifnames=0 console=ttyS0,115200n8 console=tty0
    grub> initrd /initramfs-5.14.0-570.18.1.el9_6.x86_64.img
    grub> boot
    
  4. After the system boots, log in to the server and recreate the grub.cfg file.

    # grub2-mkconfig -o /etc/grub2.cfg
    

    To return to the In operation status, click [Force stop] in the MC console to end the VM and then restart it.

  5. If booting still fails after trying the above, create a snapshot of the affected VM, mount it on another VM, and copy the data.
    When the server cannot be recovered, see Recover server > How to recover data through snapshot when the server cannot be recovered.

Ubuntu OS

  1. Check if the file system is normal.
    linux-grub-mode_ubuntu-02

    Note

    Under normal circumstances, you should be able to see the /boot/grub/grub.cfg file. However, the file is not visible because it was deleted using the rm command.

  2. Inspect the kernel version you want to boot and the associated files.

    • Ubuntu 22.04
      linux-grub-mode_ubuntu-03

    • Ubuntu 24.04
      linux-grub-mode-ubuntu-04

  3. Attempt to boot by entering the following GRUB commands:

    Note

    The following kernels are used in the following example: You can select versions other than this one.

    • Ubuntu 22.04 : 5.15.0-140-generic
    • Ubuntu 24.04 : 6.8.0-84-generic
    • Ubuntu 22.04
    grub> set root=(hd0,gpt2)
    grub> linux /boot/vmlinuz-5.15.0-140-generic root=/dev/vda2 ro net.ifnames=0 console=ttyS0,115200n8 console=tty0
    grub> initrd /boot/initrd.img-5.15.0-140-generic
    grub> boot
    
    • Ubuntu 24.04
    grub> set root=(hd0,gpt2)
    grub> linux /boot/vmlinuz-6.8.0-84-generic root=/dev/vda2 ro net.ifnames=0 console=ttyS0,115200n8 console=tty0
    grub> initrd /boot/initrd.img-6.8.0-84-generic
    grub> boot
    
  4. After the system boots, log in to the server and recreate the grub.cfg file.

    # update-grub
    

    To return to the In operation status, click [Force stop] in the MC console to end the VM and then restart it.

  5. If booting still fails after trying the above, create a snapshot of the affected VM, mount it on another VM, and copy the data. When the server cannot be recovered, see How to recover data through snapshot when the server cannot be recovered.

FAQs

Q. In the example of GRUB command execution process, is net.ifnames=0 console=ttyS0,115200n8 console=tty0 required?

For KVM VM, that option is a required boot option. A brief explanation of this option is as follows:

  • net.ifnames=0 :: Sets the network interface device name to eth0.
  • biosdevname=0 :: This option is deprecated in newer OS versions.
  • console=ttyS0,115200n8 console=tty0 :: This option specifies the device to use as the console and configures the system to use the serial port console. Without this option, the system may appear to hang during boot, making it difficult to verify successful booting.

After booting the OS, you can check the boot option with the cat /proc/cmdline command.
In the /etc/default/grub file, this option is included in GRUB_CMDLINE_LINUX. So, do not delete this option.
For more information, see the document provided by your OS vendor.