Backup Gentoo System

方法1
There are too many ways to backup Gentoo/Linux system.
here is my way to do it…

 

Backup
just simply to mount Gentoo partition to /mnt/gentoo

tar czpivf /Your/Destination/Disk/Gentoo-backup.tar.gz –exclude=sys –exclude=proc –exclude=var/tmp –exclude=mnt –exclude=media –exclude=lost+found –exclude=usr/portage/distfiles –exclude=home/olo/.vmware (–exclude=Gentoo-backup.tgz) .

make sure you added “.” at the end of the command line otherwise you’re gonna see the following error
tar: Cowardly refusing to create an empty archive
Try `tar –help’ or `tar –usage’ for more information.

Resore
tar -xvpfz Gentoo-backup.tgz -C / or

tar -zxcf /mnt/gentoo/Gentoo-backup.tgz

 

————————-

方法2 复制硬盘

dd if=/dev/sda1 of=/dev/sdb1 (if是source就是源盘, of就是要复制到的那个盘)

e2fsck -f /dev/sd1

resize2fs /dev/sda1 (下面这两个命令是因为如果dd完成后你会发现即使你的新分区大于以前的旧分区,复制到的那个盘也不认多余的空间,所以用这两个命令)

——————————–

方法3

rsync -av –exclude=xxx /dev/sda1 /dev/sdb1

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s