To boot into recovery mode from GRUB in Linux, follow these steps:
Start your computer: Begin the boot process as usual.
Access GRUB menu: When the computer starts, press and hold the Shift key (or Esc on some systems) to display the GRUB menu. This menu lists all the available operating systems and kernels.
Select the kernel: Use the arrow keys to highlight the kernel you want to boot into recovery mode.
Edit GRUB entry: Press e to edit the selected GRUB entry.
Modify the kernel parameters: In the editor, locate the line starting with linux or linux16. This line specifies the kernel and its parameters.
Add recovery mode parameter: At the end of this line, add the word recovery followed by a space. For example, change:
linux /boot/vmlinuz-5.4.0-42-generic root=/dev/sda1
to:
linux /boot/vmlinuz-5.4.0-42-generic root=/dev/sda1 recovery
Boot with modified parameters: Press Ctrl + X or F10 to boot with the modified parameters.
Enter recovery mode: The system will now boot into recovery mode, where you can perform various maintenance tasks like repairing file systems, managing packages, or resetting configurations.
Example:
If your GRUB entry looks like this:
linux /boot/vmlinuz-5.4.0-42-generic root=/dev/sda1
After adding recovery, it should look like:
linux /boot/vmlinuz-5.4.0-42-generic root=/dev/sda1 recovery
Note: If you're using a cloud environment like Tencent Cloud, recovery mode might not be directly applicable as these environments are managed and configured differently. However, for local Linux installations, the above steps are applicable.
For cloud-based Linux instances, consider using Tencent Cloud's snapshot feature to create backups and restore points, which can help in managing and recovering your system state.