%META:TOPICINFO{author="TWikiGuest" date="1196492773" format="1.1" reprev="1.5" version="1.5"}%
<!-- PDFSTART -->

<!-- this file uses the syntax of TWiki (http://twiki.org/) -->

---+ Quick Guide to Create a !LiveBackup

This document is a step-by-step tutorial to create a !LiveBackup on your 
currentty running Linux-System. At the end of this procedure you will have
a CD/DVD image which permits you to boot the Linux-System as a !LiveCD.
this CD can be used i.e.

   * for disaster-recovery if your hardware was broken
   * to run the system on other (PC) hardware

There are a lot of features to create/configure and run a !LiveBackup. 
This tutorial goes straigth forward to explain a common use-case,
please consult the main documentation if you want to learn more about
automated installation, 64bit systems, creating customized !LiveCD's,
booting from USB-Memory-Sticks or running Linux over Network.


*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*

*!! WARNING!!! The project has a very early development status.*

*!! Be carefull !!! You should read and understand all scripts before*

*!! you execute them.*

*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*

*this document is still under development*


%TOC%


---++ Installation

Get the software from 

https://sourceforge.net/projects/livebackup 

The package is splitted into 

   * <verbatim>LiveBackup_<version>.tgz  (main scripts)</verbatim>
   * <verbatim>kernel-image_<version>.tgz  (generic linux kernel, optional) </verbatim>

If you use Debian GNU/Linux you might use the deb-package available.

The =kernel-image_&lt;version&gt;.tgz=  archive contains a compiled
vanilla Linux-kernel using generic configuration 
settings. It can be used to run !LiveBackup on a
wide range of i386 compatible hardware. 
The use of this generic kernel image is recommended for this tutorial.
If you read further, you will learn how to use other kernel's which have support 
for the filesystems you have configured on your live-system. 

For the Installation of !LiveBackup you should read =doc/INSTALL.txt=
To simplify the !LiveBackup creation process you should also copy the 
=kernel-image_&lt;version&gt;.tgz= file to its default location which is
in =/usr/share/LiveBackup/distrib=.

It is recommended to install QEMU, a generic and open source
processor emulator from http://fabrice.bellard.free.fr/qemu. With QEMU
you can test your !LiveBackup ISO image before you  burn it on blank CD/DVD.


---++ Configuration

Now we come to the most challenging part, where we need to define

   * how our !LiveCD is build 
   * which pathes to include
   * how to configure the !LiveSystem

To easy the first start with !LiveBackup there is a sample-setup included in 
=/usr/share/doc/livebackup/example/=. You should copy =Sample.cfg= 
into a file describing you system, example:

<verbatim>
cp /usr/share/doc/livebackup/examples/Sample.cfg /root/LiveBackup.cfg
</verbatim>

Please open this configuration file in a text editor and define the variables
according to their documentation comments.

There is an important configuration topic which needs some special attention! 
!LiveBack is primary intended to create a backup of your linux system. In general it is
a good idea to separate private user data from system files when you create the backup. 
Of course you could include whatever you like, but huge amount of 
data i.e. in =/home/&lt;user&gt;= directories will not help if you start with !LiveBackup for
the first time. 

Anyway, the =make_backup= script will define a minimal default file-exclusion list, but
you should prepare your own by:

<verbatim>
cp /usr/share/doc/livebackup/examples/Sample.exclude /root/LiveBackup.exclude
</verbatim>

and define the =EXCLUDE_FILE= setting in your configuration in conformity.  

Finally the configuration needs to be announced by setting 
the environment variable:

<verbatim>
  export LB_CONFIG=/root/LiveBackup.cfg
</verbatim>


---++ Checking the Prerequisites

The !LiveBackup scripts depend on a number of command-line utilities.
These utilities are included by the major Linux-Distributions anyway, but
if you are missing something it should not be hard to get them.

To verify that everything is working, please type (*as user root*):

<verbatim>
  cd /usr/lib/LiveBackup/scripts
  ./check_prerequisite.sh
</verbatim>

You will get asked to create a default master directory if it does not exists yet.
Simply answer yes and accept the default settings.

!LiveBackup tries to support a wide range of !LiveCD
technologies. Therefor you may *not* need all tools if you only want
to use default settings. To create your first LiveCD you will need:

<verbatim>
# ./check_prerequisite.sh
   OK        <path>/rsync
   OK        <path>/dd
   OK        <path>/mksquashfs
   OK        <path>/mkisofs
   OK        <path>/mkcramfs
</verbatim>


---++ Creating the !LiveBackup

All scripts need to be executed as user root in the 
=LiveBackup/scripts"  directory. A typical sequence would read like:

<verbatim>
  cd /usr/lib/LiveBackup/scripts
  ./make_backup.sh  # create a compressed squashfs system image 
[ ./make_initrd.sh  # if it not already exists, build an initial ramdisk ]
  ./make_iso.sh       # create the ISO from master-directory
</verbatim>

If you have successfully created the ISO image, it is recommended to
test the image with an emulator. If you have installed qemu, run

<verbatim>
 qemu -cdrom <iso-image>
</verbatim>

If you succeed to start your system for a second time inside the emulator, 
you could finally burn the image on a blank cdrom.  

<!-- PDFSTOP -->

---

<verbatim>
   * TWiki.GenPDFAddOn Settings
      * Set GENPDFADDON_TITLETOPIC = Rohrmoser.GenPDFTitleTopicGPL
      * Set GENPDFADDON_HEADERTOPIC = Rohrmoser.GenPDFHeaderFooter
      * Set GENPDFADDON_BANNER = Rohrmoser %ORANGE%Engineering%ENDCOLOR%
      * Set GENPDFADDON_TITLE = Howto start up with !LiveBackup
      * Set GENPDFADDON_SUBTITLE = simple step-by-step tutorial 
      * Set GENPDFADDON_HEADFOOTFONT = helvetica-bold
      * Set GENPDFADDON_FORMAT = pdf14
      * Set GENPDFADDON_PERMISSIONS = print,no-copy
      * Set GENPDFADDON_ORIENTATION = portrait
      * Set GENPDFADDON_PAGESIZE = a4
      * Set GENPDFADDON_SKIN = print.pattern
      * Set GENPDFADDON_TOCHEADER = l..
      * Set GENPDFADDON_TOCFOOTER = ..i
      * Set GENPDFADDON_NUMBEREDTOC = True
      * Set GENPDFADDON_TOCLEVELS = 5
      * Set GENPDFADDON_HEADERSHIFT = 0
      * Set GENPDFADDON_MARGINS = top:20mm,left:80pt,right:1in,bottom:5cm
      * Set GENPDFADDON_WIDTH = 1060
      * Set GENPDFADDON_LOGOIMAGE =
</verbatim>


-- Main.WolfgangRohrmoser - 2 Juni 2007

