How to Recover a Failing Linux Boot: Single‑User Mode, GRUB Fixes, and Rescue Techniques
This guide explains why Linux may fail to boot, then walks through using single‑user mode, correcting common GRUB configuration errors, and employing Linux rescue mode with concrete commands and examples to restore a broken system.
1) Single‑User Mode
Linux provides a single‑user mode (runlevel 1) similar to Windows safe mode, where the system boots into a root shell with networking disabled and only essential processes running. It is useful for fixing filesystem corruption, restoring configuration files, or moving user data.
Typical cases:
Case 1 – Forgotten root password : In many distributions (e.g., Fedora Core 6) the root password is not required at the GRUB prompt. To reset the password, edit the kernel line in GRUB, append single, boot, then run passwd root and exit to reboot.
Case 2 – Disk sector errors : After an abnormal shutdown, a damaged partition may prevent boot. At the GRUB prompt you may see "Press root password or ctrl+D:". Enter the root password to enter single‑user mode, then run fsck -y /dev/hda6 (replace the device with the actual partition) and finally reboot.
Case 3 – GRUB configuration typo : A typo such as "vmlinux" instead of "vmlinuz" in grub.conf yields "Error 15". Edit the GRUB entry, correct the filename, press b to boot, and later fix the typo in the persistent /boot/grub/grub.conf file.
2) GRUB Boot Troubleshooting
When the system drops to a grub> prompt, the most common causes are:
Incorrect options in the GRUB configuration file.
Missing or corrupted GRUB configuration file (or, less often, missing kernel or initrd images).
To diagnose, first locate the grub.conf file: grub> find /boot/grub/grub.conf Then view its contents: grub> cat (hd0,0)/boot/grub/grub.conf If a backup exists ( grub.conf.bak), compare and copy the correct lines. A minimal grub.conf entry looks like:
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-1.2798.fc6.imgKey points: title names the OS, root points to the boot partition, kernel specifies the kernel image and boot parameters, and initrd points to the initramfs.
After correcting the entries, boot with b or exit GRUB and let the system start normally.
3) Linux Rescue Mode
If neither single‑user mode nor GRUB editing restores the system, use Linux rescue mode from the installation media.
Boot from the CD/DVD, set BIOS to boot from the CD, and at the boot: prompt type linux rescue (press F5 for help).
Select language (default English), keyboard layout (default us), and choose "No" for network configuration unless required.
When prompted, let the installer mount the root partition under /mnt/sysimage. Choose the "continue" option to mount it read‑write.
Run chroot /mnt/sysimage to change the root to the mounted system.
From the chroot you can perform various repairs:
Restore a dual‑boot GRUB : grub-install /dev/hda (replace /dev/hda with the appropriate disk) then exit twice to reboot.
Recover a missing /etc/inittab : If a backup exists, copy it back. Otherwise, identify the owning RPM package with rpm -qf /etc/inittab, then reinstall the package using the installation CD:
rpm -ivh --replacepkgs --root /mnt/sysimage /mnt/source/Fedora/RPMS/initscripts-8.45.3-1.i386.rpmOr extract only the file:
rpm2cpio /mnt/source/Fedora/RPMS/initscripts-8.45.3-1.i386.rpm | cpio -idv ./etc/inittab
cp etc/inittab /mnt/sysimage/etcAfter repairs, exit the chroot ( exit) and reboot. The system should boot normally.
Understanding the Linux boot process, GRUB configuration, and rescue‑mode commands equips administrators to diagnose and fix a wide range of boot failures.
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.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
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.
