Skip to content

Tape library management plugin for Unraid with full LTFS (Linear Tape File System) support

Notifications You must be signed in to change notification settings

und3f1ned/unraid-tape-library

Repository files navigation

Unraid Tape Library Plugin

A comprehensive tape library management plugin for Unraid with full LTFS (Linear Tape File System) support. Designed for HP StoreEver 1/8 G2 and similar tape autoloaders with LTO drives.

Features

Tape Library Management

  • Visual Dashboard - Real-time visualization of library slots, drives, and tape status
  • Load/Unload Operations - Move tapes between slots and drives with click-to-select interface
  • Transfer Operations - Move tapes between storage slots
  • Inventory Scan - Rescan library to detect tape barcodes
  • Robot Control - Position robot arm for maintenance

LTFS Support

  • Format Tapes - Format tapes with LTFS filesystem
  • Mount/Unmount - Mount LTFS tapes as regular filesystems
  • File Browser - Browse, upload, and download files on mounted tapes
  • Filesystem Check - Verify and repair LTFS filesystem integrity
  • Sync Control - Manual sync to flush metadata to tape

Drive Operations

  • Drive Status - View tape drive status and information
  • Rewind - Rewind tape to beginning
  • Eject - Eject tape from drive
  • Retension - Retension tape for optimal performance
  • Erase - Quick or full erase of tape

Tape Database

  • Tape Inventory - Track all tapes with labels, notes, and metadata
  • History Tracking - Complete history of all tape operations
  • Search & Filter - Find tapes by barcode, label, or notes
  • Sync with Library - Auto-discover tapes from library

Screenshots

The plugin provides a modern, dark-themed interface that integrates seamlessly with Unraid's web UI.

Requirements

Required Packages

  • mtx - For tape changer/robot control
  • mt-GNU - For tape drive control
  • lsscsi - For SCSI device discovery
  • sg3_utils - For SCSI generic utilities

Optional Packages

  • LTFS - For Linear Tape File System support (required for LTFS features)

Hardware

  • SCSI or SAS tape library/autoloader
  • LTO tape drive (LTO-5 or later recommended for LTFS)
  • Properly configured HBA with multi-LUN support

Installation

From Community Applications

  1. Open Unraid web interface
  2. Go to Apps (Community Applications)
  3. Search for "Tape Library"
  4. Click Install

Manual Installation

  1. Download the plugin file:
    wget https://github.com/und3f1ned/unraid-tape-library/raw/main/unraid-tape-library.plg
    
  2. Copy to your Unraid flash drive:
    cp unraid-tape-library.plg /boot/config/plugins/
    
  3. Install the plugin:
    installplg /boot/config/plugins/unraid-tape-library.plg
    

Configuration

Initial Setup

  1. Navigate to ToolsTape LibrarySettings
  2. Configure your devices:
    • Changer Device: SCSI generic device for the robot (e.g., /dev/sg1)
    • Tape Device: Tape drive device (e.g., /dev/st0)
    • SG Device: SCSI generic device for LTFS (e.g., /dev/sg0)
    • Mount Point: Where to mount LTFS tapes (default: /mnt/ltfs)

Finding Your Devices

Run the following command to identify your tape devices:

lsscsi -g

Look for entries like:

[2:0:0:0]    tape    HP       Ultrium 5-SCSI   ...  /dev/st0   /dev/sg0
[2:0:0:1]    mediumx HP       1x8 G2 AUTOLDR   ...  -          /dev/sg1
  • The tape device with /dev/sg* is your SG Device
  • The tape device with /dev/st* is your Tape Device
  • The mediumx device is your Changer Device

HP StoreEver 1/8 G2 Specific

For the HP StoreEver 1/8 G2 Tape Autoloader:

  1. Set the autoloader to Random mode via the front panel
  2. Ensure both LUN 0 (drive) and LUN 1 (changer) are visible
  3. The typical device mapping is:
    • Changer: /dev/sg1
    • Tape Drive: /dev/st0
    • SG for LTFS: /dev/sg0

Usage

Loading a Tape

  1. Go to ToolsTape Library
  2. Click on a slot containing a tape (highlighted in blue)
  3. Click Load Selected
  4. Choose the target drive and confirm

Mounting LTFS

  1. Load a tape into the drive
  2. Go to LTFS Operations page
  3. Click Mount LTFS
  4. Once mounted, use the File Browser to access files

Formatting a New Tape

  1. Load an unformatted tape into the drive
  2. Go to LTFS Operations page
  3. Enter a volume name (optional)
  4. Check the confirmation box
  5. Click Format Tape

File Operations

  1. Mount an LTFS tape
  2. Go to File Browser
  3. Use Upload to copy files from Unraid to tape
  4. Use Download to copy files from tape to Unraid
  5. Always Unmount before unloading the tape

Troubleshooting

"Device not ready" errors

  • Ensure the tape library is in Random mode (not Sequential)
  • Check that all SCSI LUNs are visible to the system
  • Verify the HBA supports multiple LUNs

LTFS mount fails

  • Ensure the tape is formatted with LTFS
  • Check if another process has the device open
  • Try the "Rollback mount" option for recovery

Slow performance

  • LTO tapes work best with large sequential writes
  • Use ltfs_ordered_copy for optimal file placement
  • Avoid many small file operations

Tape won't unload

  • Ensure LTFS is unmounted first
  • Try rewinding the tape before unloading
  • Check for any active processes using the tape

File Structure

/usr/local/emhttp/plugins/unraid-tape-library/
├── TapeLibrary.page          # Main dashboard
├── TapeLibraryLTFS.page      # LTFS operations
├── TapeLibraryTapes.page     # Tape database
├── TapeLibraryFiles.page     # File browser
├── TapeLibrarySettings.page  # Configuration
├── TapeLibraryHistory.page   # Activity history
├── include/
│   ├── TapeLibrary.php       # Core PHP library
│   ├── helpers.php           # Helper functions
│   └── api.php               # REST API endpoint
├── css/
│   └── tape-library.css      # Styles
├── js/
│   └── tape-library.js       # Frontend JavaScript
└── scripts/
    └── tape-operations.sh    # Shell script helpers

/boot/config/plugins/unraid-tape-library/
├── tape-library.cfg          # Configuration file
└── tapes.json                # Tape database

API Reference

The plugin provides a REST API at /plugins/unraid-tape-library/include/api.php

Changer Operations

  • action=changer_status - Get library status
  • action=load_tape&slot=N&drive=0 - Load tape
  • action=unload_tape&slot=N&drive=0 - Unload tape
  • action=transfer_tape&from_slot=N&to_slot=M - Transfer tape
  • action=inventory - Run inventory scan

LTFS Operations

  • action=mount - Mount LTFS
  • action=unmount - Unmount LTFS
  • action=format_tape&volume_name=NAME - Format tape
  • action=check_tape&deep=false - Check filesystem

File Operations

  • action=list_files&path=/ - List files
  • action=copy_to_tape&source=PATH&destination=/ - Copy to tape
  • action=copy_from_tape&source=/file&destination=PATH - Copy from tape

Contributing

Contributions are welcome! Please submit pull requests to the GitHub repository.

License

This project is licensed under the MIT License.

Acknowledgments

Support

About

Tape library management plugin for Unraid with full LTFS (Linear Tape File System) support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •