last update 10/ april / 2002
GNU/Linux and backup:A case history
What You'll read is the story of the efforts I made to install
a storage unit on a GNU/Linux server.
My intentions was to provide to users a "no-NT" file server with a backup service.
This is first GNU/Linux file server I install in the company where I work
and when I the choice of the GNU/Linux distribution has fallen on Red Hat for
reasons of personal experiences with it.
The storage unit has been choose in an atipical way because it has not been
the result of technical analysis, rather dictated from reasons than cost, so
I keep from my warehouse an HP Colorado 14Gb IDE internal tape driver that was
not in use so I had recycled it.
It's also important to say that I'am a Linux user since 1998 but I always admin
NT networks (with all related problems) so many things I'll explain may be obvious
for a backup guru but can be an example of how a new Linux sysadmin like me can
face the problem and resolve it.
During installation of O.S. I chose the "Custom setup" so I left games and other
things superflous in a server; it was my way to gain the control of the
situation and chose only the software I need.
After setup I verified that the backup unit was identified from the system
as hdd (related message was displayed at boot) infact the backup unit
was connected as slave disk to 2nd IDE controller. To this point I did not know
wath to do to backup files.
From some articles on Linux Gazette
I remembered that all I need was to execute a tar command to a destination that
represents tape device.
It seems superflous to say that something like
tar -cvf nomefile /dev/hdd
doesn't work.
To this point I download from Internet the "BACKUP HOW-TO" file and don't
understanding instructions I confused my IDE unit with a floppy unit (one of
that units that are cascading connected with floppy disk).
After several tries to install a ftape module (the driver for floppy-tape
backup units) the light comes to my brain: after an nth stupid attempt to write
on /dev/hdd I executed a lsmod command to check if ftape was loaded in memory.
I don't found it but in place I found a ide-tape module loaded automatically.
New search and new informations comes to me: mistake was obvious it was not
a floppy tape but a ide tape.
A note at the end of supported backup units listwww.redhat.com
tells that:
Make sure you load the ide-tape.o module... the tape drive will
then likely appear as /dev/ht0. Do a "ln -s /dev/ht0
/dev/tape"...
After I created the link I assure to You that the command:
tar -cvf nomefile /dev/tape
made what was expected.
In order to backup files easily I created a script
(copied from "Backup how-to"), where I configured following rows:
EMAILTO=<username@domain> that is the user to send warnings
DESTFILE="/dev/tape" that is unit device;
BACKUPFILES="/root /etc /home" that are directories to backup
In such script there are 2 backup levels (0 o 1) to pass as parameter to the
script: level 0 stands for complete backup, level 1 executes an incremental backup.
The script has been saved in /usr/local/bin with name backup.sh (as suggested in
how-to).
after that it has been "sufficient" :-) to schedule backup operations with cron:
Cron is a command to schedule some dei process/comands that will be executed
in background.
Obviously it is necessary that scheduled events doesn't require any action from
operator otherwise You will find a serie of questions waiting for your answer
when You'll be back from holydays.
From here to have a working server it is only necessary to configure Samba, the users, shared directories and a little more...