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

From Funtoo Linux
Jump to: navigation, search
(The Rsync method + daily snapshot)
(The Rsync method + daily snapshot)
Line 161: Line 161:
 
   11. mount /dev/sda10 /mnt/rescue  
 
   11. mount /dev/sda10 /mnt/rescue  
  
   12. time rsync -aHA --del --force --stats --progress /mnt/rescue/funtoo/ /mnt/funtoo  
+
   12. time rsync -aHA --del --force --stats --progress /mnt/rescue/funtoo/snap-20101026/ /mnt/funtoo  
  
 
   13. cd /mnt/funtoo
 
   13. cd /mnt/funtoo

Revision as of 04:15, 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.

Also, make sure to backup your box on an another HDD too and if you can use an external USB HDD just to be sure.

Why using Tar or Rsync

One of the main reasons I use Rsync, it's because it's fast and you can make a snapshot in no time.

There's also a cool stuff about rsync is that you can hardlink your daily snapshot to your current rsync backup and it will save a lot of backup space.

In that case, your daily snapshot will only use the space of your diff from that day.

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. You can use Bzip2 or LZMA to compress your archive too.

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 

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/snap-20101026/ /mnt/funtoo 

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

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


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

French version

If you want the French version, you can go here :

funtoo-quebec:Sauvegarde_Rsync_avec_SystemRescueCD

funtoo-quebec:Sauvegarde_stage5_avec_SystemRescueCD

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff