Operations 14 min read

Master Linux Boot Failures: Single‑User Mode, GRUB Fixes, and Rescue Mode Guide

This article walks you through common Linux boot problems—recovering a forgotten root password with single‑user mode, fixing GRUB configuration errors, and using Linux rescue mode to repair critical system files—providing step‑by‑step commands and practical examples for effective troubleshooting.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Linux Boot Failures: Single‑User Mode, GRUB Fixes, and Rescue Mode Guide

Single‑User Mode

Linux offers 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 is useful for repairing file‑system damage, restoring configuration files, or moving user data.

Case 1: Forgotten root password

1. During boot, press any key to access the GRUB menu. 2. Press e to edit the GRUB entry, move to the kernel line, and append single at the end. 3. Press Enter to return, then b to boot; the system enters single‑user mode. 4. Change the root password with passwd root , then exit to reboot.

Other typical uses of single‑user mode include disabling problematic services (e.g., chkconfig smb off) and changing the default runlevel by editing /etc/inittab (e.g., setting id:3:initdefault: to boot into multi‑user mode without X).

GRUB Boot Troubleshooting

Common GRUB issues arise from incorrect configuration options or missing configuration files. Two typical scenarios are addressed below.

Case 2: Hard‑disk sector errors

When the system displays Press root password or ctrl+D: , enter the root password to drop into single‑user mode, then run: fsck -y /dev/hda6 After the file‑system check completes, reboot with reboot .

Case 3: GRUB configuration typo (Error 15)

If the kernel line mistakenly references vmlinux instead of vmlinuz , the boot loader cannot find the kernel. Press any key to return to the GRUB edit screen, correct the typo, press b to boot, and later fix the typo permanently in /boot/grub/grub.conf .

When GRUB drops to the grub> prompt, the following steps can recover a missing or corrupted grub.conf:

1. Locate the partition containing grub.conf : grub> find /boot/grub/grub.conf (hd0,0) 2. View the file: grub> cat (hd0,0)/boot/grub/grub.conf 3. If a backup exists ( grub.conf.bak ), compare and copy the correct version. 4. Manually specify the boot parameters: root (hd0,0) kernel /boot/vmlinuz-... ro root=LABEL=/ rhgb quiet initrd /boot/initrd-...img Use the TAB key for command completion.

Linux Rescue Mode

If neither single‑user mode nor GRUB editing resolves the boot problem, Linux rescue mode can be used to repair the system.

Rescue Procedure

1. Boot from a Linux installation CD/DVD, select “linux rescue” at the boot: prompt. 2. Choose language (default English), keyboard layout (default us ), and optionally skip network configuration. 3. The installer mounts the root partition under /mnt/sysimage . Choose “continue” for read‑write access. 4. Run chroot /mnt/sysimage to switch the root to the installed system.

Case 1: Restoring dual‑boot GRUB after Windows overwrites MBR

After entering rescue mode, execute: chroot /mnt/sysimage grub-install /dev/hda Then exit twice with exit and reboot.

Case 2: Recovering a missing /etc/inittab file

If a backup exists, copy it back: cp /etc/inittab.bak /etc/inittab If no backup, identify the owning RPM package: rpm -qf /etc/inittab Mount the installation media (e.g., mount /dev/hdc /mnt/source ) and reinstall the package with: rpm -ivh --replacepkgs --root /mnt/sysimage /mnt/source/Fedora/RPMS/initscripts-8.45.3-1.i386.rpm Alternatively, extract the file directly: rpm2cpio /mnt/source/Fedora/RPMS/initscripts-8.45.3-1.i386.rpm | cpio -idv ./etc/inittab cp etc/inittab /mnt/sysimage/etc

Understanding Linux’s boot process and mastering these recovery techniques enables efficient diagnosis and resolution of system start‑up failures.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

OperationsLinuxtroubleshootingbootGRUBrescue-modesingle-user-mode
MaGe Linux Operations
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.