Chapter 16. System Recovery and Repair

A system that will not boot is not necessarily a system that has lost its data. The distinction matters: a missing kernel, an unreadable /etc/fstab, a locked encryption container, a full root filesystem, and a failed package installation all present as "the machine is broken", yet each is repaired at a different layer and each carries a different risk to the data underneath. Recovery is the discipline of reaching the data and configuration from a trusted environment, preserving what is still readable, changing the smallest layer that explains the failure, and proving the result before returning the machine to service.

This chapter follows that discipline from the first symptom to the final validation. It starts with the environments available when the installed system cannot be trusted - a previous kernel, a rescue or emergency target, the installer's rescue mode, or separate live media. It then shows how to reach an installed root that is behind LVM or LUKS, how to mount it and enter it with a chroot, and how to preserve evidence before editing anything. The repair sections cover the failures administrators meet most often: fstab and crypttab mistakes, missing or stale initramfs images, a damaged GRUB installation, broken services and targets, lost administrative access, interrupted package operations, full filesystems and exhausted inodes, and deleted files that still occupy space. The chapter ends with a repeatable data volume recovery lab and with criteria for deciding when repair in place is no longer the honest choice.

The boot chain itself, kernel parameters, initramfs internals, GRUB's configuration model, and UEFI boot entries are covered in Chapter 7. Partitioning, mounts, LVM, RAID, and LUKS are covered in Chapters 11 through 13; capacity changes and migration in Chapter 14; backups and restore exercises in Chapter 15; units, targets, and the journal in Chapter 8; and packages in Chapter 6. This chapter assumes that background and concentrates on the recovery path: access, preservation, repair, and validation.

In this section