Difference between pages "Funtoo Linux Installation" and "Rsync Backup"

(Difference between pages)
 
(Mount partitions)
 
Line 1: Line 1:
<div class="container"><div class="row"><div class="col-sm-12 col-md-9">
+
== Introduction ==
== Introduction ==
+
This tutorial leads you through the process of backing up and restoring your OS. This process is completed using the <code>rsync</code> tool that is included in SystemRescueCd.
  
This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration.  
+
== Why SystemRescueCd? ==
 +
The usage of SystemRescueCD is quite simple: it enables us to backup the contents of our entire OS.
  
These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that frequently replaces the older MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the [[UEFI Install Guide]], which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The [[UEFI Install Guide]] has more information on this, and steps on how to determine if your system supports UEFI.
+
== Backing Up ==
 +
=== Preparation ===
 +
By default, SystemRescueCd provides a <tt>/mnt/backup</tt> mount point. We will use this. There is no mount point for Funtoo. We have to create one:
 +
<console>
 +
###i## install -d /mnt/funtoo
 +
</console>
 +
When you use SystemRescueCd to backup you OS for the first time, you also have to create mount points for additional partitions. In this tutorial we assume that there is a <tt>/boot</tt> and a <tt>/home</tt> partition. Create the directories in <tt>/mnt/funtoo</tt>:
 +
<console>
 +
###i## install -d /mnt/funtoo/boot
 +
###i## install -d /mnt/funtoo/home
 +
</console>
 +
We also assume that we are backing up a sytem to an external drive. Plug in the USB device and power it on.
 +
<console>###i## cat /proc/partitions
 +
major minor  #blocks  name 
 +
8        0  488386584 sda
 +
8        1    512000 sda1
 +
8        2      32768 sda2 
 +
8        3    2097152 sda3 
 +
8        4  52428800 sda4 
 +
8        5  433314823 sda5 
 +
8        16  488386584 sdb
 +
11        0    1048575 sr0 
 +
8      48  488386584 sdd 
 +
8      49  229032928 sdd1 
 +
8      52          1 sdd4 
 +
8      53  259352576 sdd5
 +
</console>
  
We also offer a [[ZFS Install Guide]], which augment the instructions on this page for those who want to install Funtoo Linux on ZFS. If you are installing Funtoo Linux on [[Funtoo Linux Installation on ARM|ARM]] architecture, please see [[Funtoo Linux Installation on ARM]] for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for [[Funtoo Linux Installation on SPARC|SPARC]] platforms. See [[Funtoo Linux Installation on SPARC]].
+
The above command helps you to determine the device name. Lets's suppose that your backup device is <tt>/dev/sdd1</tt>. Mount the device now - along with your Funtoo partitions.
 +
<console>
 +
###i## mount /dev/sdd1 /mnt/backup
 +
###i## mount /dev/sda4 /mnt/funtoo
 +
###i## mount /dev/sda5 /mnt/funtoo/home
 +
###i## mount /dev/sda1 /mnt/funtoo/boot
 +
</console>
  
New  [[F2FS Install Guide]] is in progress  which will augment the instructions on this page for those who want to install Funtoo Linux on F2FS.
+
=== Backup ===
 +
Now, we backup our Funtoo partition:
 +
<console>
 +
###i## rsync -aHA --del --force --stats --progress /mnt/funtoo /mnt/backup
 +
</console>
  
If you've had previous experience installing Gentoo Linux then a lot of steps will be familiar, but you should still read through as there are a few differences.
+
=== Snapshot ===
 +
Once this command has completed, you can create a snapshot. Create a snapshot folder if there is none:
 +
<console>
 +
###i## install -d /mnt/backup/snapshot
 +
</console>
 +
Give your snapshot copy a name that includes the date. Therefore, you may keep as many snapshot copies as you want and use one of those copies to restore your system to its state at any given date:
 +
<console>
 +
###i## cp -al /mnt/backup/funtoo /mnt/backup/snaphot/snap-2K014B26-a
 +
</console>
 +
{{fancynote| In our example, the name of the snapshot tells us that it was created on February 26th (B26) 2014 and it is the first one (a) made on that date. }}
  
== Installation Overview ==
 
  
This is a basic overview of the Funtoo installation process:
+
=== Log of backups ===
 +
Logging backups is not mandatory but can be useful. Create a log file and add a descriptive, yet short record for each of your backup. Here is an example:
 +
<pre>
 +
Date                File                  Description
 +
-----------------    --------------------  ----------------------------------------------------------
 +
Feb 26th 2014        snap-2K014B26-a      Backup after system update :                                          
 +
                                            - New kernel installed
 +
</pre>
  
# [[#Live CD|Download and boot the live CD of your choice]].
 
# [[#Prepare Hard Disk|Prepare your disk]].
 
# [[#Creating filesystems|Create]] and [[#Mounting filesystems|mount]] filesystems.
 
# [[#Installing the Stage 3 tarball|Install the Funtoo stage tarball]] of your choice.
 
# [[#Chroot into Funtoo|Chroot into your new system]].
 
# [[#Downloading the Portage tree|Download the Portage tree]].
 
# [[#Configuring your system|Configure your system]] and [[#Configuring your network|network]].
 
# [[#Configuring and installing the Linux kernel|Install a kernel]].
 
# [[#Installing a Bootloader|Install a bootloader]].
 
# [[#Finishing Steps|Complete final steps]].
 
# [[#Restart your system|Reboot and enjoy]].
 
  
=== Live CD ===
+
== Restoring ==
 +
First, you have to boot your PC with SystemRescueCd. Next, create and format partitions as per [[Funtoo_Linux_Installation#Prepare_Hard_Disk|installation guide]].
 +
For the sake of brevity, we assume that we are restoring the <tt>/boot</tt>, <tt>/</tt> and <tt>/home</tt> partitions. First, you must create a mount point for Funtoo:
 +
<console>
 +
###i## install -d /mnt/funtoo
 +
</console>
  
Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based [http://www.sysresccd.org/ System Rescue CD] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems. For a generation 2 Hyper-V system, the [http://www.ubuntu.com/ Ubuntu] desktop install DVD as of version 14.04.1 works well enough. Gentoo CDs don't support EFI boot, and the System Rescue CD lacks appropriate graphics support for Hyper-V as of version 4.4.0.
 
  
It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See [[Requirements|requirements]] for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.
+
=== Mount partitions ===
 +
<console>
 +
###i## mount /dev/sdd1 /mnt/backup
 +
###i## mount /dev/sda4 /mnt/funtoo
 +
###i## mount /dev/sda5 /mnt/home
 +
###i## mount /dev/sda1 /mnt/boot
 +
</console>
 +
{{fancywarning|If <tt>/home</tt> and <tt>/boot</tt> fail to mount, simply create the appropriate mount points and run the mount commands again.}}
  
To begin a Funtoo Linux installation, download System Rescue CD from:
+
=== Restoring from latest backup ===
 +
<console>
 +
###i## rsync -aHA --del --force --stats --progress /mnt/backup/funtoo/ /mnt/funtoo
 +
</console>
 +
{{fancynote| The <tt>/</tt> at the end of <code>/mnt/backup/funtoo/</code> is mandatory -- not a typo.}}
  
{{MirrorList}}
 
  
Or, use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of System Rescue CD, '''be sure to select the <code>rescue64</code> kernel at the boot menu if you are installing a 64-bit system'''. By default, System Rescue CD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.
+
=== Restoring from a previous backup ===
 +
<console>
 +
###i## rsync -aHA --del --force --stats --progress /mnt/backup/snapshot/snap-2K014B26-a/ /mnt/funtoo
 +
</console>
 +
{{fancynote| The '''<tt>/</tt>''' at the end of <code>/mnt/backup/snapshot/snap-2K014B26-a/</code> is mandatory -- not a typo.}}
 +
 
 +
 
 +
=== Restoring GRUB2 ===
 +
Once the system has been restored, GRUB2 must be reinstalled. The example below is for a GRUB/Bios partition schema. This assumes that the Funtoo partitions were created on <tt>/dev/sda</tt>:
 +
<console>
 +
###i## cd /mnt/funtoo
 +
###i## mount -t proc none proc
 +
###i## mount -o bind /dev dev
 +
###i## mount -o bind /sys sys
 +
###i## swapon /dev/sda3
 +
###i## cp /etc/resolv.conf etc
 +
###i## env -i HOME=/root TERM=$TERM chroot . bash -l
 +
###i## grub-install /dev/sda
 +
</console>
 +
{{fancywarning|If, for some reason, the partitions were not created on the same devices -- (let's say they were moved from <tt>/dev/sda</tt> to <tt>/dev/sdb</tt>) -- please amend <code>/etc/boot.conf</code> and <code>/etc/fstab</code> accordingly before running <code>boot-update</code>.}}
 +
<console>
 +
###i## boot-update
 +
</console>
 +
You're done. Unmount partitions and reboot.
 +
 
 +
 
 +
== Credit ==
 +
This is an as-is translation by Guy Fontaine (AKA Aramis_qc) of an original French tutorial written by Sylvain Alain (AKA d2_racing). Some parts were reviewed and modified to reflect Funtoo GNU/Linux instead of Gentoo GNU/Linux.  
  
{{:Install/Partitioning}}
 
{{:Install/Stage3}}
 
{{:Install/Chroot}}
 
{{:Install/PortageTree}}
 
{{:Install/Configuring}}
 
{{:Install/Portage}}
 
{{:Install/Kernel}}
 
{{:Install/BootLoader}}
 
{{:Install/Network}}
 
{{:Install/Finish}}
 
{{:Install/Profiles}}
 
{{:Install/NextSteps}}
 
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]
[[Category:Install]]
+
[[Category:First Steps]]
[[Category:Official Documentation]]
+
</div><div class="col-md-3 col-hidden-sm col-hidden-xs"><div id="tocwrap" >
+
__TOC__
+
</div></div></div>
+

Latest revision as of 05:43, November 12, 2014

Introduction

This tutorial leads you through the process of backing up and restoring your OS. This process is completed using the rsync tool that is included in SystemRescueCd.

Why SystemRescueCd?

The usage of SystemRescueCD is quite simple: it enables us to backup the contents of our entire OS.

Backing Up

Preparation

By default, SystemRescueCd provides a /mnt/backup mount point. We will use this. There is no mount point for Funtoo. We have to create one:

# install -d /mnt/funtoo

When you use SystemRescueCd to backup you OS for the first time, you also have to create mount points for additional partitions. In this tutorial we assume that there is a /boot and a /home partition. Create the directories in /mnt/funtoo:

# install -d /mnt/funtoo/boot
# install -d /mnt/funtoo/home

We also assume that we are backing up a sytem to an external drive. Plug in the USB device and power it on.

# cat /proc/partitions
major minor  #blocks  name  
 8        0  488386584 sda 
 8        1     512000 sda1 
 8        2      32768 sda2  
 8        3    2097152 sda3  
 8        4   52428800 sda4  
 8        5  433314823 sda5  
 8        16  488386584 sdb 
 11        0    1048575 sr0  
 8       48  488386584 sdd   
 8       49  229032928 sdd1  
 8       52          1 sdd4  
 8       53  259352576 sdd5

The above command helps you to determine the device name. Lets's suppose that your backup device is /dev/sdd1. Mount the device now - along with your Funtoo partitions.

# mount /dev/sdd1 /mnt/backup
# mount /dev/sda4 /mnt/funtoo
# mount /dev/sda5 /mnt/funtoo/home
# mount /dev/sda1 /mnt/funtoo/boot

Backup

Now, we backup our Funtoo partition:

# rsync -aHA --del --force --stats --progress /mnt/funtoo /mnt/backup

Snapshot

Once this command has completed, you can create a snapshot. Create a snapshot folder if there is none:

# install -d /mnt/backup/snapshot

Give your snapshot copy a name that includes the date. Therefore, you may keep as many snapshot copies as you want and use one of those copies to restore your system to its state at any given date:

# cp -al /mnt/backup/funtoo /mnt/backup/snaphot/snap-2K014B26-a

Note

In our example, the name of the snapshot tells us that it was created on February 26th (B26) 2014 and it is the first one (a) made on that date. 


Log of backups

Logging backups is not mandatory but can be useful. Create a log file and add a descriptive, yet short record for each of your backup. Here is an example:

Date                 File                  Description
-----------------    --------------------  ----------------------------------------------------------
Feb 26th 2014        snap-2K014B26-a       Backup after system update :                                            
                                             - New kernel installed


Restoring

First, you have to boot your PC with SystemRescueCd. Next, create and format partitions as per installation guide. For the sake of brevity, we assume that we are restoring the /boot, / and /home partitions. First, you must create a mount point for Funtoo:

# install -d /mnt/funtoo


Mount partitions

# mount /dev/sdd1 /mnt/backup
# mount /dev/sda4 /mnt/funtoo
# mount /dev/sda5 /mnt/home
# mount /dev/sda1 /mnt/boot

Warning

If /home and /boot fail to mount, simply create the appropriate mount points and run the mount commands again.

Restoring from latest backup

# rsync -aHA --del --force --stats --progress /mnt/backup/funtoo/ /mnt/funtoo

Note

The / at the end of /mnt/backup/funtoo/ is mandatory -- not a typo.


Restoring from a previous backup

# rsync -aHA --del --force --stats --progress /mnt/backup/snapshot/snap-2K014B26-a/ /mnt/funtoo

Note

The / at the end of /mnt/backup/snapshot/snap-2K014B26-a/ is mandatory -- not a typo.


Restoring GRUB2

Once the system has been restored, GRUB2 must be reinstalled. The example below is for a GRUB/Bios partition schema. This assumes that the Funtoo partitions were created on /dev/sda:

# cd /mnt/funtoo
# mount -t proc none proc
# mount -o bind /dev dev
# mount -o bind /sys sys
# swapon /dev/sda3
# cp /etc/resolv.conf etc
# env -i HOME=/root TERM=$TERM chroot . bash -l
# grub-install /dev/sda

Warning

If, for some reason, the partitions were not created on the same devices -- (let's say they were moved from /dev/sda to /dev/sdb) -- please amend /etc/boot.conf and /etc/fstab accordingly before running boot-update.

# boot-update

You're done. Unmount partitions and reboot.


Credit

This is an as-is translation by Guy Fontaine (AKA Aramis_qc) of an original French tutorial written by Sylvain Alain (AKA d2_racing). Some parts were reviewed and modified to reflect Funtoo GNU/Linux instead of Gentoo GNU/Linux.