How to Recover a Linux System When /boot Is Missing: Step‑by‑Step Guide
This guide explains how to restore a Linux system whose /boot directory has been accidentally removed by using a KVM‑based RHEL 7 virtual machine to reinstall the kernel and GRUB2, detailing each step from simulating the failure to successfully booting the repaired system.
Introduction
The /boot directory stores the kernel, boot menu and related configuration files needed for system startup. If files in /boot are deleted or the entire directory disappears, the system cannot boot.
This article shows how to recover the system by loading a disk image and reinstalling the kernel and GRUB2 in a KVM‑based RHEL 7 environment.
Experimental Environment
KVM virtual machine running RHEL 7.
Recovery Steps
Simulate deletion of the /boot directory to make the system unbootable.
Attempt to reboot; confirm that the system fails to start.
Force the system to shut down.
Open the virtual machine’s configuration page and import a local disk‑image file.
Set the boot order to add CDROM as the first boot device.
Restart the VM and press F12 to enter the boot menu.
Enter the number 3 to boot from DVD/CD and choose “Troubleshooting”.
Select “Rescue a Red Hat Enterprise Linux system” and press Enter.
In the Rescue menu, click Continue → OK → OK .
Change the root directory to the mounted system.
Mount the CDROM to /mnt .
Configure the local repository file.
Reinstall the kernel using the reinstall command (do not use install ).
Reinstall GRUB2.
Regenerate the GRUB2 configuration file grub.cfg .
Exit the rescue environment twice and reboot; the system boots normally, confirming successful recovery.
The system is now fully restored and operational.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
