Allegro Consultants · EchoServ, LLC — HP-UX tapelib (B.01.00): Virtual Tape Library for HP 9000 + Devices on Demand (ZuluSCSI) & ECHO3000 ← Back to Home Page
Allegro Consultants

HP-UX tapelib (B.01.00) · PA-RISC HP 9000 + Devices on Demand (ZuluSCSI) & ECHO3000

Virtual Tape Library for HP-UX. Browse, mount and back up from the shell.

tapelib lets you pick, mount and eject virtual tapes on your HP 9000 right from the shell. Your existing tar, fbackup and frecover jobs keep writing to /dev/rmt/0mn exactly as before. Works with EchoServ's Devices on Demand (ZuluSCSI) hardware and with ECHO3000 HP-UX guests.

Commands below are shown as root (the default install). To let non-root backup operators run tapelib, see Step 4.

HP-UX consoletapelib
# tapelib status
Drive       : c0t3d0  node /dev/rscsi/c0t3d0  (HP C1537A L708)
Device      : /dev/rmt/0mn   HW path 0/0/1/0.3.0
Protocol    : Tier-2 (0xE1 ZuluSCSI Hardware VTL)
Library     : tapes (12 cartridges)
Mounted     : (empty -- no tape loaded)
# tapelib mount weekly.tap -w
tapelib: Mounted 'weekly.tap' (SIMH, READ-WRITE)
# tar cvf /dev/rmt/0mn /home/acct
a /home/acct/.profile 2 blocks
a /home/acct/ledger.dat 118 blocks
# tapelib unmount
tapelib: Unmounted tape drive (drive is now empty)
1 · SD Card

Prepare the card

zuluscsi.ini + tapes/
2 · HP 9000

Connect and scan

ioscan -fnC tape && insf -e -C tape
3 · Install

Install from depot or tape

swinstall -s /var/tmp/TAPELIB-HPUX.depot TAPELIB
4 · Back up

Mount and back up

tapelib mount weekly.tap -w
Step 1 · SD card

Prepare the Devices on Demand (ZuluSCSI) SD Card

Devices on Demand is built on ZuluSCSI SCSI-to-SD hardware; its settings live in zuluscsi.ini on the card.

  1. If EchoServ shipped your card pre-configured, it already has zuluscsi.ini and a tapes folder — skip straight to Step 2.
  2. Otherwise, on your PC or Mac, in the top folder (root) of the SD card: create a folder named tapes, and create or edit zuluscsi.ini with the settings below.
  3. Pick a SCSI ID that nothing else on the HP 9000's bus uses (Step 2 shows how to check). The example uses ID 3. Never use ID 7: that is the HP 9000 itself.
  4. Optional, to install from virtual tape: copy TAPELIB-HPUX-INSTALL.vtp into tapes and keep the LastImage line. Otherwise omit LastImage.
[SCSI]
EnableSCSI2     = 1
EnableParity    = 1
EnableToolbox   = 1

[SCSI3]
Type            = 5
Vendor          = "HP      "
Product         = "C1537A          "
Version         = "L708"
BlockSize       = 512
ImgDir          = "tapes"
LastImage       = "TAPELIB-HPUX-INSTALL.vtp"   # optional: pre-mount installer reel for first boot

Devices on Demand units with EchoServ's current library firmware support named reels and 1-level sub-folders (tapes/daily/, tapes/yearly/). Earlier Devices on Demand units use numbered slots; tapelib detects which firmware your unit has automatically.

Step 2 · HP 9000

Connect to the SCSI Bus and Verify the /dev/rmt Nodes

Check the SCSI IDs, shut down, connect, then scan as root.

1. Check which SCSI IDs are taken (before you shut down)

# /usr/sbin/ioscan -fnC disk
# /usr/sbin/ioscan -fnC tape

In each hardware path, the number just before the final .0 is the SCSI ID: in 0/0/1/0.3.0 the ID is 3. Choose an ID that is not listed.

2. Shut the HP 9000 down and connect the unit

Shut the HP 9000 down cleanly and power it off before you connect a SCSI device:

# /sbin/shutdown -h 0

Connect Devices on Demand to the SCSI bus. If it is the last device on the SCSI cable, make sure the bus is properly terminated.

3. Boot, scan and verify

# /usr/sbin/ioscan -fnC tape
# /sbin/insf -e -C tape

Confirm that the HP C1537A drive is CLAIMED and note its no-rewind node: /dev/rmt/0mn by default, or /dev/rmt/1mn when 0mn is already assigned to another drive.

Step 3 · Install

Install tapelib on HP-UX

One command for most systems; other routes are below.

Option A — one command (recommended for HP-UX 11i)

Copy TAPELIB-HPUX.depot from EchoServ to /var/tmp on the HP 9000 (ftp in binary mode, or scp), then run:

# /usr/sbin/swinstall -s /var/tmp/TAPELIB-HPUX.depot TAPELIB

This installs /usr/sbin/tapelib, its manual page and a starter /etc/tapelib.conf (an existing configuration is kept).

Other ways to install (from virtual tape, or on older PA-RISC 1.1 systems)

Option B — no network: install from the installer tape reel

With TAPELIB-HPUX-INSTALL.vtp (or .tap) mounted as the drive's tape, unpack it into a fresh directory and run the installer. mkdir without -p refuses a directory that already exists. Install only from media supplied by EchoServ.

# umask 077 && mkdir /var/tmp/tapelib-install && cd /var/tmp/tapelib-install
# mt -t /dev/rmt/0mn rew && tar xvf /dev/rmt/0mn
# sh ./install.sh

Option C — older PA-RISC 1.1 HP 9000 (7xx / 8xx)

Do not use the depot on a PA-RISC 1.1 machine. From the unpacked tape folder, install the PA-RISC 1.1 build (tapelib.pa11); the portable C89 source can also be built with make pa11 or make hpcc:

# cp ./tapelib.pa11 ./tapelib && sh ./install.sh
Step 4 · Check it works

Check That It Works, and Optional Settings

Most shops (backups run as root): you're done.

If ioscan showed your drive as /dev/rmt/0mn, run:

# tapelib status
# tapelib list

If you see your tapes, setup is complete.

Optional: the drive is not /dev/rmt/0mn, or you want non-root operators to run tapelib

Drive on another node: set DEFAULT_DEV in /etc/tapelib.conf (or use tapelib -d /dev/rmt/1mn). Backup operators in group sys (or another operator group): after Option A, run:

# chmod 4755 /usr/sbin/tapelib
# tapelib access oper

and keep the settings in /etc/tapelib.conf:

ACCESS OPER
OPER_GROUP sys
DEFAULT_DEV /dev/rmt/0mn
DEV /dev/rmt/0mn 0/0/1/0.3.0

Keep /etc/tapelib.conf a root-owned regular file, mode 0644 or tighter. Find your drive's hardware path with ioscan -fnC tape. On a fresh Option B / C install you may instead run sh ./install.sh --setuid --oper-group sys from the unpacked tape folder.

5 · Everyday use

Commands and Backups with tar, mt, fbackup, frecover

A nightly backup, the short version

# tapelib new                           # create & mount a fresh blank reel (write ring in)
# fbackup -f /dev/rmt/0mn -i /home      # run your usual fbackup or tar
# tapelib unmount

Prefer a menu? Run # tapelib with no arguments to open the full-screen menu (an HP hpterm or any VT100/ANSI terminal): type a slot number to mount read-only, W and a number to mount read-write, N for a new reel, U to unmount, / to filter the list and Q to quit.

To mount or create a named reel: # tapelib mount monday.vtp -w or # tapelib new monday.vtp (earlier Devices on Demand firmware names new reels automatically by date and time).

Back up with the tools you already use

Once a reel is mounted, the drive is an ordinary HP-UX tape. Use the no-rewind node /dev/rmt/0mn (or 1mn, matching Step 2) and rewind before you read back what you wrote:

# tapelib mount weekly.tap -w
# tar cvf /dev/rmt/0mn /home/acct          # write a tar reel
# mt -t /dev/rmt/0mn rew                   # rewind
# tar tvf /dev/rmt/0mn                     # list it back
# mt -t /dev/rmt/0mn rew
# fbackup -f /dev/rmt/0mn -i /home         # or a full fbackup of /home
# mt -t /dev/rmt/0mn rew
# frecover -x -v -f /dev/rmt/0mn -i /home/acct   # restore one tree
# tapelib unmount

All the tapelib commands

# tapelib status                          # the drive, the library, the reel mounted now
# tapelib list 'archive*'                 # reels in the library, filtered by a pattern
# tapelib mount archive_2026.tap          # read-only by default (-r)
# tapelib mount backup.tap -w             # write ring in
# tapelib new daily FMT=VTP               # a new empty reel: FMT=TAP or VTP
# tapelib unmount

# tapelib -d /dev/rmt/1mn status          # pick the drive by its stape node (default /dev/rmt/0mn)
# tapelib -p 0/0/2/0.4.0 list             # ... or by hardware path
# tapelib -c c1t4d0 status                # ... or by cTtD

new with an extensionless name picks the container by the drive: .tap (SIMH, well suited to variable-block tar / fbackup) on an ECHO3000 drive, .vtp on a Devices on Demand drive; FMT= overrides (FMT=STD is for an ECHO3000 drive). MPE-style tokens (DEV=, PATH=, CTL=, RO, RW, FORCE, FMT=) are accepted as well as -d -p -c -r -w -f -h.

6 · ECHO3000 & technical details

ECHO3000 Hosts, Privileges and Under the Hood

ECHO3000 HP-UX guests

tapelib runs unchanged in an ECHO3000 HP-UX (rp2470) guest. Point the emulated tape drive (SCSI id 3) at your tape shelf with library-dir=:

-drive if=none,id=tape0
-device scsi-tape,id=tape0dev,drive=tape0,scsi-id=3,bus=scsi.0,block-size=512,library-dir=/path/to/tapes

Check and convert reels with tapeconv.py; all six container formats are understood: std, simh, vtp, charon-a, charon-b and the read-only tcarch (TAPECOPY) archive. The MPE/iX :TAPELIB and Linux-host guide is here.

Who can run tapelib

InstallACCESSWho can run it
0755 root:bin (default)anyroot only — the /dev/rscsi node is root-only
4755 setuid root (optional operator mode)OPERroot and members of OPER_GROUP
4755 setuid rootALLanyone — but a caller who is not root or in OPER_GROUP may use only the devices configured in /etc/tapelib.conf

Under the Hood (for technical administrators)

  • Library protocol: Devices on Demand units with EchoServ's current library firmware speak Tier-2 (0xE1): named and wildcard mounts, 1-level subfolders, explicit RO / RW write-ring control, and new stamped with the host clock. EchoServ's earlier Devices on Demand firmware speaks Tier-1 (0xDB–0xE0): slot-based listing and .vtp creation, with wildcards matched by the client. tapelib sends 0xD9 GET_CAPS first to tell the two apart; the Tier-1 unmount is the standard SCSI 0x1B unload.
  • Stock ZuluSCSI firmware: un-flashed ZuluSCSI firmware has no tape-library commands, so tapelib stops with did not answer VTL opcodes.
  • sctl alongside stape: tapelib finds the unit from the stape node (/dev/rmt/0mn → /dev/rscsi/c0t3d0), a hardware path (-p) or a literal cItTdL (-c), and sends its commands through sctl. It never opens the stape node itself. Run as root, it derives (bus, target, lun) from the stape minor number (0xIITLFF) and creates the matching /dev/rscsi/cItTdL node (mode 0600) when it is absent, so you never hand-create it.
  • SCSI CONTROL byte 0x00 on every CDB: HP-UX sctl rejects a CDB whose last byte is not zero (EINVAL), so tapelib keeps it 0x00 on every command. One consequence: a Tier-1 new stamps hour 00.
  • Never sends TEST UNIT READY: tapelib does not send 0x00 TEST UNIT READY. On an ECHO3000 virtual drive, INQUIRY and the library opcodes leave a pending 06/28/00 media-change UNIT ATTENTION in place for stape, while the Tier-1 0x1B unload consumes it and the client retries once.
  • Two disk-safety guards: a device whose major is not stape (for example sdisk, major 188) is refused before sctl is opened, and the first command is a plain SCSI INQUIRY — anything other than peripheral type 0x01 (sequential-access tape) is refused before any vendor opcode, so a system disk is never sent one.
  • Privilege handling: tapelib drops euid with setresuid as the first statement in main(), resets its environment, and raises euid=0 solely around the open(2) of the sctl node. SHLIB_PATH lookup is disabled in the binary itself with chatr +s disable, and the /usr/sbin/tapelib binary is installed 0755 root:bin. The depot install is not setuid.
  • Installer checks: with install.sh already on disk, the --tape route pre-scans the archive with tar tvf, refuses symlinks, hardlinks, .. and a leading /, and unpacks into its own private 0700 work directory: sh ./install.sh --tape /dev/rmt/0mn (after mt -t /dev/rmt/0mn rew). Reels and archives are installed as root, so install only from media supplied by EchoServ.
  • Remove: swremove TAPELIB, or sh uninstall.sh [--purge]. The depot also carries the manual page (TAPELIB-MAN) and the C89 sources under /usr/local/src/tapelib (TAPELIB-SRC).
7 · Troubleshooting

If It Goes Wrong

What you seeWhat to do
Drive missing from ioscan -fnC tapeCheck SCSI cabling and termination, a unique SCSI ID that is not 7, Type = 5 in the [SCSIn] section of zuluscsi.ini, and that the SD card is seated.
Drive shown but not CLAIMEDRun /sbin/insf -e -C tape, then ioscan -fnC tape again.
/dev/rmt/0mn is a different driveUse the node ioscan shows for your C1537A (for example /dev/rmt/1mn) with tapelib -d, or set DEFAULT_DEV in /etc/tapelib.conf.
tapelib refuses the deviceIt must be a stape node on a sequential-access tape unit; disks and control nodes are refused by design.
A non-root user cannot run tapelibInstall setuid (chmod 4755 or install.sh --setuid), put the user in OPER_GROUP (or use ACCESS ALL), and keep /etc/tapelib.conf root-owned, mode 0644 or tighter.
list shows nothingCheck that ImgDir names your tapes folder and that it holds .tap or .vtp reels (an ECHO3000 drive also reads .std).
Wildcards or subfolders do not workYour Devices on Demand unit has the earlier library firmware: wildcards still work in tapelib, without named sub-folders. Contact EchoServ for the firmware update.
tapelib says did not answer VTL opcodesCheck EnableToolbox = 1 and ImgDir in zuluscsi.ini. Stock ZuluSCSI firmware does not include the tape library; contact EchoServ for Devices on Demand library firmware.
install.sh refuses an archiveIt holds a symlink, hard link, .. or a leading /. Use only EchoServ-supplied media.
Get It · Contact Us

Equip Your HP 9000 with Devices on Demand + tapelib

Delivered directly from EchoServ: the SD-UX TAPELIB-HPUX.depot (swinstall) and .vtp / .tap installer reels for HP-UX 11i on PA-RISC 2.0 and ECHO3000 HP-UX guests, plus a PA-RISC 1.1 build (tapelib.pa11) and portable C89 source for older PA-RISC 1.1 systems.

Running MPE/iX on an HP 3000? See the MPE/iX :TAPELIB guide.