Site icon Voina Blog (a tech warrior's blog)

LTFS on Fedora Linux

Advertisements

The following are the steps to set up LTFS with a HP Ultrium 3000 and Fedora.
STEP 1: Download from HP site and install HP Library & Tape Tools (hp_ltt418_linux_x86_64.tar).

STEP 2: Download the HP Store Open Standalone binaries for RHEL x64 from the HP website. (HP_StoreOpen_Standalone_2.3.0_for_RHELx64_Z7550-01726.tar.gz)

STEP 3: Install the rpm on Fedora Linux. Note that some hacks have to be done to be able to install the binaries.
The following dependencies have to be met:

a. FUSE 2.8.5 or higher (http://fuse.sourceforge.net/)
b. ICU v50.1.2 (http://site.icu-project.org/download)
c. libxml2 v2.7 or higher
d. e2fsprogs 1.41 or higher

The biggest issue was caused by ICU library but with some small manual made sym links to the newer libs it can be worked out.

STEP 4: Prepare a LTO-5 tape for LTFS
Insert a new LTO-5 tape into the tape drive. Format the new tape as a ltfs tape.

[root@nas2]# mkltfs -d /dev/st0
LTFS15000I Starting mkltfs, HP StoreOpen Standalone version 2.3.0, log level 2
LTFS15041I Launched by “mkltfs -d /dev/st0”
LTFS15042I This binary is built for Linux (x86_64)
LTFS15043I GCC version is 4.4.4 20100726 (Red Hat 4.4.4-13)
LTFS17087I Kernel version: Linux version 4.0.4-301.fc22.x86_64 (mockbuild@bkernel02.phx2.fedoraproject.org) (gcc version 5.1.1 20150422 (Red Hat 5.1.1-1) (GCC) ) #1 SMP Thu May 21 13:10:33 UTC 2015 i386
LTFS17089I Distribution: Fedora release 22 (Twenty Two)
LTFS17089I Distribution: NAME=Fedora
LTFS17089I Distribution: Fedora release 22 (Twenty Two)
LTFS17089I Distribution: Fedora release 22 (Twenty Two)
LTFS15003I Formatting device ‘/dev/st0’
LTFS15004I LTFS volume blocksize: 524288
LTFS15005I Index partition placement policy: None
LTFS17085I Plugin: Loading “ltotape” driver
LTFS20013I Drive type is HP LTO5, serial number is
LTFS17160I Maximum device block size is 524288
LTFS15049I Checking the medium (mount)
LTFS15010I Creating data partition b on SCSI partition 1
LTFS15011I Creating index partition a on SCSI partition 0
LTFS17165I Resetting the medium’s capacity proportion
LTFS11097I Partitioning the medium
LTFS11100I Writing label to partition b
LTFS11278I Writing index to partition b
LTFS11100I Writing label to partition a
LTFS11278I Writing index to partition a
LTFS15013I Volume UUID is:
LTFS15019I Volume capacity is 1335 GB
LTFS20076I Triggering drive diagnostic dump
LTFS20096I Diagnostic dump complete
LTFS15024I Medium formatted successfully

AS you can see two partitions were created on the tape:
a = index partition
b = data partition
with a final volume capacity 1335 GB

STEP 5: Mount the LTFS
To mount the ltfs tape simply call the ltfs command.

[root@nas2]# ltfs -o devname=/dev/st0 /media/lto5
ab41 LTFS14000I LTFS starting, HP StoreOpen Standalone version 2.3.0, log level 2
ab41 LTFS14058I LTFS Format Specification version 2.2.0
ab41 LTFS14104I Launched by “ltfs -o devname=/dev/st0 /media/lto5”
ab41 LTFS14105I This binary is built for Linux (x86_64)
ab41 LTFS14106I GCC version is 4.4.4 20100726 (Red Hat 4.4.4-13)
ab41 LTFS17087I Kernel version: Linux version 4.0.4-301.fc22.x86_64 (mockbuild@bkernel02.phx2.fedoraproject.org) (gcc version 5.1.1 20150422 (Red Hat 5.1.1-1) (GCC) ) #1 SMP Thu May 21 13:10:33 UTC 2015 i386
ab41 LTFS17089I Distribution: Fedora release 22 (Twenty Two)
ab41 LTFS17089I Distribution: NAME=Fedora
ab41 LTFS17089I Distribution: Fedora release 22 (Twenty Two)
ab41 LTFS17089I Distribution: Fedora release 22 (Twenty Two)
ab41 LTFS14063I Sync type is “time”, Sync time is 300 sec
ab41 LTFS17085I Plugin: Loading “ltotape” driver
ab41 LTFS17085I Plugin: Loading “unified” iosched
ab41 LTFS20013I Drive type is HP LTO5, serial number is
ab41 LTFS17160I Maximum device block size is 524288
ab41 LTFS11005I Mounting the volume
ab41 LTFS17302W Cannot retrieve attribute (Barcode=0x806)
ab41 LTFS14111I Initial setup completed successfully
ab41 LTFS14112I Invoke ‘mount’ command to check the result of final setup
ab41 LTFS14113I Specified mount point is listed if succeeded

As a result the tape is mounted as a drive under /media/lto5

[root@nas2]# df -h
Filesystem Size Used Avail Use% Mounted on
….
ltfs:/dev/st0 1.4T 0 1.4T 0% /media/lto5

STEP 6: Copy files with ltfscopy, the optimized copy tool.
The ltfscopy is a tool optimized to work with the ltfs file system, for faster file copy to tape.

[root@nas2]# time ltfscopy -c -s /media/storage/sourcedir -d /media/lto5 -r

STEP 7: Unmount the LTFS tape.
It is very important to unmount the tape before ejecting it, otherwise the file system can be corrupted. To safely unmount the tape do as you do for any USB drive that is connected to your machine.

[root@nas2]# unmount /media/lto5

Let the tape drive finish committing the pending writes and rewind the tape. After that is safe to eject the tape.

STEP 8: Eject the tape media from the drive.
Eject the tape from the drive by pushing the tape drive eject button or using the following command

[root@nas2]# mt -f /dev/st0 eject

Latter Update:

I revisited this post due to an updated situation. Looks like the compiled version from HP (at the time of writing this the last public versions are 3.4.2 and 3.5.0) are no longer working on newer Fedora 37+ due to some incompatible libraries (some deprecated libraries were removed).

As a result the only way to make ltfs tools to work again is to compile them from sources.

The following are some repos with copies of the HP LTFS open source sources.

HP LTFS 3.5.0 and HP LTFS 3.4.2

Just download or clone the repos and follow the instructions to compile and install the tools.

Exit mobile version