How to Rescue a Failing Linux Boot: Single‑User, GRUB & Rescue Mode Hacks
Learn step‑by‑step how to recover a Linux system that won’t boot by using single‑user mode, fixing GRUB configuration errors, and employing the Linux rescue environment, with concrete command examples for resetting root passwords, repairing disk sectors, and restoring critical configuration files.
Boot Failure Recovery Overview
Linux boot failures can be addressed using three main methods: entering single‑user (runlevel 1) mode, fixing GRUB configuration, and using the Linux rescue environment.
1. Single‑User Mode (Runlevel 1)
Single‑user mode boots the kernel with only the root filesystem mounted and networking disabled, providing a root shell for maintenance.
How to enter
At the GRUB menu press e to edit the selected entry, move to the line that starts with kernel, append a space and the word single, then press b (or Ctrl‑X) to boot. The system will stop at a root prompt.
Typical use cases
Reset forgotten root password – run passwd root and then exit to reboot.
Repair a corrupted filesystem – after the prompt type fsck -y /dev/sdaX (replace /dev/sdaX with the affected partition) and reboot with reboot.
Correct a GRUB entry typo – edit the kernel filename (e.g., change vmlinux to vmlinuz) and boot.
2. GRUB Configuration Troubleshooting
GRUB failures are usually caused by (1) incorrect options in /boot/grub/grub.conf (or its symlink /etc/grub.conf) or (2) a missing or unreadable configuration file.
Common problematic lines
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.imgEnsure the kernel line points to a valid vmlinuz file and that the root device matches the location of /boot.
When GRUB drops to the grub> prompt
Locate the partition containing grub.conf:
grub> find /boot/grub/grub.conf
Inspect the file:
grub> cat (hd0,0)/boot/grub/grub.conf
Manually boot the system:
grub> root (hd0,0) grub> kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet grub> initrd /boot/initrd-2.6.18-1.2798.fc6.img grub> boot
After a successful boot, edit grub.conf permanently to fix the typo or missing entry.
3. Linux Rescue Mode
If neither single‑user nor GRUB manual boot works, boot from a Linux installation CD/DVD/USB and choose the “Rescue” option.
Rescue workflow
At the boot prompt type linux rescue and press Enter.
Select language and keyboard layout (default us is sufficient).
The installer mounts the root filesystem under /mnt/sysimage with read‑write access.
Enter the chroot environment:
chroot /mnt/sysimage
Example: Restoring GRUB for a dual‑boot system
# grub-install /dev/sda # replace /dev/sda with the actual boot disk
# exit
# exit # leave chroot and rescue mode
# rebootExample: Recovering a missing /etc/inittab
Identify the owning RPM package:
# rpm -qf /etc/inittab
initscripts-8.45.3-1.i386Reinstall the package from the installation media (mounted at /mnt/source):
# 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/etc/Exit the chroot ( exit) and reboot.
Key Takeaways
Understanding the three recovery paths—single‑user mode, GRUB manual boot, and rescue mode—allows administrators to diagnose and fix most boot‑related problems, including forgotten passwords, filesystem corruption, and misconfigured boot loaders.
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.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
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.
