LinuxHigh

Linux System Recovery: A Complete Step-by-Step Guide

This guide will help you restore a Linux system after a crash. You'll learn to mount partitions, recover files from backups, and fix the GRUB bootloader.

Updated at February 17, 2026
30-60 min
Medium
FixPedia Team
Применимо к:Ubuntu 22.04 LTSDebian 12Fedora 38CentOS 7

Introduction / Why This Is Needed

Linux system recovery is the process of returning an operating system to a working state after a crash, file corruption, or bootloader errors. This guide is useful if your system won't boot, you've forgotten your password, or lost data. After completing it, you will be able to:

  • Restore the system from a backup.
  • Fix the GRUB bootloader.
  • Regain access to files via a LiveCD.
  • Reset the root password.

The instructions are suitable for Ubuntu, Debian, Fedora, CentOS, and other systemd-based distributions.

Requirements / Preparation

Before starting, ensure you have:

  1. A bootable medium (Live USB/DVD) with any Linux distribution (Ubuntu 22.04 or similar is recommended). If the system won't boot, create it on another computer.
  2. Terminal access — basic knowledge of Linux commands.
  3. A system backup (recommended) — created via tar, timeshift, or other tools. If no backup exists, file recovery will be limited.
  4. Administrator privileges (sudo) in the Live session.
  5. A list of partitions (if you remember the disk structure) — this will simplify the process.

💡 Tip: If the system partially boots, create a backup of important data before recovery to avoid information loss.

Step-by-Step Instructions

Step 1: Prepare the Bootable Medium

If the system won't boot, use another computer to create a Live USB.

  1. Download a Linux image (e.g., Ubuntu 22.04 LTS).
  2. Write the image to a USB drive (minimum 4 GB). On Linux/macOS:
    sudo dd if=ubuntu-22.04.iso of=/dev/sdX bs=4M status=progress && sync
    
    Replace sdX with your USB device (e.g., sdb). On Windows, use Rufus.
  3. Eject the medium and proceed to the next step.

Step 2: Boot from LiveCD and Identify Partitions

  1. Insert the USB into the affected computer, boot from it (boot key: F12, ESC, Del — depends on manufacturer). Select "Try Ubuntu" (or a similar option).
  2. Open the terminal (Ctrl+Alt+T).
  3. Identify disk partitions:
    sudo lsblk -f
    
    Example output:
    NAME   FSTYPE  LABEL   UUID                                 MOUNTPOINT
    sda
    ├─sda1 ext4    root    1234abcd-5678-ef90-1234-567890abcdef
    ├─sda2 swap    swap    abcd1234-5678-ef90-1234-567890abcdef [SWAP]
    └─sda3 vfat    boot    ABCD-1234                            /boot/efi
    
    Find the root partition (usually ext4, mountpoint not listed) and, if present, the /boot partition (type vfat or ext2). Note the names (e.g., sda1, sda3).

Step 3: Mount Partitions

  1. Create a mount point:
    sudo mkdir -p /mnt/root
    
  2. Mount the root partition (replace sda1 with yours):
    sudo mount /dev/sda1 /mnt/root
    
  3. If there is a separate /boot, mount it:
    sudo mount /dev/sda3 /mnt/root/boot
    
  4. For partitions requiring filesystems (e.g., /var, /home), mount them similarly under /mnt/root/var, etc.
  5. Verify mounts:
    mount | grep /mnt/root
    

    Mounted partitions should be displayed.

Step 4: Restore Files from Backup

If you have a backup, restore your data:

  • tar backup (e.g., backup.tar.gz on an external drive):
    sudo tar -xzf /path/to/backup.tar.gz -C /mnt/root
    
  • timeshift backup (if saved in /timeshift):
    sudo timeshift --restore --snapshot-days 1 --target /mnt/root
    
    Or manually copy from the /timeshift folder to /mnt/root.
  • Manual copy: if the backup is on another partition, mount it and copy files.

⚠️ Important: Ensure the backup matches your system's architecture and version. Restoring a backup from a different version may cause errors.

Step 5: Reinstall the GRUB Bootloader

If the system fails to boot due to a corrupted GRUB:

  1. Prepare the chroot environment:
    sudo mount --bind /dev /mnt/root/dev
    sudo mount --bind /proc /mnt/root/proc
    sudo mount --bind /sys /mnt/root/sys
    
  2. Enter chroot:
    sudo chroot /mnt/root
    
  3. Reinstall GRUB (replace /dev/sda with your disk, not a partition):
    grub-install /dev/sda
    update-grub
    
    For UEFI systems, also ensure the grub-efi package is installed.
  4. Exit chroot:
    exit
    

Step 6: Final Check and Reboot

  1. Unmount all partitions:
    sudo umount -R /mnt/root
    
  2. Remove the USB drive.
  3. Reboot:
    sudo reboot
    
  4. After booting, check:
    • If services are running: systemctl status.
    • If your files are accessible.
    • If the system boots without errors (review dmesg or logs in /var/log).

Verify the Result

  • Successful boot: the login screen appears.
  • File check: ensure home directories and system files are intact.
  • GRUB: the GRUB menu with a list of kernels appears during boot.
  • Network settings: if a backup was used, check ip a and /etc/resolv.conf.

If the system boots but has errors (e.g., network not working), check configuration in /etc/network/interfaces or netplan.

Possible Issues

ProblemSolution
Mount error: mount: /mnt/root: wrong fs type, bad option, bad superblockCheck the filesystem: sudo fsck /dev/sda1 in the Live session. Ensure the partition is not corrupted.
GRUB fails to install: error: cannot find a device for /bootEnsure you mounted the /boot partition (if separate). For UEFI, verify the EFI system partition (/dev/sda1 of type vfat) is mounted.
System fails to boot after recovery, hangs at initramfsThe filesystem may be corrupted. Boot with LiveCD, run fsck on the root partition. Check fstab for correct UUIDs.
No network access in Live sessionEnable networking: sudo dhclient or configure via nmcli. For network backups (e.g., NFS), install the client: sudo apt install nfs-common.
Backup restored but application doesn't workCheck dependencies: ldd /path/to/binary. Libraries may not have been included in the backup. Reinstall packages via apt --reinstall install <package>.

If the issue persists, consult specific guides on FixPedia (e.g., for recovering a particular distribution or tool).

F.A.Q.

What to do if the system doesn't boot and GRUB is not visible?
Can Linux be recovered without a pre-made backup?
How to recover the root password if forgotten?
Will system recovery take a long time?

Hints

Preparing a bootable media
Booting from LiveCD and identifying partitions
Mounting partitions
Restoring files from backup
Reinstalling the GRUB bootloader
Final check and reboot
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community