last update: 18/ april / 2002

GNU/Linux and autoloader: an adventure

After a lucky experience with a GNU/Linux file server our company decided to upgrade the system. We found a lot of problems to manage backup therefore I decided to avoid other people a similar adventure explaining our path to get out of troubles.

After We analized what was in the shelf We decided to purchase an IBM Netfinity 5000 server with a SCSI controller with 4 * 36Gb hot-swap hard disks configured as an 80Gb logical disk. This decision has become after a compatibility (to GNU/Linux) declaration from IBM.

It was previewed to backup at least 30Gb of data so we bought an IBM autoloader. Such autoloader is a backup unit that instead of tape accept an appropriate container (as media). The container has slots in order to insert 6 20Gb tapes (40Gb compressed) up to max 240Gb of backup space. Tapes are loaded from the mechanical part of the unit. Single tape is considered loaded only when it reaches the read/write position.

On the aforesaid server We installed a Red Hat 6.2 distribution (the one I was more experienced as I write in another article about backup).

The tape unit has been recognized from the system without problems ;-)
Reading PC boot log it was possible to know that it has been identified like Seagate DAT 06241-xxx, and adressed through device /dev/st0 that, for easiness of use, has been linked with a meaningful name with following command:

ln -s /etc/st0 /etc/tape

Then We loaded tapes in the cartridge and, after that, one tape in r/w position (through front panel buttons)and We executed a backup with the command

tar -cvf /dev/tape testfile

All has worked good and there We got a backup at a record speed.

At this point it was necessary to take advantage from automatic tape loading. After many searches in Internet I read (in a newsgroup) about the existence of the program mtx (rif. mtx.sourceforge.net ). This program is defined as "tape changer control program" that is a program able to manage autoloader robotic part. In fact, carefully reading Faq file that comes with source code, it is possible to understand that an autoloader unit is composed by two parts:

  1. the backup unit
  2. the loader unit

the two parts are viewed from system as two different tipology devices: the first is a sequential device the second a block device and they must to be linked to two different logical devices.

The problem, at that point, was that kernel was able to atomatically detect only the backup unit so if I use the command:

cat /proc/scsi/scsi

the output didn't show any kind of "Media changer" unit.

The answer, once again, in the Faq: the installed SCSI controller has only one SCSI ID but 2 different LUN's (logical units). In order to resolve the problem it must to rebuild kernel or to add the following line to file /etc/lilo.conf : append="max_scsi_luns=2"

Then to execute: /sbin/lilo and to reboot pc.

I can assure that, from that moment, the system has correctly detected the unit (as /dev/sge). As suggested from mtx instructions, the device has been linked to a name that is addressed as default device from the program. The command to do that is:

ln -s /dev/sge /dev/changer

Mtx command allows to load tapes with commands like

mtx load n (where n is tape number)

or to unload the whole cartridge media with

mtx eject

Then, in order to automate backup procedures, I have modified some scripts taken from "Backup how-to", that are available to following link:

backupfunctions.tar.gz

I hope to have been exhausting and to have avoided to someone the hard work necessary to make all to work. Please feel free write to me to report any error or if You need help on the argument:

di Rudi Giacomini Pilon