How to Use Ubuntu 24 Recovery Mode: Complete Guide to System Repair, GRUB Fixes, and Troubleshooting Methods

目次

1. Introduction

Ubuntu is widely used as a simple and user-friendly Linux distribution. However, due to system updates or configuration changes, there are cases where Ubuntu suddenly fails to boot. In such situations, it is important to use the Recovery Mode feature to repair the system.

Recovery Mode is a special startup mode that allows the system to boot with minimal functionality. Even if the system becomes unbootable due to corrupted components or incorrect settings, you can still perform repair tasks.

What Is Recovery Mode?

Ubuntu Recovery Mode is a special troubleshooting environment accessed through GRUB (GNU GRand Unified Bootloader). Unlike normal booting, it loads with minimal resources and grants administrative shell access for repairs.

In Recovery Mode, you can perform the following tasks:

  • Repair corrupted system files
  • Repair or reinstall packages
  • Check and fix 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. It covers the following topics in detail:

  1. What is Recovery Mode in Ubuntu 24?
  2. How to enter Recovery Mode in Ubuntu 24
  3. Explanation of Recovery Mode options
  4. Practical troubleshooting examples
  5. Precautions when using Recovery Mode
  6. Frequently Asked Questions (FAQ)

This article aims to help Ubuntu users resolve system issues effectively by using Recovery Mode.

2. What Is Recovery Mode in Ubuntu 24?

The Recovery Mode in Ubuntu 24 is a specialized boot environment designed for system troubleshooting and repairs. Unlike the regular boot sequence, it starts the system with minimal functions and provides shell access with administrative privileges, making it possible to resolve various system issues.

This section explains the overview of Recovery Mode, how it differs from normal booting, and what tasks can be performed with it.

What Is Recovery Mode?

Recovery Mode is a system repair boot option accessible from the Ubuntu GRUB menu. Instead of loading all services, it starts only essential components, allowing you to identify and repair system problems.

Common scenarios where Recovery Mode becomes useful include:

  • Ubuntu fails to boot after an update
  • Incorrect settings prevent the GUI from launching
  • Package issues cause malfunctioning applications
  • Damaged system files prevent normal booting
  • GRUB (bootloader) corruption prevents the OS from loading

By using Recovery Mode, you can resolve problems that cannot be fixed through a normal boot process.

Differences Between Normal Boot and Recovery Mode

Normally, Ubuntu boots through the following steps:

  1. The bootloader (GRUB) starts when powering on the PC
  2. The system loads the kernel in normal mode
  3. Required system services and drivers are loaded
  4. The GUI launches and displays the login screen

However, Recovery Mode operates differently:

  1. Manually open the GRUB menu when powering on
  2. Select Recovery Mode, which loads a minimal kernel
  3. Boot without launching the GUI, using a CLI-based interface
  4. Display a repair-oriented menu (package repair, disk check, etc.)
  5. Return to normal boot after resolving issues

What You Can Do in Recovery Mode

Recovery Mode offers the following capabilities:

1. Repair broken packages

  • If package corruption occurs during updates, you can repair them using dpkg.
  • Example:
  dpkg --configure -a

2. Fix disk errors

  • If the file system is damaged and Ubuntu cannot boot, use fsck to repair disk errors.
  • Example:
  fsck -y /dev/sda1

3. Enable network support

  • Use the network option when repairs require internet access.

4. Repair GRUB

  • If the bootloader is corrupted, reinstall GRUB from Recovery Mode.
  • Example:
  grub-install /dev/sda

5. Access a root shell

  • Unlike normal booting, Recovery Mode grants direct access to a root shell via the root option.
  • Example:
  passwd username

When Should You Use Recovery Mode?

Below are common situations where Recovery Mode is recommended:

SituationWhat You Can Do
Ubuntu won’t bootRepair GRUB or reinstall kernel
After updates cause issuesRepair packages or roll back updates
Disk errors detectedRepair with fsck
Forgot passwordReset via root shell
No network availableEnable via network option

Summary

Recovery Mode in Ubuntu is an essential troubleshooting feature. Even if normal booting fails, it lets you start the system with minimal components, identify problems, and fix them efficiently.

3. How to Enter Recovery Mode in Ubuntu 24

The process of entering Recovery Mode in Ubuntu 24 varies slightly depending on the system state and whether the machine uses BIOS or UEFI boot. This section explains how to open the GRUB menu, access Recovery Mode, and what to do if the GRUB menu does not appear.

Opening the GRUB Menu

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

For BIOS (Legacy Boot) Systems

  1. Power on the PC
  2. Before the Ubuntu logo appears, hold down the Shift key
  3. The GRUB menu will be displayed

For UEFI Systems

  1. Power on the PC
  2. Press the Esc key repeatedly before the Ubuntu logo appears
  3. The GRUB menu will be displayed

💡 Tips:

  • If the GRUB menu does not appear, adjust the timing when pressing Shift or Esc.
  • In dual-boot environments, an OS selection screen may appear instead of GRUB.

Selecting Recovery Mode

Once the GRUB menu appears, follow these steps:

  1. Select “Advanced options for Ubuntu”
  • Use the ↑ and ↓ arrow keys to select it and press Enter.
  1. Select a Recovery Mode kernel
  • Example: Ubuntu, with Linux 6.5.0-XX-generic (recovery mode)
  • Selecting the newest kernel is recommended.
  1. The Recovery Mode menu will be displayed
  • Choose the required repair options from the displayed list.

What to Do if the GRUB Menu Does Not Appear

Case 1: The GRUB menu is skipped automatically

  • Cause: The GRUB timeout may be set to zero.
  • Solution: Modify GRUB settings.
sudo nano /etc/default/grub

Change GRub_TIMEOUT=0 to GRUB_TIMEOUT=10, then save (Ctrl + XYEnter) and apply:

sudo update-grub

Case 2: GRUB is corrupted

  • Solution: Boot with a 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: In dual-boot systems, Windows overwrote GRUB

  • 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

Recovery Mode Options Overview

Once inside Recovery Mode, you will see options such as:

OptionDescription
resumeExit Recovery Mode and resume normal boot
cleanFree disk space by removing unnecessary packages
dpkgRepair broken packages
fsckCheck and repair file system errors
networkEnable network access for online repairs
rootOpen a root shell for advanced repairs

Summary

  • Recovery Mode is accessed from the Ubuntu GRUB menu
  • Use Shift on BIOS systems and Esc on UEFI systems
  • If GRUB does not appear, modify settings or repair GRUB
  • Recovery Mode provides multiple repair options for system issues

4. Detailed Explanation of Each Recovery Mode Option

Ubuntu 24 provides several Recovery Mode options designed to repair different types of system problems. This section explains each option and shows how to use them effectively.

Overview of Recovery Mode Menu

The Recovery Mode menu contains the following options:

OptionDescription
resumeExit Recovery Mode and boot normally
cleanRemove unnecessary packages and reclaim disk space
dpkgRepair damaged packages
fsckScan and repair file system errors
networkEnable the network for online repair tasks
rootOpen a root shell with administrator privileges

Let’s look at each option in detail.

resume (Boot Normally)

Overview

This option exits Recovery Mode and boots Ubuntu normally. Use this after finishing repair operations or when the system no longer requires recovery mode access.

How to Use

  1. Select resume from the Recovery Mode menu
  2. Press Enter and follow the on-screen instructions
  3. Ubuntu will boot normally

clean (Free Disk Space)

Overview

This option removes unnecessary packages to increase available disk space. If the disk becomes full, Ubuntu can behave unpredictably, making this option important in low-storage scenarios.

How to Use

  1. Select clean and press Enter
  2. Ubuntu removes cached and old packages automatically
  3. Select resume to return to normal boot

Check disk usage manually:

df -h

Check directory sizes:

du -sh /*

Remove unused packages:

sudo apt autoremove

dpkg (Repair Broken Packages)

Overview

The dpkg option uses Ubuntu’s package manager to repair corrupted packages. This is useful when errors occur during updates and packages become unusable.

How to Use

  1. Select dpkg and press Enter
  2. Ubuntu scans for damaged packages and attempts automatic repair
  3. Select resume to boot normally after repairs

Manual package repair commands:

sudo dpkg --configure -a
sudo apt --fix-broken install

fsck (Repair File System)

Overview

The fsck (File System Check) command detects and repairs file system errors. This is useful when the cause of boot failure is a disk error.

How to Use

  1. Select fsck and press Enter
  2. Ubuntu scans and fixes file system issues
  3. Select resume when complete

Manual file system repair:

  1. Choose root from the Recovery Mode menu
  2. Run the following command (example for /dev/sda1):
fsck -y /dev/sda1
  1. Type exit and reboot

network (Enable Network Access)

Overview

This option enables the network interface even while in Recovery Mode. It is essential when downloading packages, updating repositories, or performing online troubleshooting.

How to Use

  1. Select network and press Enter
  2. The system activates the network connection
  3. After activation, you can use commands that require internet access

Restart the network manually:

sudo systemctl restart NetworkManager

root (Open a Root Shell)

Overview

This option opens a shell session with root privileges. It is used for advanced repairs such as resetting passwords, modifying configuration files, reinstalling GRUB, or repairing packages that cannot be fixed automatically.

How to Use

  1. Select root and press Enter
  2. Access the command line with administrator privileges
  3. Execute the required commands, then exit the shell with exit

Examples of advanced operations:

  • Reset a user password:
passwd username
  • Repair GRub:
grub-install /dev/sda
update-grub

Summary

Ubuntu 24 offers a variety of recovery options. Understanding how each option works enables you to perform repairs efficiently and safely.

5. Practical Troubleshooting Examples Using Recovery Mode

Ubuntu 24 includes several powerful tools within Recovery Mode to fix system boot issues, repair damaged packages, and correct file system errors. This section walks through step-by-step troubleshooting procedures for common problems.

Case 1: Ubuntu Does Not Boot

Symptoms

  • A black screen appears during startup
  • GRUB does not appear and Windows boots directly in dual-boot systems
  • Error message: “Kernel Panic – not syncing: VFS”

Solution

1. Repair GRUB

GRUB may be corrupted. Use Recovery Mode to reinstall it.

  1. Open the GRUB menu (Shift or Esc during boot)
  2. Select Recovery Mode and choose the root option
  3. Run the following commands:
grub-install /dev/sda
update-grub
reboot
  1. Restart and verify whether GRUB appears
2. Repair the Kernel

If the latest kernel is damaged, boot with an older one:

  1. Select Advanced options for Ubuntu from GRUB
  2. Select an older kernel version
  3. Reinstall the kernel:
sudo apt update
sudo apt reinstall linux-generic

Case 2: Ubuntu Fails Due to Insufficient Disk Space

Symptoms

  • Error message: “No space left on device”
  • The GUI does not launch

Solution

1. Remove Unnecessary Packages
  1. Select clean from Recovery Mode
  2. Remove unnecessary logs or files manually:
du -sh /*
rm -rf /var/log/*
2. Delete Temporary Files
rm -rf ~/.cache/*
rm -rf /tmp/*

Case 3: Damaged Ubuntu Packages

Symptoms

  • apt-get and dpkg commands return errors
  • Applications stop working after system updates

Solution

1. Repair Packages
  1. Select dpkg in Recovery Mode
  2. Perform manual repair if necessary:
sudo dpkg --configure -a
sudo apt --fix-broken install
2. Reinstall Packages
sudo apt reinstall $(dpkg --list | awk '/^rc/ { print $2 }')

Case 4: Network Cannot Be Used

Symptoms

  • Ethernet/Wi-Fi does not work
  • Network configuration files are corrupted

Solution

1. Enable the Network

Select network in Recovery Mode.

2. Restart Network Services
sudo systemctl restart NetworkManager
3. Reinstall Network Drivers
sudo apt update
sudo apt install --reinstall network-manager

Case 5: GRUB Boot Entries Are Broken

Symptoms

  • Ubuntu no longer appears in the boot list
  • Only Windows boots in a dual-boot setup

Solution

1. Use Boot Repair
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install -y boot-repair
boot-repair
2. Modify GRUB Configuration
sudo nano /etc/default/grub
GRUB_TIMEOUT=10
update-grub

Case 6: Forgot the Root Password

Symptoms

  • Unable to perform administrative tasks
  • sudo does not work without a password

Solution

  1. Select root in Recovery Mode
  2. Reset the password:
passwd username
  1. Restart the system:
reboot

Summary

With Ubuntu 24 Recovery Mode, you can resolve a wide range of problems efficiently. Understanding these procedures allows you to restore your system without reinstalling Ubuntu.

6. Precautions When Using Recovery Mode

While Recovery Mode in Ubuntu 24 is extremely useful for troubleshooting and repairing system issues, incorrect operations may cause severe system damage. This section explains important points to consider before making changes.

Cautions When Using Root Privileges

Recovery Mode grants access to a root shell, but incorrect commands may corrupt or destroy the operating system. Extreme care is required.

❌ Dangerous Commands You Should Never Run

CommandImpact
rm -rf /Deletes all system data, making Ubuntu unbootable
dd if=/dev/zero of=/dev/sdaErases the entire disk
chmod 000 /etc/shadowPrevents all users from logging into the system
mv /bin /bin_backupRemoves essential binaries, breaking shell access

✅ Safe Usage Guidelines

  1. Understand what each command does before executing it
  2. Use ls or cat to verify files before modifying them
  3. When possible, use sudo instead of full root operations
  4. Create backups before making major changes

The Importance of Backups Before Making Changes

Recovery Mode is designed to modify critical parts of the system. Incorrect modifications may prevent Ubuntu from booting. Therefore, backing up important files is strongly recommended.

Backup Methods

1. Copy Important Data Manually

Open a root shell and copy files to external storage:

cp -r /home/username/Documents /mnt/usb/
2. Create a Full System Snapshot with Timeshift
sudo apt install timeshift
sudo timeshift --create --comments "Before Recovery Mode"

Precautions When Working with Disks

Disk and partition modifications should be done carefully. Using fsck on the wrong device may cause irreversible damage.

Steps to Work Safely

  1. Check partition info
lsblk
  1. Repair file system (example for /dev/sda1)
fsck -y /dev/sda1

Precautions When Enabling Network Access

Enabling the network in root mode poses security risks. Only connect to trusted networks and avoid unknown scripts.

Best Practices

  1. Do not modify Wi-Fi passwords or configuration files unnecessarily
  2. Use secure and trusted networks
  3. Never install unknown scripts from the internet
curl http://example.com/install.sh | sh  # Do NOT run this!

Precautions When Repairing GRUB

Incorrect GRUB configuration may cause both Ubuntu and Windows to stop booting.

Best Practices

  1. Specify the correct disk, not a partition
grub-install /dev/sda  # Correct
# NOT /dev/sda1
  1. Run update-grub after making changes
sudo update-grub
  1. Do not delete Windows Boot Manager in dual-boot environments

Precautions When Resetting a Password

Changing the root password may modify privilege groups. Some users may lose sudo access if not configured properly.

Best Practices

  1. Select root in Recovery Mode
  2. Reset the password:
passwd username
  1. Add the user back to the sudo group (if necessary):
usermod -aG sudo username

Summary

RiskPrecaution
Misuse of root permissionsCommands may destroy the system if used improperly
No backups before changesAlways create backups before modifying critical files
Misuse during file system repairsVerify device names before running fsck
Incorrect GRUB repairsSpecify /dev/sda and update GRUB afterwards
Unsafe network operationsAvoid running unknown scripts
Password reset issuesEnsure the user remains in the sudo group

7. Frequently Asked Questions (FAQ)

This section provides answers to common questions related to Ubuntu 24 Recovery Mode. If you encounter any problems, refer to this FAQ first.

Unable to Enter Recovery Mode

Q1: Pressing Shift or Esc doesn’t display the GRUB menu. What should I do?

A: The GRUB timeout may be too short. Modify settings as follows:

  1. Press Shift (BIOS) or Esc (UEFI) repeatedly during boot
  2. Change GRUB timeout:
sudo nano /etc/default/grub

Replace GRUB_TIMEOUT=0 with:

GRUB_TIMEOUT=10
  1. Apply changes:
sudo update-grub
  1. Reboot and test again

Keyboard or Mouse Not Working

Q2: My keyboard doesn’t work in Recovery Mode. Why?

A: Some wireless keyboards are not recognized in early boot stages.

Solutions:

  1. Try a wired USB keyboard
  2. Enable “USB Legacy Support” in BIOS
  3. Try another USB port

Network Not Working

Q3: The network won’t connect even after selecting network.

A: Some configurations require manual activation.

  1. Restart the network:
sudo systemctl restart NetworkManager
  1. Request an IP address:
sudo dhclient
  1. Connect to Wi-Fi manually:
nmcli d wifi connect "SSID" password "PASSWORD"

File System Repair Fails

Q4: fsck says the file system is mounted. What now?

A: Remount it as read-only:

mount -o remount,ro /
fsck -y /dev/sda1

Package Repair Problems

Q5: dpkg still errors out. What should I try?

A: Remove problematic packages:

sudo apt remove --purge packagename

Then update packages:

sudo apt update && sudo apt upgrade -y

GRUB Repair Not Working

Q6: Running grub-install doesn’t fix GRUB. Why?

  1. Verify disk layout:
lsblk
  1. Install GRUB to the EFI partition:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu

Password Reset Issues

Q7: Can I reset a forgotten password using Recovery Mode?

A: Yes. Use root in Recovery Mode:

passwd username

Summary

With the correct commands and procedures, Recovery Mode allows you to fix almost any Ubuntu boot or configuration issue.

8. Conclusion

Recovery Mode in Ubuntu 24 is a powerful diagnostic and repair tool. This guide has covered the fundamentals, how to access Recovery Mode, detailed explanations of each option, specific repair examples, FAQs, and best practices.

Key Takeaways

  • Recovery Mode provides essential repair tools such as dpkg, fsck, and GRUB restoration
  • Access via Shift (BIOS) or Esc (UEFI)
  • Use different options for different problems—package repair, file system validation, GRUB fixes, and more
  • Backups are critical before modifying core system components

Recommended Troubleshooting Flow

  1. Open the GRUB menu → select Advanced options for Ubuntu
  2. Select the appropriate Recovery Mode option
  3. Perform repairs and reboot
reboot

Alternative Solutions

  • Use a Live USB for GRUB or disk repair if Recovery Mode fails
  • Reinstall Ubuntu if the system is beyond repair
  • Create regular backups using tools like Timeshift

Final Thoughts

By understanding and properly using Recovery Mode, you can solve most Ubuntu system issues without reinstalling the operating system. With careful steps and backups, Ubuntu 24 can remain a stable and reliable environment for both everyday users and professionals.

侍エンジニア塾