Complete Guide to Ubuntu 24 Recovery Mode | Boot Methods, Repair Steps, and Troubleshooting

目次

1. Introduction

Ubuntu is widely used as a simple and user-friendly Linux distribution. However, system updates or configuration changes can sometimes cause Ubuntu to suddenly fail to boot. In such cases, utilizing Recovery Mode is crucial for system repair.

Recovery Mode is a special mode that allows the system to boot with minimal functionality. This enables troubleshooting and repair even when the system fails to start due to corruption or incorrect settings.

What is Recovery Mode?

Ubuntu’s Recovery Mode is a special boot mode accessed via the GRUB (GNU GRUB bootloader) that allows troubleshooting and system repairs. Unlike normal booting, it launches with minimal system resources and provides administrator-level access to the shell.

With Recovery Mode, you can perform the following tasks:

  • Repair corrupted system files
  • Fix or reinstall software packages
  • Check and repair file system errors
  • Enable network connectivity
  • Repair and reinstall GRUB
  • Perform system operations with root privileges

Purpose of This Article

This article explains how to use Recovery Mode in Ubuntu 24. Specifically, we will cover the following:

  1. What is Recovery Mode in Ubuntu 24?
  2. How to enter Recovery Mode in Ubuntu 24
  3. Details of the available options in Recovery Mode
  4. How to troubleshoot issues using Recovery Mode
  5. Important precautions when using Recovery Mode
  6. Frequently Asked Questions (FAQ)

This guide aims to help users effectively utilize Recovery Mode to troubleshoot and resolve system issues.

2. What is Ubuntu 24 Recovery Mode?

Recovery Mode in Ubuntu 24 is a special boot mode designed for system troubleshooting and repairs. Unlike normal startup, it boots the system with minimal features and grants administrator-level access to the shell, allowing users to resolve various issues.

This section provides an overview of Recovery Mode, its differences from normal booting, and what can be accomplished with it.

What is Recovery Mode?

Recovery Mode is a system repair boot mode accessible from Ubuntu’s GRUB menu (bootloader). Unlike normal startup, it launches only essential services, allowing users to diagnose and fix system problems.

Users may encounter the following common issues while using Ubuntu:

  • Ubuntu fails to boot after an update
  • Incorrect settings prevent the GUI (Graphical User Interface) from starting
  • Damaged software packages cause system instability
  • System files become corrupted, making normal boot impossible
  • The GRUB bootloader is corrupted, preventing system startup

In such cases, Recovery Mode can be used to repair issues that cannot be resolved through normal methods.

Differences from Normal Boot

In a normal Ubuntu boot sequence, the following steps occur:

  1. When powered on, the GRUB bootloader starts
  2. The kernel loads in normal mode
  3. Essential system services and drivers are initialized
  4. The GUI (Graphical User Interface) starts, displaying the login screen

However, the Recovery Mode process is different:

  1. Manually open the GRUB menu during boot
  2. Select Recovery Mode to load only the minimal kernel
  3. The system operates in Command Line Interface (CLI) instead of GUI
  4. A repair menu appears with options for package repair, disk checks, and more
  5. After resolving the issue, the system returns to normal boot mode

What You Can Do in Recovery Mode

Recovery Mode allows users to perform the following tasks:

1. Repair Broken Packages

  • If an error occurs during a system update, causing package corruption, you can use the dpkg option to fix it.
  • Example:
  dpkg --configure -a

2. Fix Disk Errors

  • If the file system is damaged, Ubuntu may fail to start. The fsck command can be used to check and repair errors.
  • Example:
  fsck -y /dev/sda1

3. Enable Network Connectivity

  • If network access is needed for repairs, you can enable it using the network option.

4. Repair GRUB

  • If the GRUB bootloader is damaged, it can be reinstalled from Recovery Mode.
  • Example:
  grub-install /dev/sda

5. Access the Root Shell

  • Normal startup limits root privileges, but in Recovery Mode, the root option allows direct shell access.
  • Example:
  passwd username

When Should You Use Recovery Mode?

The following table summarizes typical scenarios where Recovery Mode should be used:

SituationWhat Recovery Mode Can Do
Ubuntu fails to startRepair GRUB, reinstall the kernel
Issues after a system updateFix broken packages, roll back updates
Disk errorsUse fsck to repair the file system
Forgotten passwordReset using the root shell
Network issuesEnable network with the network option

Summary

Ubuntu’s Recovery Mode is an essential tool for system repairs and troubleshooting. Even when the system cannot start normally, it enables minimal booting to diagnose and fix issues.

3. How to Enter Recovery Mode in Ubuntu 24

The method for entering Recovery Mode in Ubuntu 24 varies slightly depending on your system’s state and boot environment (BIOS/UEFI). This section provides a detailed guide on how to open the GRUB menu, access Recovery Mode, and troubleshoot cases where GRUB does not appear.

Opening the GRUB Menu

To use Recovery Mode, you must first access the GRUB (GNU GRUB bootloader) menu.

For BIOS Systems (Legacy Boot)

  1. Turn on your PC
  2. Before the Ubuntu logo appears, hold the Shift key
  3. The GRUB menu should appear

For UEFI Systems

  1. Turn on your PC
  2. Before the Ubuntu logo appears, repeatedly press the Esc key
  3. The GRUB menu should appear

💡 Tips:

  • If the GRUB menu does not appear, try pressing Shift or Esc at different times.
  • On dual-boot systems, the OS selection screen may appear first.

Selecting Recovery Mode

Once the GRUB menu appears, follow these steps:

  1. Select “Advanced options for Ubuntu”
  • Use the arrow keys (↑↓) to navigate and press Enter.
  1. Select the Recovery Mode option
  • Example: Ubuntu, with Linux 6.5.0-XX-generic (recovery mode)
  • It is recommended to select the latest available kernel.
  1. The Recovery Mode menu will appear
  • Here, you can choose from various repair options.

Troubleshooting When the GRUB Menu Does Not Appear

Case 1: The GRUB Menu is Skipped

  • Cause: Ubuntu’s settings may have configured GRUB to display for 0 seconds.
  • Solution: Modify the GRUB settings using the following command:
sudo nano /etc/default/grub

Change GRUB_TIMEOUT=0 to GRUB_TIMEOUT=10, then save with Ctrl + XYEnter. Apply the changes:

sudo update-grub

Case 2: GRUB is Corrupted

  • Solution: Boot from an Ubuntu Live USB and reinstall GRUB.
sudo mount /dev/sdaX /mnt  # Mount the Ubuntu partition
sudo grub-install --boot-directory=/mnt/boot /dev/sda
sudo update-grub

Case 3: Windows Overwrites GRUB in a Dual-Boot System

  • Solution: Use the Boot Repair tool to restore GRUB.
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install -y boot-repair
boot-repair

4. Understanding Recovery Mode Options

Once you enter Recovery Mode, the following menu options will appear:

Option NameDescription
resumeExit Recovery Mode and boot normally
cleanRemove unnecessary packages to free disk space
dpkgRepair broken packages
fsckCheck and repair the file system
networkEnable network connectivity (for online repairs)
rootOpen a root shell for administrative operations

Summary

  • You can access Ubuntu 24 Recovery Mode through the GRUB menu.
  • Use Shift for BIOS and Esc for UEFI to open the GRUB menu.
  • If the GRUB menu does not appear, adjust GRUB settings or repair GRUB.
  • Recovery Mode offers multiple options to help troubleshoot system issues.

5. Common Troubleshooting Scenarios in Recovery Mode

This section provides practical troubleshooting steps for common issues that can be resolved using Recovery Mode.

Ubuntu 24 Won’t Boot

Symptoms:

  • The screen remains black on startup
  • Ubuntu does not appear in the boot menu on dual-boot systems
  • Error message: “Kernel Panic – not syncing: VFS”

Solution:

1. Repairing GRUB

If GRUB is corrupted, repair it from Recovery Mode.

  1. Open the GRUB menu (press Shift or Esc during boot)
  2. Select Recovery Mode, then open the root shell
  3. Run the following commands:
grub-install /dev/sda
update-grub
reboot

Summary

Recovery Mode is an essential tool for fixing common Ubuntu boot issues.

6. Important Precautions When Using Recovery Mode

While Recovery Mode is powerful, improper usage can cause severe system issues. This section explains key precautions.

Using Root Privileges Carefully

Recovery Mode allows access to the root shell, but incorrect operations can break the system.

❌ Actions to Avoid

CommandEffect
rm -rf /Deletes all files, making Ubuntu unbootable
dd if=/dev/zero of=/dev/sdaCompletely erases the hard drive

Summary

Recovery Mode is powerful but should be used cautiously. Always back up data before making major changes.

7. Frequently Asked Questions (FAQ)

This section provides answers to common questions about Ubuntu 24 Recovery Mode. If you encounter issues while using Recovery Mode, refer to this FAQ for solutions.

What to Do If You Cannot Enter Recovery Mode

Q1: The GRUB menu does not appear even when pressing Shift or Esc. What should I do?

A: The GRUB menu may be set to skip automatically. Try the following solutions:

  1. Press Shift (BIOS) or Esc (UEFI) repeatedly while booting.
  2. Once Ubuntu boots, modify the GRUB timeout settings:
sudo nano /etc/default/grub

Change GRUB_TIMEOUT=0 to GRUB_TIMEOUT=10, then save using Ctrl + XYEnter. Apply the changes:

sudo update-grub
  1. Restart the system and check if the GRUB menu appears.

What If the Keyboard or Mouse Doesn’t Work in Recovery Mode?

Q2: My keyboard does not respond in Recovery Mode.

A: Some wireless keyboards and USB devices may not be recognized in Recovery Mode.

Solutions:

  1. Use a wired USB keyboard instead of a wireless one.
  2. Check the BIOS settings:
  • Ensure “Legacy USB Support” is enabled.
  1. Try connecting the keyboard to a different USB port.

What If Recovery Mode Cannot Access the Internet?

Q3: I selected the network option, but I cannot access the internet.

A: Even after enabling network, manual configuration might be needed.

Solutions:

  1. Restart the network service:
sudo systemctl restart NetworkManager
  1. Obtain an IP address manually:
sudo dhclient
  1. For Wi-Fi, connect manually:
nmcli d wifi connect "SSID" password "your_password"

What If File System Repair Fails?

Q4: Running fsck gives an error saying “Filesystem is mounted.”

A: fsck cannot run on a mounted filesystem. Try these steps:

  1. Select root option in Recovery Mode.
  2. Remount the root filesystem as read-only:
mount -o remount,ro /
  1. Run fsck on the appropriate partition:
fsck -y /dev/sda1

What If Package Repair Fails?

Q5: The dpkg option fails to repair broken packages.

A: In cases of severe corruption, manual intervention is needed.

Solutions:

  1. Remove corrupted packages:
sudo apt remove --purge package_name
  1. Upgrade all packages:
sudo apt update && sudo apt upgrade -y
  1. Manually fix broken packages:
sudo dpkg --configure -a
sudo apt --fix-broken install

How to Reset a Forgotten Password?

Q6: I forgot my Ubuntu login password. Can I reset it?

A: Yes, you can reset your password using the root shell in Recovery Mode.

Solution:

  1. Select root option in Recovery Mode.
  2. Run the following command:
passwd username
  1. Enter the new password and confirm.
  2. Reboot the system:
reboot

8. Conclusion

Ubuntu 24’s Recovery Mode is a powerful tool for system troubleshooting and repairs. This guide has covered everything from the basics to detailed troubleshooting techniques.

Key Takeaways

1. Understanding Ubuntu 24 Recovery Mode

  • Used for troubleshooting and repairing Ubuntu systems.
  • Can fix issues like broken packages, filesystem errors, and GRUB problems.

2. How to Enter Recovery Mode

  • Use Shift (BIOS) or Esc (UEFI) to open the GRUB menu.
  • Select “Advanced options for Ubuntu” and then choose Recovery Mode.

3. Recovery Mode Options

OptionPurpose
resumeExit Recovery Mode and boot normally
cleanRemove unnecessary packages
dpkgRepair broken packages
fsckCheck and repair filesystem errors
networkEnable internet access
rootOpen a root shell for advanced repairs

Final Thoughts

By understanding how to properly use Ubuntu 24’s Recovery Mode, you can quickly resolve system issues and maintain a stable environment.

Always remember:

  • Back up your data before making major changes.
  • Use Recovery Mode options carefully, especially when running root commands.
  • Refer to this guide whenever you encounter issues with Ubuntu 24.