Rev’ing up Your Backups



 

 


Originally published in FedoraNEWS.ORG

Rev’ing up Your Backups

I have used various tape drives for backup purposes over the years. Fortunately I have very seldom needed to utilize the backups I have made, but on the rare occasion when a restore is needed, tape backups have saved my bacon.

Tapes, however, are not perfect and sometimes failed when a critical restore was needed. In some cases the data was either not recorded properly due to tape errors – verify can help with this problem – or the data degraded after it was recorded on the tape in which case verification does not help. Tape drives also break down or wear out over a period of time. Sometimes a drive has lasted for a long time and, in some cases, finding a new drive to utilize the existing tapes has been impossible.

Tape has another drawback as well; it is serially accessed and significantly slower than the random access afforded by disk drives.

Dead Tape Drive

As a result of these drawbacks, when my tape drive failed recently, I began looking for an alternative backup media. I investigated several, including tape drives, Zip drives, various types of removable hard drives, CD and DVD. Most of the devices that provided the storage space I needed were tape drives or removable hard drives, all of which can be quite expensive.

A New Possibility

One day while Googling for storage devices I found one that I had not heard of before. The Iomega REV drive provides up to 35GB of uncompressed data space and as much as 90GB compressed usual disclaimers – your mileage may vary. It consists of a drive unit with a motor to spin the disk and a set of read/write heads and all of the electronics to support them. The removable disk is just that; a disk without heads or electronics. The REV drive comes in ATAPI and USB 2.0 versions.

I decided to try the REV drive to see if it would meet my needs.

Although expensive, the REV drive is no more so than many tape drives of significantly less capacity. For $59.99 apiece, about 1.5 times the price of a 10/20GB tape, the drives themselves offer 3.5 times the storage capacity. The drive itself, at $399.99, is about the same price as the tape drive required to handle the 10/20GB tapes.

Installation

Installing new devices can sometimes be problematic. I chose the external USB version of the REV drive for two reasons. First, I wanted to test the ability of Linux to deal with a large USB mass storage device. I have easily used USB thumb drives on occasion, but a 35GB REV drive is another matter entirely.

Secondly, I wanted to save the last IDE slot in case I needed it some time in the future. One never knows when that last IDE slot will come in handy.

I currently have Fedora Core 4 with all updates installed. My hardware is home-built with an ABIT BE7 motherboard, 3.1 GHz P4, 1GB of RAM and miscellaneous hard drives, CD and DVD read/write drives.

I unpacked the drive which comes with a single data cartridge and plugged in the power and USB cables. I connected the USB cable to the USB port on my monitor and was immediately rewarded with a new icon on my desktop. Linux configured the drive as a CD-ROM using the following entry in /etc/fstab:

/dev/scd0               /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0

I mounted the drive and copied a couple files to it to ensure that it was really working and, of course, it worked perfectly.

It was the easiest installation of a storage device I have ever experienced! It did not even require a reboot or any software installation. All of the tape drives I have used have required some level of manual intervention to get to work, and several of them were quite frustrating.

Backup Procedures

I typically use a rotation on tape backups, so I decided to do the same with my REV Drive backups. I purchased five additional disk cartidges and use a four disk rotation.

Due to the very large capacity of these disks, the fact that I compress the tar archive, and the amount of data I back up each day, I can keep several days worth of backups for multiple computers on a single drive. Using a daily rotation and a script (see below) that deletes the older files, I typically use about 35% of the space on a given disk cartridge.

The daily rotation means that I have backups from every fourth day on each drive cartridge. If I am out of town and unable to change the drive cartridge, getting a couple extra days of backup on the same one is not a big deal. Such would not be the case with a tape drive.

Backup Shell Script

I wrote a little script to do my backups automatically and I run it every night as a cron job. Please feel free to use this and modify it as necessary to meet your own needs.

#!/bin/bash
################################################################################
#                                MyBackup                                      #
#                                                                              #
# This script backs up the critical files on all of the computers on my little #
# network. It uses tar for creating the archive via ssh with public/private    #
# keypairs to eliminate the need to login to each system.                      #
#                                                                              #
# Probably not the best security wise, but better than nothing.                #
#                                                                              #
#                                                                              #
# External modules used                                                        #
# tar                                                                          #
# ssh                                                                          #
#                                                                              #
# Change History                                                               #
# 02/13/2005  David Both    New Code.                                          #
# 03/19/2005  David Both    Revised to use new iomega REV drive.               #
#                                                                              #
#                                                                              #
#                                                                              #
################################################################################
################################################################################
# Initialization                                                               #
################################################################################
PATH=$PATH:/usr/local/sbin
export PATH
BackPath=/media/cdrom
# Generate the date string for the file name
crkDATE=$(date +%Y%m%d)
# Set the age of files to delete
crkAGE=30

################################################################################
# Mount the REV drive                                                          #
################################################################################
mount $BackPath
# preserve the return code from the mount command
RC=$?
# Check the return code
if [ $RC = 0 ]
then
   echo "Media mounted OK"
elif [ $RC = 32 ]
   then
   echo "ERROR: Mount Failure. RC = $RC."
   echo "Program terminated"
   exit
else
   echo "ERROR. Program Terminated. RC = $RC"
   exit
fi

################################################################################
# Get rid of files that are more than X days old                               #
################################################################################
cd $BackPath
find $BackPath -atime +$crkAGE -exec rm {} \;

################################################################################
# Backup the desired directories on host                                       #
################################################################################
BackHost=david1
# set the file name
crkFILE=/$BackPath/$BackHost.$crkDATE.tar.gz
echo
echo "Backup of $BackHost...please wait."
tar -cz /root /etc /home /usr/local > $crkFILE

################################################################################
# Backup the desired directories on host                                       #
################################################################################
BackHost=alice1
# set the file name
crkFILE=/$BackPath/$BackHost.$crkDATE.tar.gz
echo
echo "Backup of $BackHost...please wait."
ssh $BackHost "tar -cz /root /etc /home /usr/local" > $crkFILE

################################################################################
# Backup the desired directories on host                                       #
################################################################################
BackHost=leonardo
# set the file name
crkFILE=/$BackPath/$BackHost.$crkDATE.tar.gz
echo
echo "Backup of $BackHost...please wait."
ssh $BackHost "tar -cz /root /etc /home /usr/local" > $crkFILE

################################################################################
# Backup the desired directories on host                                       #
################################################################################
BackHost=vgr
# set the file name
crkFILE=/$BackPath/$BackHost.$crkDATE.tar.gz
echo
echo "Backup of $BackHost...please wait."
ssh $BackHost "tar -cz /root /etc /home /usr/local" > $crkFILE

################################################################################
# Backup the desired directories on host                                       #
################################################################################
BackHost=bunkerhill
# set the file name
crkFILE=/$BackPath/$BackHost.$crkDATE.tar.gz
echo
echo "Backup of $BackHost...please wait."
ssh $BackHost "tar -cz /root /etc /home /usr/local /var/spool/mail /var/www /var/www1 /var/www2 /var/www3 /var/www4" > $crkFILE

################################################################################
# Backup the desired directories on host                                       #
################################################################################
BackHost=simba
# set the file name
crkFILE=/$BackPath/$BackHost.$crkDATE.tar.gz
echo
echo "Backup of $BackHost...please wait."
ssh $BackHost "tar -cz /root /etc /home /usr/local /var/www /usr/local/mailman"  > $crkFILE

################################################################################
# UnMount the REV drive                                                        #
################################################################################
cd
if ! umount $BackPath
then
   echo "Error ummounting media. Program terminated with media still mounted. Cannot Eject."
else
   echo "Program terminated normally."
fi

exit

Conclusions

It is hard to imagine a better backup device than the Iomega REV Drive. It has high capacity, it is fast and the random access nature of a disk allows quick access to any file. I can store multiple backups on a single disk cartridge and access any file in moments.

Although it is certainly useful in applications other than backup, the Iomega REV Drive seems to be the ideal backup solution. Iomega even has an autoloader version for greater capacity than a single drive can provide. With a 25 MB/Sec data transfer rate, it far outpaces any tape drive on the market – at least the ones in my price range.

I highly recommend the Iomega REV Drive as a backup solution for small to medium capacity environments. Check out the Iomega web site for details on this amazing device.