How to Rescue a Broken Linux System Using a Boot Disk
This guide explains how to use a Linux rescue (boot/root) disk set to mount damaged filesystems, repair corrupted superblocks, recover lost files, fix broken libraries, reset root passwords, and restore an unbootable system, including commands and step‑by‑step procedures.
Using a Rescue Disk for System Maintenance
A rescue disk set (also called a boot/root disk set) consists of two floppy disks: the second disk contains a complete Linux system with its root filesystem, while the first disk holds a bootable kernel. Booting from these disks places you in rescue mode as the root user.
Mounting the Hard‑Drive Filesystem
After booting, you must manually mount the hard‑drive partitions to access their files. For example, to mount an ext2 filesystem on /dev/hda2 to /mnt: # mount -t ext2 /dev/hda2 /mnt Note that the root directory you see initially is the rescue disk’s root; once the hard‑drive filesystem is mounted, its files appear under /mnt (e.g., the original /etc/passwd becomes /mnt/etc/passwd).
Handling Corrupted Filesystems
If the filesystem is damaged, use the appropriate fsck utility. For ext2 filesystems, run e2fsck from a floppy. Avoid mounting the filesystem before checking it.
When the superblock is corrupted, the filesystem may become unrecognizable. Ext2 stores backup superblocks in each block group; you can tell e2fsck to use a backup with: # e2fsck -b 8193 The -b 8193 option directs the tool to use the backup located at block 8193.
Recovering Lost Files
If an important file such as /bin/login has been deleted, you can copy it from the rescue disk to the mounted hard‑drive filesystem: # cp -a /bin/login /mnt/bin The -a flag preserves permissions. This method works only if the needed file exists on the rescue disk; otherwise, a prior backup is required.
Fixing Damaged Library Files
When system libraries or symbolic links in /lib are broken, commands that depend on them will fail. The simplest fix is to boot with the rescue disk, mount the hard‑drive filesystem to /mnt, and replace or restore the files under /mnt/lib.
Resolving Root Login Failures
If the root password is forgotten or has been altered by an attacker, edit the mounted password file. For systems using /etc/passwd, clear the password field: root::0:0:root:/root:bin/bash For shadow‑based systems, perform the same edit on /etc/shadow. After rebooting, you can log in as root without a password and then set a new one with passwd.
Recovering an Unbootable Linux System
When the MBR has been overwritten (e.g., by installing another OS), the Linux bootloader (LILO) is lost. With a rescue disk, reinstall LILO to the MBR and reboot.
If no rescue disk is available, you can boot Linux from DOS using loadlin together with the kernel image ( vmlinuz) and the root partition: loadlin vmlinuz root=/dev/hda8 After gaining root access, run lilo to rewrite the bootloader, restoring the previous multi‑OS configuration.
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.
