Difference between revisions of "How To Backup Your Funtoo With SystemRescueCD"

From Funtoo Linux
Jump to: navigation, search
Line 18: Line 18:
  
 
I also recommend Tar, because since it's an archive, you can burn it or move it inside an another partition or even on a USB stick.
 
I also recommend Tar, because since it's an archive, you can burn it or move it inside an another partition or even on a USB stick.
 +
 +
 +
== The TAR method ==
 +
 +
First, when I backup my box, I always use SystemRescueCD because I don't want to backup my system when it's running.
 +
 +
To do so, I use this method to backup :
 +
 +
This is the famous Stage 5.
 +
 +
<pre>
 +
  1. Boot from the LiveCD
 +
  2. mkdir /mnt/funtoo
 +
  3. mkdir /mnt/backup
 +
  4. mount /dev/sda8 /mnt/funtoo
 +
  5. mount /dev/sda7 /mnt/funtoo/boot
 +
  6. mount /dev/sda10 /mnt/backup
 +
 +
  7. cd /mnt/funtoo
 +
  8. time tar -cvvjpf /mnt/backup/stage5F20101026.tar.bz2 . 
 +
  9. time bzip2 -tv /mnt/backup/stage5F20101026.tar.bz2
 +
  10. cd /
 +
  11. umount /mnt/funtoo/boot /mnt/funtoo /mnt/backup
 +
</pre>
 +
 +
I use this method to restore :
 +
 +
<pre>
 +
  1. Boot from the LiveCD
 +
  2. mkdir /mnt/rescue
 +
  3. mkdir /mnt/funtoo/
 +
  4. cd /mnt/funtoo
 +
  5. mkdir boot
 +
 
 +
  6. mkfs.ext4 /dev/sda7
 +
  7. mkfs.ext4 /dev/sda8
 +
 +
  8. cd /
 +
  9. mount /dev/sda10 /mnt/rescue
 +
  10. mount /dev/sda8  /mnt/funtoo
 +
  11. mount /dev/sda7  /mnt/funtoo/boot
 +
 +
  12. cd /mnt/rescue/
 +
  13 time tar xvjpf stage5F20101026.tar.bz2 -C /mnt/funtoo/
 +
 +
  14. cd /
 +
  15. umount /mnt/rescue /mnt/funtoo/boot /mnt/funtoo
 +
  16. Reboot my box and I'm good to go :P
 +
</pre>
 +
 +
== The Rsync method ==
 +
 +
I use this method to backup :
 +
 +
<pre>
 +
  1. Boot from the LiveCD
 +
  2. mkdir /mnt/funtoo
 +
  3. mkdir /mnt/backup
 +
 +
  4. mount /dev/sda8 /mnt/funtoo
 +
  5. mount /dev/sda7 /mnt/funtoo/boot
 +
  6. mount /dev/sda10 /mnt/backup
 +
 +
  7. time rsync -aHA --del --force --stats --progress /mnt/funtoo /mnt/backup
 +
 +
  8. cd /mnt/backup
 +
  9. ls -la
 +
 +
  10. cd /
 +
  11. umount /mnt/funtoo/boot /mnt/funtoo /mnt/backup
 +
 +
</pre>
 +
 +
I use this method to restore :
 +
 +
<pre>
 +
  1. Boot from the LiveCD
 +
  2. mkdir /mnt/rescue
 +
  3. mkdir /mnt/funtoo/
 +
  4. cd /mnt/funtoo
 +
  5. mkdir boot
 +
 +
  6. mkfs.ext4 /dev/sda7
 +
  7. mkfs.ext4 /dev/sda8
 +
 +
  8. cd /
 +
  9. mount /dev/sda8 /mnt/funtoo
 +
  10. mount /dev/sda7 /mnt/funtoo/boot
 +
  11. mount /dev/sda10 /mnt/rescue
 +
 +
  12. time rsync -aHA --del --force --stats --progress /mnt/rescue/funtoo/ /mnt/funtoo
 +
 +
  13. cd /mnt/funtoo
 +
  14. ls -la
 +
 +
  15. cd /
 +
  16. umount /mnt/funtoo/boot /mnt/funtoo /mnt/rescue
 +
</pre>
 +
 +
== The Rsync method + daily snapshot ==
 +
 +
I use this method to backup :
 +
 +
<pre>
 +
  1. Boot from the LiveCD
 +
  2. mkdir /mnt/funtoo
 +
  3. mkdir /mnt/backup
 +
 +
  4. mount /dev/sda8 /mnt/funtoo
 +
  5. mount /dev/sda7 /mnt/funtoo/boot
 +
  6. mount /dev/sda10 /mnt/backup
 +
 +
  7. time rsync -aHA --del --force --stats --progress /mnt/funtoo /mnt/backup/current
 +
 +
  8. cd /mnt/backup/current
 +
  9. ls -la
 +
  10. cd /
 +
  11. cp -al /mnt/backup/current /mnt/backup/snap-20101026
 +
  12. umount /mnt/funtoo/boot /mnt/funtoo /mnt/backup
 +
</pre>
 +
 +
This method is really great, since all the files that didn't change will have a hardlink to it, so basically the size of the snap-20101026 will be really small if the rsync didn't change that much files between your last snapshot.
 +
 +
But, the downside, is that instead of using a lot of spaces, it will use a lot of Inodes, so be careful to check your inode status on the backup partition.
 +
 +
That's it :P

Revision as of 03:46, 11 November 2010

Contents

How To Backup Your Funtoo With SystemRescueCD

With this little Wiki, you will be able to backup your Funtoo box in no time.

You will learn how to do it using 3 methods.

  • TAR
  • Rsync
  • Rsync + daily snapshot

Why backup your box

Because we can have some major hardware problems and a good backup can save a lot of time too.

Why using Tar or Rsync

One of the main reason I use Rsync, it's because it's fast and you can make a snapshot in no time and it's pretty awesome since you can hardlink your daily snapshot to save a lot of backup space.

I also recommend Tar, because since it's an archive, you can burn it or move it inside an another partition or even on a USB stick.


The TAR method

First, when I backup my box, I always use SystemRescueCD because I don't want to backup my system when it's running.

To do so, I use this method to backup :

This is the famous Stage 5.

   1. Boot from the LiveCD
   2. mkdir /mnt/funtoo
   3. mkdir /mnt/backup
   4. mount /dev/sda8 /mnt/funtoo
   5. mount /dev/sda7 /mnt/funtoo/boot
   6. mount /dev/sda10 /mnt/backup

   7. cd /mnt/funtoo
   8. time tar -cvvjpf /mnt/backup/stage5F20101026.tar.bz2 .  
   9. time bzip2 -tv /mnt/backup/stage5F20101026.tar.bz2 
  10. cd /
  11. umount /mnt/funtoo/boot /mnt/funtoo /mnt/backup

I use this method to restore :

   1. Boot from the LiveCD
   2. mkdir /mnt/rescue
   3. mkdir /mnt/funtoo/
   4. cd /mnt/funtoo
   5. mkdir boot 
  
   6. mkfs.ext4 /dev/sda7
   7. mkfs.ext4 /dev/sda8 

   8. cd /
   9. mount /dev/sda10 /mnt/rescue
  10. mount /dev/sda8  /mnt/funtoo
  11. mount /dev/sda7  /mnt/funtoo/boot 

  12. cd /mnt/rescue/
  13 time tar xvjpf stage5F20101026.tar.bz2 -C /mnt/funtoo/ 

  14. cd /
  15. umount /mnt/rescue /mnt/funtoo/boot /mnt/funtoo
  16. Reboot my box and I'm good to go :P

The Rsync method

I use this method to backup :

   1. Boot from the LiveCD
   2. mkdir /mnt/funtoo
   3. mkdir /mnt/backup 

   4. mount /dev/sda8 /mnt/funtoo
   5. mount /dev/sda7 /mnt/funtoo/boot
   6. mount /dev/sda10 /mnt/backup 

   7. time rsync -aHA --del --force --stats --progress /mnt/funtoo /mnt/backup 

   8. cd /mnt/backup
   9. ls -la 

   10. cd /
   11. umount /mnt/funtoo/boot /mnt/funtoo /mnt/backup 

I use this method to restore :

   1. Boot from the LiveCD
   2. mkdir /mnt/rescue 
   3. mkdir /mnt/funtoo/ 
   4. cd /mnt/funtoo 
   5. mkdir boot 

   6. mkfs.ext4 /dev/sda7
   7. mkfs.ext4 /dev/sda8 

   8. cd /
   9. mount /dev/sda8 /mnt/funtoo
  10. mount /dev/sda7 /mnt/funtoo/boot
  11. mount /dev/sda10 /mnt/rescue 

  12. time rsync -aHA --del --force --stats --progress /mnt/rescue/funtoo/ /mnt/funtoo 

  13. cd /mnt/funtoo
  14. ls -la 

  15. cd /
  16. umount /mnt/funtoo/boot /mnt/funtoo /mnt/rescue 

The Rsync method + daily snapshot

I use this method to backup :

   1. Boot from the LiveCD
   2. mkdir /mnt/funtoo
   3. mkdir /mnt/backup 

   4. mount /dev/sda8 /mnt/funtoo
   5. mount /dev/sda7 /mnt/funtoo/boot
   6. mount /dev/sda10 /mnt/backup 

   7. time rsync -aHA --del --force --stats --progress /mnt/funtoo /mnt/backup/current 

   8. cd /mnt/backup/current
   9. ls -la 
  10. cd /
  11. cp -al /mnt/backup/current /mnt/backup/snap-20101026
  12. umount /mnt/funtoo/boot /mnt/funtoo /mnt/backup 

This method is really great, since all the files that didn't change will have a hardlink to it, so basically the size of the snap-20101026 will be really small if the rsync didn't change that much files between your last snapshot.

But, the downside, is that instead of using a lot of spaces, it will use a lot of Inodes, so be careful to check your inode status on the backup partition.

That's it :P

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff