Ubuntu backup and restore

Backup: 

  1. cd /
  2. sudo tar -cvpzf /media/xxx/backup.tar.gz --exclude=/cdrom --exclude=/home --exclude=/lost+found  --exclude=/media --exclude=/mnt --exclude=/proc  --exclude=/tmp --exclude=/sys /

Restore:

  1. cd /
  2. sudo tar -zxvfp /media/xxx/backup.tar.gz -C /

Suppose you mount the  '/home' directory to a  big part of the hard-drive, and don't format that area when  re-install ubuntu(just mount '/home' there again)


你可能感兴趣的:(ubuntu)