
#include "bacula_template.inc" title="Getting Started" num=3

<h1>Getting Started with Bacula</h1>

If you are like me, you want to get Bacula running
immediately to get a feel for it, then later you want
to go back and read about all the details.  This
chapter attempts to accomplish just that: get you
going quickly without all the details. If you want to
skip the section on Pools, Volumes and Labels, you can
always come back to it, but please read to the end
of this chapter, and in particular follow the instructions
for testing your tape drive.

<h2><a name="SupportedOSes">Supported Operating Systems</a></h2>
<ul type="disc">
  <li>Linux systems (built and tested on RedHat Enterprise Linux 3.0).</li>
  <li>If you have a recent Red Hat Linux system running the 2.4.x kernel
      and you have the directory <b>/lib/tls</b> installed on your
      system (normally by default), bacula will <b>NOT</b> run.  This is
      the new pthreads library and it is defective.  You must remove
      this directory prior to running Bacula, or you can simply change
      the name to <b>/lib/tls-broken</b>) then you must reboot your
      machine (one of the few times Linux must be rebooted).</b></li>
  <li>Most flavors of Linux (Gentoo, SuSE, Mandrake, Debian, ...).</li>
  <li>Solaris various versions.</li>
  <li>FreeBSD (tape driver supported in 1.30 -- please see some
      <b>important</b> considerations in the <a
      href="tapetesting.html#FreeBSDTapes"> Tape Modes on FreeBSD</a>
      section of the Tape Testing chapter of this manual.)</li>
  <li>Windows (Win95/98/Me, WinNT/2K/XP) Client (File daemon) binaries.</li>
  <li>MacOS X/Darwin (see <a href="http://fink.sourceforge.net/">
      http://fink.sourceforge.net/</a> for obtaining the packages)</li>
  <li>OpenBSD Client (File daemon).</li>
  <li>Irix Client (File daemon).</li>
  <li>Bacula is said to work on other systems (AIX, BSDI, HPUX,
      ...) but we do not have first hand knowledge
      of these systems.</li>
  <li>See the <a href="porting.html">Porting</a> Chapter of this
      manual for information on porting to other systems.</li>
</ul>

<h2>System Requirements</h2>
<ul type="disc">
<li><b>Bacula</b> has been compiled and run on Linux RedHat, FreeBSD,
    and Solaris systems.</li>
<li>It requires GNU C++ version 2.95 or higher to compile.  You can try
    with other compilers and older versions, but you are on your own.
    We have successfully compiled and used Bacula on RH8.0/RH9/RHEL 3.0
    with GCC 3.2.  Note, in general GNU C++ is a separate package (e.g.
    RPM) from GNU C, so you need them both loaded.  On RedHat systems,
    the C++ compiler is part of the <b>gcc-c++</b> rpm package.  </li>

<li>There are certain third party packages that Bacula needs.
    Except for MySQL and PostgreSQL, they can all be found in the
    <b>depkgs</b> and <b>depkgs1</b> releases.</li>

<li>If you want to build the Win32 binaries, you will need a
    Microsoft Visual C++ compiler (or Visual Studio).
    Although all components build (console has
    some warnings), only the File daemon has been tested. </li>

<li><b>Bacula</b> requires a good implementation of pthreads to work.
    This is not the case on some of the BSD systems.</li>  

<li>The source code has been written with portability in mind and is
    mostly POSIX compatible.  Thus porting to any POSIX compatible
    operating system should be relatively easy.</li>

<li>The GNOME Console program is developed and tested under GNOME 2.x. It
    also run under GNOME 1.4 but this version is deprecated and 
    thus no longer maintained.</li>

<li>If you want to enable command line editing and history, you will
    need to have /usr/include/termcap.h and either the termcap or the
    ncurses library loaded (libtermcap-devel or ncurses-devel).</li>
</ul>

<h2><a name="SupportedDrives">Supported Tape Drives</a></h2>
Even if your drive is on the list below,
please check the <a href="tapetesting.html#btape">Tape Testing Chapter</a> of this
manual for procedures that you can use to verify if your tape drive
will work with Bacula. If your drive is in fixed block mode, it
may appear to work with Bacula until you attempt to do a restore
and Bacula wants to position the tape. You can be sure only
by following the procedures suggested above and testing.
<p>
It is very difficult to supply a list of supported tape drives,
or drives that are known to work with Bacula because of limited
feedback (so if you use Bacula on a different drive, please let
us know).  Based on user feedback, the following drives are known to
work with Bacula. A dash in a column means unknown:
<p>
<table cellspacing="2" cellpadding="2" border="3">
<tr> <th>OS</th> <th>Man.</th> <th>Media</th> <th>Model</th> <th>Capacity/th> </tr>
<tr> <td>-</td> <td>ADIC</td> <td>DLT</td>  <td>Adic Scalar 100 DLT</td> <td>100GB</td></tr>
<tr> <td>-</td> <td>ADIC</td> <td>DLT</td>  <td>Adic Fastor 22 DLT</td> <td>-</td></tr>
<tr> <td>-</td> <td>-</td> <td>DDS</td>  <td>Compaq DDS 2,3,4</td> <td>-</td></tr>
<tr> <td>-</td> <td>Exabyte</td> <td>-</td>    <td>Exabyte drives less than 10 years old</td> <td>-</td></tr>
<tr> <td>-</td> <td>Exabyte</td> <td>-</td>    <td>Exabyte VXA drives</td> <td>-</td></tr>
<tr> <td>-</td> <td>HP</td> <td>Travan 4</td>  <td>Colorado T4000S</td> <td>-</td></tr>
<tr> <td>-</td> <td>HP</td> <td>DLT</td>  <td>HP DLT drives</td> <td>-</td></tr>
<tr> <td>-</td> <td>HP</td> <td>LTO</td>  <td>HP LTO Ultrium drives</td> <td>-</td></tr>
<tr> <td>-</td> <td>HP</td> <td>DDS-2</td>  <td>HP SureStore 6000 and DAT8 DDS (DAT2)</td> <td>-</td></tr>
<tr> <td>-</td> <td>Overland</td> <td>LTO</td>  <td>LoaderXpress LTO</td> <td>-</td></tr>
<tr> <td>-</td> <td>Overland</td> <td>-</td>  <td>Neo2000</td> <td>-</td></tr>
<tr> <td>-</td> <td>OnStream</td> <td>-</td>  <td>OnStream drives (see below)</td> <td>-</td></tr>
<tr> <td>-</td> <td>Quantum</td> <td>DLT</td>  <td>DLT-8000</td> <td>40/80GB</td></tr>
<tr> <td>Linux</td> <td>Seagate</td> <td>DDS-4</td>  <td>Scorpio 40</td> <td>20/40GB</td></tr>
<tr> <td>FreeBSD 4.9 STABLE</td> <td>Seagate</td> <td>DDS-4</td>  <td>STA2401LW</td> <td>20/40GB</td></tr>
<tr> <td>FreeBSD 5.2.1 pthreads patched RELEASE</td> <td>Seagate</td> <td>AIT-1</td>  <td>STA1701W</td> <td>35/70GB</td></tr>
<tr> <td>Linux</td> <td>Sony</td> <td>DDS-2,3,4</td>  <td>-</td> <td>4-40GB</td></tr>
<tr> <td>Linux</td> <td>Tandberg</td> <td>-</td>  <td>Tandbert MLR3</td> <td>-</td></tr>
<tr> <td>FreeBSD</td> <td>Tandberg</td> <td>-</td>  <td>Tandberg SLR6</td> <td>-</td></tr>
<tr> <td>Solaris</td> <td>Tandberg</td> <td>-</td>  <td>Tandberg SLR75</td> <td>-</td></tr>

</table>

<p>
There is a list of 
<a href="autochangers.html#Models">supported autochangers</a>
models in the <a href="autochangers.html">autochangers chapter</a>
of this document, where you will find other tape drives that
work with Bacula.

<h2><a name="UnSupportedDrives">Unsupported Tape Drives</a></h2>
Previously OnStream IDE-SCSI tape drives did not work with
Bacula. As of Bacula version 1.33 and the osst kernel driver
version 0.9.14 or later, they now work. Please see the
testing chapter as you must set a fixed block size.
<p>
QIC tapes are known to have a number of particularities (fixed
block size, and one EOF rather than two to terminate the tape). As     
a consequence, you will need to take a lot of care in configuring them
to make them work correctly with Bacula.

<h2>FreeBSD Users Be Aware!!!</h2>
Unless you have patched the pthreads library on most FreeBSD systems,    
you will lose data when Bacula spans tapes. This is because the unpatched
pthreads library fails to return a warning status to Bacula that the end 
of the tape is near. 
Please see the <a href="tapetesting.html#FreeBSDTapes">Tape Testing
Chapter</a> of this manual for <b>important</b> information on
how to configure your tape drive for compatibility with Bacula.
 

<h2>Supported Autochangers</h2>
For information on supported autochangers, please see the
<a href="autochangers.html#Models">Autochangers Known to Work with Bacula</a>
section of the Autochangers chapter of this manual.

<h2>Up Front Decisions</h2>
<ul type="disc">
<li>Before building Bacula you need to decide if you
    want to use SQLite, MySQL, or PostgreSQL.
    Unless you are already familiar with MySQL or PostgreSQL,
    we suggest that you start with
    the SQLite database as it is the simplest.
    If you need security or have a large operation, you should consider the
    MySQL or PostgreSQL databases because it provides all the
    Bacula features and is the best tested.  MySQL and PostgreSQL
    are also much easier to upgrade than SQLite when new versions of
    Bacula require a database update.  </li>
<li>If you wish to use SQLite as the Bacula catalog,
    please see <a href="sqlite.html">Installing and Configuring SQLite</a>
    chapter of this manual.</li>
<li>If you wish to use PostgreSQL as the Bacula catalog, please see the
    <a href="postgresql.html">Installing and Configuring PostgreSQL</a>
    chapter of this manual.</li>
<li>If you wish to use MySQL as the Bacula catalog, please see the 
    <a href="mysql.html">Installing and Configuring MySQL</a>
    chapter of this manual.</li>
<li>At this point, you should have Bacula built and installed. If not,
    please follow the instructions in the <a href="install.html">Bacula Installation Chapter</a>
    of this manual.</li>
</ul>

<h2>Installing Bacula</h2>
Before setting up your configuration files, you will want to install
Bacula in its final location. Simply enter:
<pre>
make install
</pre>
If you have previously installed Bacula, the old binaries
will be overwritten, but the old configuration files will remain
unchanged, and the &quot;new&quot; configuration files will be
appended with a <b>.new</b>. Generally if you have previously
installed and run Bacula you will want to discard or 
ignore the configuration files with the appended <b>.new</b>.
For the details of doing the install, please see the
<a href="install.html">Installing Bacula</a> chapter of this
manual.

<h2>Understanding Pools, Volumes and Labels</h2>
If you have been using a program such as <b>tar</b> to backup your
system, Pools, Volumes, and labeling may be a bit confusing at first.
A Volume is a single physical tape (or possibly a single file) on
which Bacula will write your backup data.
Pools group together Volumes so that a backup is not restricted
to the length of a single Volume (tape).  Consequently, rather
than explicitly naming Volumes in your Job, you specify a
Pool, and Bacula will select the next appendable
Volume from the Pool and request you to mount it.
<p>                        
Although the basic Pool options are specified in the Director's Pool
resource, the <b>real</b> Pool is maintained in the Bacula
Catalog.  It contains information taken from the Pool resource
(bacula-dir.conf) as well as information on all the Volumes that have
been added to the Pool.  Adding Volumes to a Pool is usually done
manually with the Console program using the <b>label</b> command.
<p>
For each Volume, Bacula maintains a fair amount of catalog
information such as the first write date/time, the
last write date/time, the number of files on the Volume, the number of
bytes on the Volume, the number of Mounts, etc.

<p>Before Bacula will read or write a Volume, the physical Volume
must have a Bacula software label so that
Bacula can be sure the correct Volume is mounted. This
is usually done using the <b>label</b> command in the Console
program.

<p>
The steps for creating a Pool, adding Volumes to it, and writing
software labels to the Volumes, may seem tedious at first, but in fact,
they are quite simple to do, and they allow you to use multiple
Volumes (rather than being limited to the size of a single tape).
Pools also give you significant flexibility in your backup
process. For example, you can
have a &quot;Daily&quot; Pool of Volumes for Incremental backups
and a &quot;Weekly&quot; Pool of Volumes for Full backups.
By specifying the appropriate Pool in the daily and weekly 
backup Jobs, you thereby insure that no daily Job ever writes
to a Volume in the Weekly Pool and vise versa, and Bacula
will tell you what tape is needed and when.
<p>
For more on Pools, see the <a href="dirdconf.html#PoolResource">Pool Resource</a>
section of the Director Configuration chapter, or simply read on, and
we will come back to this subject later.

<h2><a name="config"></a>Setting Up Bacula Configuration Files</h2>
After running the appropriate <b>./configure</b> command and doing
a <b>make</b>, and a <b>make install</b>, if this is the
first time you are running Bacula,
you must create valid configuration files for
the Director, the File daemon, the Storage daemon, and the Console
programs. If you have followed our recommendations,
default configuration files as well as the daemon
binaries will be located in your installation directory. In
any case, the binaries are found in the directory you specified
on the <b>--sbindir</b> option to the <b>./configure</b> command,
and the configuration files are found in the directory you
specified on the <b>--sysconfdir</b> option.
<p>
When initially setting up Bacula you will need to invest
a bit of time in modifying the default configuration files to suit
your environment. This may entail starting and stopping Bacula
a number of times until you get everything right. Please do not 
despair. Once you have created your configuration files, you will
rarely need to change them nor will you stop and start Bacula
very often. Most of the work will simply be in changing the tape when
it is full.

<h3><a href="consoleconf.html">Configuring the Console Program</a></h3>
The Console configuration file is found in the directory specified on
the <b>--sysconfdir</b> option that you specified on the
<b>./configure</b> command and by default is named <b>console.conf</b>.
Normally, for first time users, no change
is needed to this file.  Reasonable defaults are set.

<h3><a href="filedconf.html">Configuring the File daemon</a></h3>
The File daemon configuration file is found in the directory specified on
the <b>--sysconfdir</b> option that you specified on the
<b>./configure</b> command.  By default, the File daemon's configuration
file is named <b>bacula-fd.conf</b>.
Normally, for first time users, no change
is needed to this file.  Reasonable defaults are set. However, if you
are going to back up more than one machine, you will need to install
the File daemon with a unique configuration file on each machine to
be backed up. The information about each File daemon must appear in
the Director's configuration file.

<h3><a href="dirdconf.html">Configuring the Director</a></h3>
The Director configuration file is found in the directory specified on the
<b>--sysconfdir</b> option that you specified on the <b>./configure</b>
command. Normally the Director's configuration file is named
<b>bacula-dir.conf</b>.

<p></p> In general, the only change you must make is modify
the FileSet resource so that the <b>Include</b> configuration directive
contains at least one line with a valid name of a directory (or file) to
be saved.  

<p></p>If you do not have a DLT tape drive, you will probably
want to edit the Storage resource to contain names that are more
representative of your actual storage device.  You can always use the
existing names as you are free to arbitrarily assign them, but they must
agree with the corresponding names in the Storage daemon's configuration
file.  

<p></p> You may also want to change the email address for
notification from the default <b>root</b> to your email address.

<p>Finally, if you have multiple systems to be backed up, you will
need a separate File daemon or Client specification for each
system, specifying its name, address, and password.  We have found
that giving your daemons the same name as your system but post fixed
with <b>-fd</b> helps a lot in debugging. That is, if your system
name is <b>foobaz</b>, you would give the File daemon the name
<b>foobaz-fd</b>. For the Director, you might use <b>foobaz-dir</b>,
and for the storage daemon, you might use <b>foobaz-sd</b>.

<h3><a href="storedconf.html">Configuring the Storage daemon</a></h3>
The Storage daemon's configuration file is found in the directory specified on the
<b>--sysconfdir</b> option that you specified on the <b>./configure</b>
command.  By default, the Storage daemon's file is named
<b>bacula-sd.conf</b>. Edit this file to contain the correct
Archive device names for any tape devices that you have.  If the
configuration process properly detected your system, they will already
be correctly set.  These Storage resource name and Media Type must be
the same as the corresponding ones in the Director's configuration file
<b>bacula-dir.conf</b>.  If you want to backup to a file instead of a tape,
the Archive device must point to a directory in which the Volumes will 
be created as files when you label the Volume.

<h2>Testing your Configuration Files</h2>
You can test if your configuration file is syntactically
correct by running the appropriate daemon with the <b>-t</b> option.
The daemon will process the configuration file and print any error
messages then terminate. For example, assuming you have installed
your binaries and configuration files in the same directory.
<pre>
cd &lt;installation-directory&gt;
./bacula-dir -t -c bacula-dir.conf
./bacula-fd -t -c bacula-fd.conf
./bacula-sd -t -c bacula-sd.conf
./console -t -c console.conf
</pre>
will test the configuration files of each of the main programs.
If the configuration file is OK, the program will terminate
without printing anything.

<h2>Testing Bacula Compatibility with Your Tape Drive</h2>
Before spending a lot of time on Bacula only to find that
it doesn't work with your tape drive, please read the
<a href="tapetesting.html">btape -- Testing Your Tape Drive</a>
chapter of this manual.
If you have a modern standard SCSI tape drive on a Linux
or Solaris, most likely it
will work, but better test than be sorry. For FreeBSD (and probably
other xBSD flavors), reading the above mentioned tape testing
chapter is a must.  Also, for FreeBSD, please see           
<a href="http://www.freebsddiary.org/bacula.php">The FreeBSD
Diary</a> for a detailed description on how to make Bacula 
work on your system. In addition, users of FreeBSD prior to 4.9-STABLE
dated Mon Dec 29 15:18:01 2003 UTC who plan to use tape devices,
please see the file <b>platforms/freebsd/pthreads-fix.txt</b>
in the main Bacula directory concerning important information
concerning compatibility of Bacula and your system.

<h2>Get Rid of the /lib/tls Directory</h2>
As noted above the new pthreads library <b>/lib/tls</b> installed
by default on recent Red Hat systems running kernel 2.4.x is 
defective. You must remove it or rename it then reboot your
system before running Bacula.

<h2>Running Bacula</h2>
Probably the most important part of running Bacula is being
able to retore files. If you haven't tried recovering files
at least once, when you actually have to do it, you will
be under a lot more pressure (and prone to make errors) than
if you had already tried it once.
<p>
To get a good idea how to use Bacula in a short time,
we <b>strongly</b> recommend that you follow the 
example in 
<a href="running.html">Running Bacula Chapter</a>
of this manual where you will get detailed instructions on 
how to run Bacula.

<h2>Log Rotation</h2>
If you use the default <b>bacula-dir.conf</b> or some variation   
of it, you will note that it logs all the Bacula output to a
file. To avoid that this file grows without limit, we recommend
that you copy the file <b>logrotate</b> from the <b>scripts/logrotate</b>
to <b>/etc/logrotate.d/bacula</b>. This will cause the 
log file to be rotated once a month and kept for a maximum
of 5 months.  You may want to edit this file to change the default
log rotation preferences.

<h2>Disaster Recovery</h2>
If you intend to use Bacula as a disaster recovery tool
rather than simply a program to restore lost or damaged files,
you will want to read the <a href="rescue.html">Disaster Recovery
Using Bacula Chapter</a> of this manual.
<p>
In any case, you are strongly urged to carefully test restoring 
some files that you have saved rather than wait until disaster
strikes. This way, you will be prepared.

<page_prev name="The Current State of Bacula" url="state.html">
<page_next name="Installing Bacula" url="install.html">
