Linux System Recovery - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux System Recovery Guide
Complete beginner-friendly guide to system recovery on Linux, covering Arch Linux, CachyOS, and other distributions including chroot, boot repair, recovery procedures, and data recovery.
Table of Contents
Chroot into System
Boot from Live USB
Boot from ISO:
- Boot from Linux ISO (Arch/CachyOS)
- Mount partitions
- Chroot into system
Mount Partitions
Mount system:
# Mount root
mount /dev/sda2 /mnt
# Mount EFI (if UEFI)
mount /dev/sda1 /mnt/boot/efi
# Mount other partitions
mount /dev/sda3 /mnt/home
Chroot
Enter chroot:
# Arch/CachyOS
arch-chroot /mnt
# Or manual chroot
chroot /mnt /bin/bash
CachyOS note: CachyOS provides cachy-chroot tool. See CachyOS Cachy Chroot Guide for details.
Boot Repair
Reinstall Bootloader
GRUB:
# Chroot first
arch-chroot /mnt
# Reinstall GRUB
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
# Regenerate config
grub-mkconfig -o /boot/grub/grub.cfg
systemd-boot:
# Chroot
arch-chroot /mnt
# Reinstall
bootctl install
# Update entries
bootctl update
Rebuild Initramfs
Rebuild:
# Chroot
arch-chroot /mnt
# Rebuild
mkinitcpio -P
Recovery Procedures
Fix Broken Packages
Fix packages:
# Chroot
arch-chroot /mnt
# Fix packages
pacman -Syu
# Reinstall broken
pacman -S package-name
Restore from Backup
Restore:
# Mount backup
mount /dev/backup-device /mnt/backup
# Restore files
rsync -av /mnt/backup/home/ /mnt/home/
Data Recovery
TestDisk
Install TestDisk:
# Install TestDisk
sudo pacman -S testdisk
# Launch
sudo testdisk
PhotoRec
Install PhotoRec:
# Install PhotoRec
sudo pacman -S testdisk
# Launch
sudo photorec
Troubleshooting
Cannot Chroot
Check mounts:
# Check mounts
mount | grep /mnt
# Mount required filesystems
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
Summary
This guide covered system recovery for Arch Linux, CachyOS, and other distributions, including chroot, boot repair, and data recovery.
Next Steps
- Backup and Restore - Backup setup
- Bootloader Configuration - Bootloader setup
- CachyOS Cachy Chroot Guide - CachyOS chroot tool
- ArchWiki System Recovery: https://wiki.archlinux.org/title/Installation_guide#Chroot
This guide covers Arch Linux, CachyOS, and other Linux distributions. CachyOS-specific tools are highlighted where applicable.