How to Rescue a Failing Linux Boot: Single‑User, GRUB & Rescue Mode Hacks
This article walks through practical Linux boot recovery techniques, covering single‑user mode for password resets and service disabling, GRUB configuration fixes for common errors, and step‑by‑step use of rescue mode to restore critical system files and regain a functional system.
1) Single‑User Mode
Linux provides a single‑user mode (runlevel 1) similar to Windows safe mode, booting directly to a root shell with networking disabled and only essential processes running. It can be used to repair file‑system damage, restore configuration files, move user data, etc.
Case 1: Forgotten root password
In many distributions (e.g., Fedora Core 6) the root password is not required to enter single‑user mode. To reset the password:
During boot, press any key to display the GRUB menu.
Press e to edit the selected entry, move to the kernel line and append single at the end.
Press b to boot; the system will drop to a sh-3.1# prompt where you can run passwd root.
After changing the password, type exit to reboot.
Other useful single‑user tasks include disabling problematic services (e.g., chkconfig smb off) or changing the default runlevel by editing /etc/inittab and setting id:3:initdefault:.
Case 2: Disk sector corruption
Power loss or improper shutdown can cause bad sectors. The boot screen may display “Press root password or ctrl+D:”. Enter the root password to drop into single‑user mode and run: fsck -y /dev/hda6 Replace /dev/hda6 with the appropriate partition. After the check completes, reboot with reboot.
Case 3: GRUB configuration error (Error 15)
If the kernel filename is mistyped (e.g., vmlinux instead of vmlinuz), GRUB cannot find the kernel and drops to the grub> prompt. Fix by:
At the grub> prompt, locate the grub.conf file: find /boot/grub/grub.conf (hd0,0).
Inspect the file: cat (hd0,0)/boot/grub/grub.conf (or a backup grub.conf.bak).
Manually boot by specifying the root, kernel, and initrd lines, then press b.
After the system boots, edit /boot/grub/grub.conf to correct the typo.
2) GRUB Boot Troubleshooting
When a system boots directly to the grub> prompt, the most common causes are a mis‑configured grub.conf or a missing configuration file. The grub.conf file resides at /boot/grub/grub.conf (often symlinked from /etc/grub.conf).
A typical 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.imgThe title defines the menu entry, root points to the /boot partition, kernel specifies the kernel path and parameters, and initrd points to the initial RAM disk.
3) Linux Rescue Mode
If neither single‑user mode nor GRUB commands can restore the system, boot into rescue mode using the installation media:
Boot from the CD/DVD, select “linux rescue” at the boot: prompt.
Choose language (default English) and keyboard layout (default us).
Allow the installer to mount the root filesystem under /mnt/sysimage with read‑write access.
Run chroot /mnt/sysimage to work inside the installed system.
Common rescue tasks include restoring a missing /etc/inittab from a backup, reinstalling the RPM package that provides it, or extracting the file from the installation media:
rpm -qf /etc/inittab
rpm -ivh --replacepkgs --root /mnt/sysimage /mnt/source/Fedora/RPMS/initscripts-8.45.3-1.i386.rpm
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 and reboot. Understanding the Linux boot process and the tools above enables effective diagnosis and recovery of boot‑related 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.
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.
