独立磁带驱动器的 LTFS 格式规范的参考实现
Linear Tape File System (LTFS) is a filesystem to mount a LTFS formatted tape in a tape drive. Once LTFS mounts a LTFS formatted tape as filesystem, user can access to the tape via filesystem API.
Objective of this project is being the reference implementation of the LTFS format Specifications in SNIA.
At this time, the target of this project to meet is the LTFS format specifications 2.4. (https://www.snia.org/sites/default/files/technical_work/LTFS/LTFS_Format_2.4.0_TechPosition.pdf).
LTFS Format Specification is specified data placement, shape of index and names of extended attributes for LTFS. This specification is defined in SNIA first and then it is forwarded to ISO as ISO/IEC 20919 from version 2.2.
The table below show status of the LTFS format Specification
| Version | Status of SNIA | Status of ISO |
|---|---|---|
| 2.2 | Published | Published as 20919:2016 |
| 2.3.1 | Published | - |
| 2.4 | Published | - |
This section is for person who already have a machine the LTFS is installed.
Instruction how to use the LTFS is on Wiki. Please take a look!
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Linux
OSX (macOS)
Following packages on homebrew
FreeBSD:
NetBSD:
| Vendor | Drive Type | Minimum F/W Level |
|---|---|---|
| IBM | LTO5 | B170 |
| IBM | LTO6 | None |
| IBM | LTO7 | None |
| IBM | LTO8 | HB81 |
| IBM | LTO9 | None |
| IBM | TS1140 | 3694 |
| IBM | TS1150 | None |
| IBM | TS1155 | None |
| IBM | TS1160 | None |
| HP | LTO5 | T.B.D. |
| HP | LTO6 | T.B.D. |
| HP | LTO7 | T.B.D. |
| HP | LTO8 | T.B.D. |
| HP | LTO9 | T.B.D. |
| Quantum | LTO5 (Only Half Height) | T.B.D. |
| Quantum | LTO6 (Only Half Height) | T.B.D. |
| Quantum | LTO7 (Only Half Height) | T.B.D. |
| Quantum | LTO8 (Only Half Height) | T.B.D. |
| Quantum | LTO9 (Only Half Height) | T.B.D. |
LTFS Format Specification is specified data placement, shape of index and names of extended attributes for LTFS. This specification is defined in SNIA first and then it is forwarded to ISO as ISO/IEC 20919 from version 2.2.
The table below show status of the LTFS format Specification
| Version | Status of SNIA | Status of ISO |
|---|---|---|
| 2.2 | Published | Published as 20919:2016 |
| 2.3.1 | Published | - |
| 2.4 | Published | - |
| 2.5.1 | Published | Published as 20919:2021 |
This section is for a person who already has a machine with the LTFS installed. Instructions on how to use the LTFS is also available on Wiki.
# ltfs -o device_list
The output is as follows. You have 3 drives in this example and you can use "Device Name" field, like /dev/sg43 in this case, as the argument of ltfs command to mount the tape drive.
…
As described in the LTFS format specifications, LTFS uses the partition feature of the tape drive. This means you can't use a tape just after you purchase a tape. You need format the tape before using it on LTFS.
To format a tape, you can use mkltfs command like
# mkltfs -d 9A700L0077
In this case, mkltfs tries to format a tape in the tape drive 9A700L0077. You can use the device name /dev/sg43 instead.
After you prepared a formatted tape, you can mount it through a tape drive like
# ltfs -o devname=9A700L0077 /ltfs
In this command, the ltfs command will try to mount the tape in the tape drive 9A700L0077 to /ltfs directory. Of course, you can use a device name /dev/sg43 instead.
If the mount process is successfully done, you can access to the LTFS tape through /ltfs directory.
You must not touch any st devices while ltfs is mounting a tape.
You can use following command when you want to unmount the tape. The ltfs command try to write the current meta-data to the tape and close the tape cleanly.
# umount /ltfs
One thing you need to pay attention to here is, that the unmount command continues to work in the background after it returns. It just initiates a trigger to notify the the ltfs command of the unmount request. Actual unmount is completed when the ltfs command is finished.
ltfs_ordered_copy utilityThe ltfs_ordered_copy is a program to copy files from source to destination with LTFS order optimization.
It is written in python and it can work with both python2 and python3 (Python 2.7 or later is strongly recommended). You need to install the pyxattr module for both python2 and python3.
These instructions will get a copy of the project up and running on your local machine for development and testing purposes.
Please refer this page.
./autogen.sh
./configure
make
make install
./configure --help shows various options for build and install.
In some systems, you might need sudo ldconfig -v after make install to load the shared libraries correctly.
LTFS uses the sg driver by default. You can improve reliability to change parameters of the sg driver below.
def_reserved_size=1048576
In RHEL7, you can put following file as /etc/modprobe.d/sg.conf.
options sg def_reserved_size=1048576
You can check current configuration of sg driver to see the file /proc/scsi/sg/debug like
$ cat /proc/scsi/sg/debug
max_active_device=44 def_reserved_size=32768
>>> device=sg25 1:0:10:0 em=0 sg_tablesize=1024 excl=0 open_cnt=1
FD(1): timeout=60000ms bufflen=524288 (res)sgat=16 low_dma=0
cmd_q=1 f_packid=0 k_orphan=0 closed=0
No requests active
>>> device=sg26 1:0:10:1 em=0 sg_tablesize=1024 excl=0 open_cnt=1
FD(1): timeout=60000ms bufflen=524288 (res)sgat=16 low_dma=0
cmd_q=1 f_packid=0 k_orphan=0 closed=0
No requests active
You can improve performance to change parameters of the sg driver below. But this option may cause I/O error reported as #144 in some HBAs.
allow_dio=1
In RHEL7, you can put following file as /etc/modprobe.d/sg.conf.
options sg allow_dio=1
At this time, we know following HBA's works correctly.
And following HBA's doesn't work correctly.
In the lpfc driver (for Emulex Fibre HBAs), the table size of the scatter-gather is 64 by default. This configuration may cause I/O errors intermittently when allow_dio=1 is set and scatter-gather table cannot be reserved. To avoid this error, you need to change the parameter lpfc_sg_seg_cnt to 256 or greater like below.
options lpfc lpfc_sg_seg_cnt=256
In some versions of the lpfc driver (for Emulex Fibre HBAs), the table size of the scatter-gather cannot be changed correctly. You can check the value is changed or not in sg_tablesize value in /proc/scsi/sg/debug. If you don't have a correct value (256 or greater) in sg_tablesize, removing allow_dio=1 configuration of the sg driver is strongly recommended.
LTFS doesn't support the HBAs which doesn't handle the transfer length of SCSI data by default. The reason is because the safety of the data but LTFS provides a option to relax this limitation.
You can use such kind of HBAs if you run the configure script with --enable-buggy-ifs option and build.
List of the HBA --enable-buggy-ifs is needed is below.
HBA list require --enable-buggy-ifs
You need to add --enable-lintape as an argument of ./configure script if you want to build the backend for lin_tape. You also need to add DEFAULT_TAPE=lin_tape if you set the lin_tape backend as default backend.
| Dist | Arch | Status | |:----------------------------------:|:--
暂无开放 Issues,或尚未同步最近议题。