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.
# 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)
Prepare the card
zuluscsi.ini + tapes/
Connect and scan
ioscan -fnC tape && insf -e -C tape
Install from depot or tape
swinstall -s /var/tmp/TAPELIB-HPUX.depot TAPELIB
Mount and back up
tapelib mount weekly.tap -w
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.
- If EchoServ shipped your card pre-configured, it already has
zuluscsi.iniand atapesfolder — skip straight to Step 2. - Otherwise, on your PC or Mac, in the top folder (root) of the SD card: create a folder named
tapes, and create or editzuluscsi.iniwith the settings below. - 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.
- Optional, to install from virtual tape: copy
TAPELIB-HPUX-INSTALL.vtpintotapesand keep theLastImageline. Otherwise omitLastImage.
[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.
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.
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
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.
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.
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
| Install | ACCESS | Who can run it |
|---|---|---|
0755 root:bin (default) | any | root only — the /dev/rscsi node is root-only |
4755 setuid root (optional operator mode) | OPER | root and members of OPER_GROUP |
4755 setuid root | ALL | anyone — 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, explicitRO/RWwrite-ring control, andnewstamped with the host clock. EchoServ's earlier Devices on Demand firmware speaks Tier-1 (0xDB–0xE0): slot-based listing and.vtpcreation, with wildcards matched by the client.tapelibsends0xD9GET_CAPSfirst to tell the two apart; the Tier-1 unmount is the standard SCSI0x1Bunload. - Stock ZuluSCSI firmware: un-flashed ZuluSCSI firmware has no tape-library commands, so
tapelibstops withdid not answer VTL opcodes. sctlalongsidestape:tapelibfinds the unit from thestapenode (/dev/rmt/0mn→/dev/rscsi/c0t3d0), a hardware path (-p) or a literalcItTdL(-c), and sends its commands throughsctl. It never opens thestapenode itself. Run asroot, it derives (bus, target, lun) from thestapeminor number (0xIITLFF) and creates the matching/dev/rscsi/cItTdLnode (mode0600) when it is absent, so you never hand-create it.- SCSI
CONTROLbyte0x00on every CDB: HP-UXsctlrejects a CDB whose last byte is not zero (EINVAL), sotapelibkeeps it0x00on every command. One consequence: a Tier-1newstamps hour00. - Never sends
TEST UNIT READY:tapelibdoes not send0x00TEST UNIT READY. On an ECHO3000 virtual drive,INQUIRYand the library opcodes leave a pending06/28/00media-changeUNIT ATTENTIONin place forstape, while the Tier-10x1Bunload consumes it and the client retries once. - Two disk-safety guards: a device whose major is not
stape(for examplesdisk, major188) is refused beforesctlis opened, and the first command is a plainSCSI INQUIRY— anything other than peripheral type0x01(sequential-access tape) is refused before any vendor opcode, so a system disk is never sent one. - Privilege handling:
tapelibdropseuidwithsetresuidas the first statement inmain(), resets its environment, and raiseseuid=0solely around theopen(2)of thesctlnode.SHLIB_PATHlookup is disabled in the binary itself withchatr +s disable, and the/usr/sbin/tapelibbinary is installed0755root:bin. The depot install is not setuid. - Installer checks: with
install.shalready on disk, the--taperoute pre-scans the archive withtar tvf, refuses symlinks, hardlinks,..and a leading/, and unpacks into its own private0700work directory:sh ./install.sh --tape /dev/rmt/0mn(aftermt -t /dev/rmt/0mn rew). Reels and archives are installed as root, so install only from media supplied by EchoServ. - Remove:
swremove TAPELIB, orsh uninstall.sh [--purge]. The depot also carries the manual page (TAPELIB-MAN) and the C89 sources under/usr/local/src/tapelib(TAPELIB-SRC).
If It Goes Wrong
| What you see | What to do |
|---|---|
Drive missing from ioscan -fnC tape | Check 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 CLAIMED | Run /sbin/insf -e -C tape, then ioscan -fnC tape again. |
/dev/rmt/0mn is a different drive | Use 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 device | It 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 tapelib | Install 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 nothing | Check 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 work | Your 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 opcodes | Check 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 archive | It holds a symlink, hard link, .. or a leading /. Use only EchoServ-supplied media. |
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.