-
-
Notifications
You must be signed in to change notification settings - Fork 2
Arch Linux Backup and Restore
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to backing up and restoring your Arch Linux system, including file backups, system backups, automated backups, and restore procedures.
Important data:
- Home directory (
/home) - Configuration files (
/etc) - Package lists
- System data
Types:
- Full backup: Entire system
- Incremental: Changes only
- File-level: Individual files
- Image backup: Disk image
Install rsync:
# Install rsync
sudo pacman -S rsync
# Backup home directory
rsync -av --exclude='.cache' ~/ /backup/home/
# Restore
rsync -av /backup/home/ ~/Create archive:
# Backup home
tar -czf backup-home-$(date +%Y%m%d).tar.gz ~/
# Backup system
sudo tar -czf backup-system.tar.gz --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/run --exclude=/tmp /Extract archive:
# Extract
tar -xzf backup-home-20240115.tar.gz
# To specific location
tar -xzf backup-home-20240115.tar.gz -C /restore/pathInstall Clonezilla:
# Download ISO from clonezilla.org
# Boot from ISO
# Follow wizardDisk image:
# Create image
sudo dd if=/dev/sda of=/backup/system.img bs=4M status=progress
# Restore
sudo dd if=/backup/system.img of=/dev/sda bs=4M status=progress** Warning**: dd can destroy data if used incorrectly!
Install Timeshift:
# Install Timeshift
yay -S timeshift
# Create snapshot
sudo timeshift --create
# List snapshots
sudo timeshift --listSetup cron:
# Edit crontab
crontab -eExample:
# Daily backup at 2 AM
0 2 * * * rsync -av ~/ /backup/home/
# Weekly full backup
0 3 * * 0 tar -czf /backup/weekly-$(date +\%Y\%m\%d).tar.gz ~/
Create timer:
# Create service
sudo vim /etc/systemd/system/backup.serviceService file:
[Unit]
Description=Backup Service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh
Create timer:
sudo vim /etc/systemd/system/backup.timerTimer file:
[Unit]
Description=Backup Timer
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
Enable:
sudo systemctl enable backup.timer
sudo systemctl start backup.timerFrom rsync:
# Restore
rsync -av /backup/home/ ~/From tar:
# Extract
tar -xzf backup.tar.gz -C /From image:
# Boot from live USB
# Mount partitions
# Restore image
sudo dd if=backup.img of=/dev/sdaFrom Clonezilla:
# Boot Clonezilla
# Select restore
# Choose image
# Follow wizardInstall Borg:
# Install Borg
sudo pacman -S borg
# Create repository
borg init /backup/repo
# Create backup
borg create /backup/repo::archive-{now} ~/
# List archives
borg list /backup/repoInstall Restic:
# Install Restic
sudo pacman -S restic
# Initialize
restic init --repo /backup/repo
# Backup
restic backup ~/
# List snapshots
restic snapshotsInstall Duplicity:
# Install Duplicity
sudo pacman -S duplicity
# Backup
duplicity ~/ file:///backup/home
# Restore
duplicity restore file:///backup/home ~/restoreThis guide covered:
- Backup strategies - Planning backups
- File backups - rsync, tar
- System backups - Clonezilla, dd
- Automated backups - Cron, systemd
- Restore - Restore procedures
- Tools - Borg, Restic, Duplicity
Key Takeaways:
- Backup regularly
- Test restores
- Use automation
- Store backups off-site
- Document procedures
- Arch Linux System Configuration - System setup
- Arch Linux Filesystem Management - Filesystems
- ArchWiki Backup: https://wiki.archlinux.org/title/Backup_programs
This guide is based on the ArchWiki. For the most up-to-date information, always refer to the official ArchWiki.