How to Recover a Failing Linux Boot: Single‑User Mode, GRUB Fixes & Rescue Techniques
This guide explains common Linux boot failures and provides step‑by‑step solutions using single‑user mode, GRUB command‑line edits, and the Linux rescue environment to repair root passwords, disk errors, GRUB configuration mistakes, and missing system files.
I discovered that Linux systems can encounter various boot‑time faults and compiled several practical cases covering single‑user mode, GRUB command operations, and Linux rescue mode to help readers troubleshoot these issues.
Single‑User Mode
Linux’s single‑user mode (runlevel 1) boots into a minimal environment with a root shell, no network, and only essential processes, useful for repairing damaged filesystems, restoring configuration files, or moving user data.
Case 1: Forgotten root password
1. When the boot screen appears, press any key to enter the GRUB menu. 2. Press e to edit the GRUB entry, move to the kernel line and append single at the end. 3. Press b to boot; the system will start in single‑user mode. Change the password with # passwd root , then # exit to reboot.
Case 2: Hard‑disk sector errors
If the disk has bad sectors (often caused by sudden power loss), the boot process may stop with a prompt such as “Press root password or ctrl+D”. After entering the root password, run: <code>fsck -y /dev/hda6</code> The -y option automatically fixes detected errors. Reboot with # reboot when finished.
Case 3: GRUB option error (Error 15)
When GRUB cannot find the kernel specified in grub.conf , edit the entry, correct the typo (e.g., change vmlinux to vmlinuz ), save, and boot again.
GRUB Boot Troubleshooting
Sometimes the system drops directly to a grub> prompt. The two most common causes are a mis‑configured grub.conf or a missing configuration file.
1. Locate the /boot/grub/grub.conf file: <code>GRUB> find /boot/grub/grub.conf (hd0,0)</code> 2. View its contents: <code>GRUB> cat (hd0,0)/boot/grub/grub.conf</code> 3. Edit the file to fix errors, then reinstall GRUB if necessary: <code>grub-install /dev/hda</code>
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 boot menu entry, root points to the /boot partition, kernel specifies the kernel image and boot parameters, and initrd points to the initial RAM disk.
Linux Rescue Mode
If neither single‑user mode nor GRUB editing can restore the system, boot into rescue mode from installation media.
1. Insert the Linux installation CD/DVD, set BIOS to boot from CD, and at the boot prompt type linux rescue (press F5 for more info). 2. Choose language (default English), keyboard layout (default us ), and skip network configuration unless needed. 3. The installer mounts the root filesystem under /mnt/sysimage . Choose “continue” for read‑write access. 4. Run # chroot /mnt/sysimage to work inside the installed system.
Typical rescue tasks include resetting a forgotten root password, reinstalling GRUB, or restoring missing configuration files such as /etc/inittab or /boot/grub/grub.conf. If a backup exists, copy it back; otherwise, reinstall the owning RPM package:
# rpm -ivh --replacepkgs --root /mnt/sysimage /mnt/source/Fedora/RPMS/initscripts-8.45.3-1.i386.rpmWhen only the file is needed, extract it with rpm2cpio:
# rpm2cpio /mnt/source/Fedora/RPMS/initscripts-8.45.3-1.i386.rpm | cpio -idv ./etc/inittab
# cp etc/inittab /mnt/sysimage/etc/After fixing the issues, exit the chroot environment ( # exit twice) and reboot. Understanding the Linux boot process and GRUB workflow greatly simplifies troubleshooting.
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.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
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.
