APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > Linux Articles > Tape Autoloader on 2.4 Linux
Printer Friendly Version




Linux Section

Tape Autoloader on 2.4 Linux


By Rob Fantini

Rob Fantini explains how he got an autoloader tape unit working on RedHat Linux

This info may not be clearly written, but shows what I did to get autoloaders working on 2.4 linux.

Part 1: Kernel must support luns

  • use or make a kernel with CONFIG_SCSI_MULTI_LUN=y kernel must probe for scsi luns on boot.
  • install rpm mtx - software to manipulate autoloaders..
  • figure out the device names for /dev/st? and /dev/sg? see part 2.
  • use a script like the one in part 3.

Part 2: notes on device names

  • st0 = 1-st tape drive
  • st1 = 2-nd tape drive etc..

  • sg0 = 1-st generic scsi device
  • sg1 ...
  • sg2 = 3-rd etc...

From /proc/scsi/scsi:
Attached devices:
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: SEAGATE  Model: DAT    06240-XXX Rev: 8160
  Type:   Sequential-Access                ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 09 Lun: 00
  Vendor: SEAGATE  Model: DAT    06241-XXX Rev: 8110
  Type:   Sequential-Access                ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 09 Lun: 01
  Vendor: SEAGATE  Model: DAT    06241-XXX Rev: 8110
  Type:   Medium Changer                   ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: TDK      Model: CDRW4800B        Rev: S7D5
  Type:   CD-ROM                           ANSI SCSI revision: 02
 

so

  • st0 = Host: scsi0 Channel: 00 Id: 03 Lun: 00
  • st1 = Host: scsi0 Channel: 00 Id: 09 Lun: 00

  • sg0 = Host: scsi0 Channel: 00 Id: 03 Lun: 00
  • sg1 = Host: scsi0 Channel: 00 Id: 09 Lun: 00
  • sg2 = Host: scsi0 Channel: 00 Id: 09 Lun: 01

Thus the changer on the autoloader = sg2 .

That scsi assignment changes depending on add/rmv devices, or i think changing the ide cdrom from hdd to hdb

Part 3: script to do backups

# /u4/fbc/adm/Tape/mtx-tar   

# TAR: note  need  '.'  before path to eliminate  'tar: Error exit delayed from previous errors'


# 07-2002: use  mtx to manipulate  dds4 autoloader, #  then backup system.

DAY=`date +%A`
echo $DAY

set -x
/u4/fbc3/adm/TapeRpt  # clear report file

mtx -f /dev/sg2 unload  ## no harm if already unloaded.
                        ## in any case load does not auto unload.

case $DAY in
        Monday)         mtx -f /dev/sg2 load 1;; 

        Tuesday)        mtx -f /dev/sg2 load 2;;

        Wednesday)      mtx -f /dev/sg2 load 3;;

        Thursday)       mtx -f /dev/sg2 load 4;;

        Friday)         mtx -f /dev/sg2 load 5;;

        Sunday|Saturday) mtx -f /dev/sg2 load 6; # cleaning cartridge, unloads auto aft cleaning
                        mtx -f /dev/sg2 load 1;;

#       Sunday)         mtx -f /dev/sg2 load 1;;
esac


###  uncomment for debugging:
#mtx -f /dev/sg2 status >> /u4/fbc3/adm/TapeRpt ## cron err our also to this

##  09-04-2002, added next line, incase called from cmd line
cd /

tar -cv --exclude-from /u4/fbc/adm/Tape/exclude_files.lst -f  /dev/st1  ./

cat /u4/fbc3/adm/TapeRpt  |   mail -s "MasterBkup report" rob

Publish your articles, comments, book reviews or opinions here!

© January 2003 Rob Fantini All rights reserved



If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?




More Articles by Rob Fantini



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide




 I sell and support
 Kerio Mail server
g_face.jpg

This post tagged:

       - Backup
       - Hardware
       - Kernel
       - Linux
       - Tape Drives
       - Unix




Unix/Linux Consultants

Skills Tests

Guest Post Here