系统备份

新装了电脑,配置了一大堆东西,备份一下

种方式

  1. 制作ISO文件
  2. 制作存档文件

制作ISO文件

参考:VMWare Ubuntu 扩容


制作存档文件

参考:

BackupYourSystem/TAR

Ubuntu全盘备份与恢复,亲自总结,实测可靠

Ubuntu如何备份和恢复系统

最简单直接的就是root用户执行tar命令

$ tar -cvpzf Ubuntu-2019-01-15.tgz --one-file-system --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/media --exclude=./Ubuntu-2019-01-15.tgz /

参数解释

  • -c: create a new archive(创建一个新的档案文件)
  • -v: verbosely list files processed(详细输出)
  • -p: extract information about file permissions(default for superuser)(提取有关文件权限的信息)
  • -z: filter the archive through gzip(使用gzip工具进行压缩)
  • -f: use archive file or device ARCHIVE(结果文件名)
  • --one-file-system: stay in local file system when creating archive(仅保存本地文件系统)
  • --exclude: exclude files, given as a PATTERN(不备份的路径或文件,可使用正则表达式)

所以结果档案文件为Ubuntu-2019-01-15.tgz,不存档的路径和文件包括/proc/lost+found/mnt/sys/media,Ubuntu-2019-01-15.tgz,存档起始路径为根目录/