Skip to content

Instantly share code, notes, and snippets.

@wongsyrone
Created August 7, 2018 05:52
Show Gist options
  • Save wongsyrone/3c53d91365cc0686e6a8cbd10e391e20 to your computer and use it in GitHub Desktop.
Save wongsyrone/3c53d91365cc0686e6a8cbd10e391e20 to your computer and use it in GitHub Desktop.
两台电脑均从救援/备用系统启动,并挂掉原/新根目录到 /mnt。联网并在旧系统启动 sshd,然后:
```
rsync -aviHAXKh --partial --delete old_computer:/mnt /mnt
```
然后装引导、写引导配置,改 /etc/fstab,重启。
@wongsyrone
Copy link
Author

我用 rsync -aAXvP
通过网络传的话可以带 -z 开压缩.

开个exclude文件把不应该备份的目录剔除就可以了. 举例:
/proc/*
/dev/*
/sys/*
/tmp/*
/mnt/*
/media/*
/run/*
/var/lock/*
/var/run/*
/var/lib/pacman/*
/var/cache/pacman/pkg/*
/lost+found

我一直用这个方法定期备份整个/, 还可以用这个备份轻易起一个新的机器用 (只需要chroot进去改fstab(因为我用UUID)和装一下grub)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment