https://github.com/LinearTapeFileSystem/ltfs

hostnamectl; # tested on
 Static hostname: ubuntuxts
  Virtualization: kvm
Operating System: Ubuntu 22.04.4 LTS              
          Kernel: Linux 5.15.0-107-generic
    Architecture: x86-64

hostnamectl; # also tested on
Virtualization: kvm
Operating System: Debian GNU/Linux 12 (bookworm) 
Kernel: Linux 6.1.0-34-amd64
Architecture: x86-64
Hardware Vendor: QEMU

su - root
apt install build-essential module-assistant gcc make perl dkms linux-headers-$(uname -r)
apt -y install automake; # 1.13.4 or later
apt -y install autoconf; # 2.69 or later
apt -y install libtool-bin; # 2.4.2 or later
apt -y install libfuse-dev; # 2.6.0 or later
apt -y install uuid-dev; # 1.36 or later
apt -y install libxml2-dev; # 2.6.16 or later, not: libxmlb2 libxml2

apt -y install snmpd snmp libsnmp-dev; # net-snmp 5.3 or later
apt -y install libicu-dev; # icu4c 4.8 or later
apt -y install pkg-config;

# Ctrl+D no need to be root during compilation?

git clone https://github.com/LinearTapeFileSystem/ltfs.git;

cd ltfs;

./autogen.sh; ./configure; make;

# except for the last step, installing the binaries into the system
sudo make install
sudo ldconfig

ltfs --version
LTFS version 2.5.0.0 (Prelim).
LTFS Format Specification version 2.4.0

# might be a good idea to reboot afterwards

howto LTFS

ltfs -o device_list
Device Name = /dev/sg2 (0.0.1.0), Vendor ID = IBM , Product ID = ULT3580-HH5 , Serial Number = 10WT036509, Product Name =[ULT3580-HH5].
Device Name = /dev/sg0 (0.0.0.0), Vendor ID = IBM , Product ID = ULT3580-HH5 , Serial Number = 10WT036509, Product Name =[ULT3580-HH5].

# ltfs format tape in TapeDriveA0
mkltfs -f -d /dev/st0

# ltfs format tape in TapeDriveA1
mkltfs -f -d /dev/st1

# sample output
LTFS15000I Starting mkltfs, LTFS version 2.5.0.0 (Prelim), log level 2.
LTFS15041I Launched by "mkltfs -f -d /dev/st0".
LTFS15042I This binary is built for Linux (x86_64).
LTFS15043I GCC version is 12.2.0.
LTFS17087I Kernel version: Linux version 6.1.0-34-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.135-1 (2025-04-25) i386.
LTFS17089I Distribution: PRETTY_NAME="Debian GNU/Linux 12 (bookworm)".
LTFS15003I Formatting device '/dev/st0'.
LTFS15004I LTFS volume blocksize: 524288.
LTFS15005I Index partition placement policy: None.

LTFS11337I Update index-dirty flag (1) - NO_BARCODE (0x0x559e77c99990).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/st0).
LTFS30250I Opened the SCSI tape device 0.0.0.-1 (/dev/st0).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH5     .
LTFS30214I Firmware revision is H971.
LTFS30215I Drive serial is 10WT036509.
LTFS30285I The reserved buffer size of /dev/st0 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS15049I Checking the medium (load).
LTFS30252I Logical block protection is disabled.
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.
LTFS30263I MODESELECT returns Mode Parameters Rounded (-20101) /dev/st0.
LTFS11100I Writing label to partition b.
LTFS11278I Writing index to partition b.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/st0.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to b (Reason: Format, 0 files) 10WT036509.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = b, Pos = 5, 10WT036509).
LTFS11337I Update index-dirty flag (0) - NO_BARCODE (0x0x559e77c99990).
LTFS11100I Writing label to partition a.
LTFS11278I Writing index to partition a.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/st0.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to a (Reason: Format, 0 files) 10WT036509.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = a, Pos = 5, 10WT036509).
LTFS15013I Volume UUID is: 38b0d1af-4c19-4f3b-8122-66353a6a1395.

LTFS15019I Volume capacity is 1425 GB.
LTFS30252I Logical block protection is disabled.
LTFS15024I Medium formatted successfully.

https://github.com/amiaopensource/ltfs/tree/master?tab=readme-ov-file
https://github.com/amiaopensource/ltfs/blob/master/README

==== how to mount LTFS tape ====

# it can be mounted like a harddisk (partition)
mt -f /dev/st0 rewind; # rewind again
mtx -f /dev/sg1 status|grep Loaded; # what tape is loaded?
Data Transfer Element 0:Full (Storage Element 2 Loaded):VolumeTag = P0010SL5

mkdir /media/user/P0010SL5; # create mount point

ltfs -o devname=/dev/st0 /media/user/P0010SL5; # mount
8d6 LTFS14000I LTFS starting, LTFS version 2.5.0.0 (Prelim), log level 2.
8d6 LTFS14058I LTFS Format Specification version 2.4.0.
8d6 LTFS14104I Launched by "ltfs -o devname=/dev/st0 /media/user/P0010SL5".
8d6 LTFS14105I This binary is built for Linux (x86_64).
8d6 LTFS14106I GCC version is 12.2.0.
8d6 LTFS17087I Kernel version: Linux version 6.1.0-34-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.135-1 (2025-04-25) i386.
8d6 LTFS17089I Distribution: PRETTY_NAME="Debian GNU/Linux 12 (bookworm)".
8d6 LTFS14063I Sync type is "time", Sync time is 300 sec.
8d6 LTFS17085I Plugin: Loading "sg" tape backend.
8d6 LTFS17085I Plugin: Loading "unified" iosched backend.
8d6 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
8d6 LTFS30209I Opening a device through sg-ibmtape driver (/dev/st0).
8d6 LTFS30250I Opened the SCSI tape device 0.0.0.-1 (/dev/st0).
8d6 LTFS30207I Vendor ID is IBM     .
8d6 LTFS30208I Product ID is ULT3580-HH5     .
8d6 LTFS30214I Firmware revision is H971.
8d6 LTFS30215I Drive serial is 10WT036509.
8d6 LTFS30285I The reserved buffer size of /dev/st0 is 1048576.
8d6 LTFS30294I Setting up timeout values from RSOC.
8d6 LTFS17160I Maximum device block size is 1048576.
8d6 LTFS11330I Loading cartridge.
8d6 LTFS30252I Logical block protection is disabled.
8d6 LTFS11332I Load successful.
8d6 LTFS17157I Changing the drive setting to write-anywhere mode.
8d6 LTFS11005I Mounting the volume from device.
8d6 LTFS30252I Logical block protection is disabled.

8d6 LTFS17227I Tape attribute: Vendor = IBM     .
8d6 LTFS17227I Tape attribute: Application Name = LTFS                            .
8d6 LTFS17227I Tape attribute: Application Version = 2.5.0.0 .
8d6 LTFS17227I Tape attribute: Medium Label = .
8d6 LTFS17228I Tape attribute: Text Localization ID = 0x81.
8d6 LTFS17227I Tape attribute: Barcode =                                 .
8d6 LTFS17227I Tape attribute: Application Format Version = 2.4.0           .
8d6 LTFS17228I Tape attribute: Volume Lock Status = 0x00.
8d6 LTFS17227I Tape attribute: Media Pool name = .
8d6 LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 1 / (a, 5) -> (b, 5) / 10WT036509.
8d6 LTFS14122I Index will not be captured.
8d6 LTFS14111I Initial setup completed successfully.
8d6 LTFS14112I Invoke 'mount' command to check the result of final setup.
8d6 LTFS14113I Specified mount point is listed if succeeded.

# test if mount was success
df -h|grep P0010SL5
ltfs:/dev/st0 1.3T 3.0M 1.3T 1% /media/user/P0010SL5
# YESSSS! :D

Tux_FlickFlack

manpage:

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin