Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We love pull requests from everyone.

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a [coding style guide](../docs/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
Please note we have a [coding style guide](/docs/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.

1. Fork, then clone the repo

Expand All @@ -25,5 +25,5 @@ Please note we have a [coding style guide](../docs/CODE_OF_CONDUCT.md), please f

__Some things that will increase the chance that your pull request is accepted__

* Follow our [coding style guide](../docs/CODE_OF_CONDUCT.md).
* Follow our [coding style guide](/docs/CODE_OF_CONDUCT.md).
* Write a good commit message.
114 changes: 98 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![](https://img.shields.io/github/issues/lineartapefilesystem/ltfs.svg)
![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/CentOS7%20Build%20Job/badge.svg?branch=master)
![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-centos8.yml/badge.svg)
[![BSD License](http://img.shields.io/badge/license-BSD-blue.svg?style=flat)](LICENSE)

# Linear Tape File System (LTFS)
Expand Down Expand Up @@ -105,7 +105,89 @@ These instructions will get you a copy of the project up and running on your loc

## Installing

### Build and install on Linux
LTFS Format Specification is specified data placement, shape of index and names of extended attributes for LTFS. This specification is defined in [SNIA](https://www.snia.org/tech_activities/standards/curr_standards/ltfs) first and then it is forwarded to [ISO](https://www.iso.org/home.html) 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](http://snia.org/sites/default/files/LTFS_Format_2.2.0_Technical_Position.pdf) | [Published as `20919:2016`](https://www.iso.org/standard/69458.html) |
| 2.3.1 | [Published](https://www.snia.org/sites/default/files/technical_work/LTFS/LTFS_Format_2.3.1_TechPosition.PDF) | - |
| 2.4 | [Published](https://www.snia.org/sites/default/files/technical_work/LTFS/LTFS_Format_2.4.0_TechPosition.pdf) | - |
| 2.5.1 | [Published](https://www.snia.org/sites/default/files/technical-work/ltfs/release/SNIA-LTFS-Format-2-5-1-Standard.pdf) | [Published as `20919:2021`](https://www.iso.org/standard/80598.html) |

# How to use the LTFS (Quick start)

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](https://github.com/LinearTapeFileSystem/ltfs/wiki).

## Step1: List tape drives

`# 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.

```
50c4 LTFS14000I LTFS starting, LTFS version 2.4.0.0 (10022), log level 2.
50c4 LTFS14058I LTFS Format Specification version 2.4.0.
50c4 LTFS14104I Launched by "/home/piste/ltfsoss/bin/ltfs -o device_list".
50c4 LTFS14105I This binary is built for Linux (x86_64).
50c4 LTFS14106I GCC version is 4.8.5 20150623 (Red Hat 4.8.5-11).
50c4 LTFS17087I Kernel version: Linux version 3.10.0-514.10.2.el7.x86_64 (mockbuild@x86-039.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Mon Feb 20 02:37:52 EST 2017 i386.
50c4 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux Server".
50c4 LTFS17089I Distribution: Red Hat Enterprise Linux Server release 7.3 (Maipo).
50c4 LTFS17089I Distribution: Red Hat Enterprise Linux Server release 7.3 (Maipo).
50c4 LTFS17085I Plugin: Loading "sg" tape backend.
Tape Device list:.
Device Name = /dev/sg43, Vender ID = IBM , Product ID = ULTRIUM-TD5 , Serial Number = 9A700L0077, Product Name = [ULTRIUM-TD5] .
Device Name = /dev/sg38, Vender ID = IBM , Product ID = ULT3580-TD6 , Serial Number = 00013B0119, Product Name = [ULT3580-TD6] .
Device Name = /dev/sg37, Vender ID = IBM , Product ID = ULT3580-TD7 , Serial Number = 00078D00C2, Product Name = [ULT3580-TD7] .
```

## Step2: Format a tape

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.

## Step3: Mount a tape through a tape drive

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.

## Step4: Unmount the tape drive

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.

## The `ltfs_ordered_copy` utility

The [`ltfs_ordered_copy`](https://github.com/LinearTapeFileSystem/ltfs/wiki/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.

# Building the LTFS from this GitHub project

These instructions will get a copy of the project up and running on your local machine for development and testing purposes.

## Prerequisites for build

Please refer [this page](https://github.com/LinearTapeFileSystem/ltfs/wiki/Build-Environments).

## Build and install on Linux

```
./autogen.sh
Expand Down Expand Up @@ -198,20 +280,20 @@ You need to add `--enable-lintape` as an argument of ./configure script if you w

| Dist | Arch | Status |
|:----------------------------------:|:-------:|:--------------------------------------------------------------------------------------------------------------------------------:|
| RHEL 8 | x86_64 | OK |
| RHEL 8 | ppc64le | OK |
| CentOS 8 (Rocky Linux) | x86_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/CentOS8%20Build%20Job/badge.svg?branch=master) |
| CentOS 8 (Rocky Linux) | ppc64le | Probably OK |
| Fedora 28 | x86_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/Fedora28%20Build%20Job/badge.svg?branch=master) |
| Ubuntu 16.04 LTS | x86_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/Ubuntu%2016.04%20Build%20Job/badge.svg?branch=master) |
| Ubuntu 16.04 LTS | ppc64le | Probably OK |
| Ubuntu 18.04 LTS | x86_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/Ubuntu%2018.04%20Build%20Job/badge.svg?branch=master) |
| Ubuntu 18.04 LTS | ppc64le | Probably OK |
| Ubuntu 20.04 LTS (Need icu-config) | x86_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/Ubuntu%2020.04%20Build%20Job/badge.svg?branch=master) |
| Debian 9 | x86_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/Debian9%20Build%20Job/badge.svg?branch=master) |
| Debian 10 (Need icu-config) | x86_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/workflows/Debian10%20Build%20Job/badge.svg?branch=master) |
| ArchLinux 2018.08.01 | x86_64 | Not checked automatically |
| ArchLinux 2018.12.31 (rolling) | x86_64 | Not checked automatically |
| RHEL 8 | x86\_64 | OK - Not checked automatically |
| RHEL 8 | ppc64le | OK - Not checked automatically |
| CentOS 8 (Rocky Linux) | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-centos8.yml/badge.svg) |
| CentOS 8 (Rocky Linux) | ppc64le | OK - Not checked automatically |
| Fedora 28 | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-fedora28.yml/badge.svg) |
| Ubuntu 16.04 LTS | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-ubuntu-xeneal.yml/badge.svg) |
| Ubuntu 16.04 LTS | ppc64le | OK - Not checked automatically |
| Ubuntu 18.04 LTS | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-ubuntu-bionic.yml/badge.svg) |
| Ubuntu 18.04 LTS | ppc64le | OK - Not checked automatically |
| Ubuntu 20.04 LTS (Need icu-config) | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-ubuntu-focal.yml/badge.svg) |
| Debian 9 | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-debian9.yml/badge.svg) |
| Debian 10 (Need icu-config) | x86\_64 | ![GH Action status](https://github.com/LinearTapeFileSystem/ltfs/actions/workflows/build-debian10.yml/badge.svg) |
| ArchLinux 2018.08.01 | x86\_64 | OK - Not checked automatically |
| ArchLinux 2018.12.31 (rolling) | x86\_64 | OK - Not checked automatically |

Currently, automatic build checking is working on GitHub Actions and Travis CI.

Expand Down
6 changes: 3 additions & 3 deletions messages/internal_error/root.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ root:table {
I1093E:string{ "Cannot remove the drive: 'Critical' cartridge is loaded." }
I1094E:string{ "Cannot add the drive: the drive is already added." }
I1095E:string{ "Unexpected inventory rebuild error (have to manage within LTFS itself)." }
I1096E:string{ "Library failes to get inventory. Try to unmount LTFS and re-mount LTFS again." }
I1096E:string{ "Library failed to get inventory. Try to unmount LTFS and re-mount LTFS again." }
I1097E:string{ "Operation needs to be restarted." }
I1098E:string{ "No target drive is found." }
I1099E:string{ "No supported filesystem type for dcache is in this system." }
Expand Down Expand Up @@ -191,7 +191,7 @@ root:table {
I1138E:string{ "Specified block size is not correct." }
I1139E:string{ "Specified volume name is not correct." }
I1140E:string{ "Specified placement policy is not correct." }
I1141E:string{ "Need to specify a genaration to be rollbacked." }
I1141E:string{ "Need to specify a generation to be rollbacked." }
I1142E:string{ "Specified generation is not correct." }
I1143E:string{ "Rollback target generation is not specified." }
I1144E:string{ "Multiple target indexes were found on the cartridge." }
Expand Down Expand Up @@ -275,7 +275,7 @@ root:table {
I5014E:string{ "Wrong UUID is detected." }
I5015E:string{ "Cannot parse generation number correctly." }
I5016E:string{ "Cannot parse index's updatetime correctly." }
I5017E:string{ "Wrong tape position of index or labal is detected." }
I5017E:string{ "Wrong tape position of index or label is detected." }
I5018E:string{ "Wrong tape position of previous index is detected." }
I5019E:string{ "Unexpected policyupdate value is detected." }
I5020E:string{ "Wrong policy value is detected." }
Expand Down
16 changes: 8 additions & 8 deletions messages/libltfs/root.txt
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ root:table {
11319E:string { "Cannot add the key to hash table at %s (%d)." }
11320E:string { "Cannot search the key from hash table at %s (%d)." }
11321E:string { "Symbolic link might be replaced by data file. Use ltfsck for recovery." }
11322D:string { "Makeing a symlink '%s' target '%s'." }
11323D:string { "Symlink EA prefix valuse is (%s)." }
11322D:string { "Making a symlink '%s' target '%s'." }
11323D:string { "Symlink EA prefix value is (%s)." }
11324D:string { "Path changed from '%s' to '%s'." }
11325E:string { "Cannot set extended attribute: failed to flush (%d)." }
11326E:string { "Cannot write index: failed to flush buffered data (%d)." }
Expand Down Expand Up @@ -546,7 +546,7 @@ v
// Message IDs 16000-16499 are reserved for the ltfsck executable.
// DO NOT add messages with those IDs to this file.

// Message IDs 16500-16999 are reserved for the cartrige repository plugins.
// Message IDs 16500-16999 are reserved for the cartridge repository plugins.
// DO NOT add messages with those IDs to this file.

17000E:string { "XML parser: not all required tags found in \'%s\'." }
Expand Down Expand Up @@ -664,7 +664,7 @@ v
17111I:string { "The MAM was written by PGA2 or later." }
17112I:string { "Starting EOD recovery (GA/PGA1)." }
17113I:string { "Starting EOD recovery: reading an index from (%llu, %llu)." }
17114I:string { "Seaching the final index in IP." }
17114I:string { "Searching the final index in IP." }
17115E:string { "Failed to search the final index in IP." }
17116I:string { "Detecting the final record in DP." }
17117E:string { "Failed to search the final index in DP." }
Expand All @@ -673,7 +673,7 @@ v
17120I:string { "Reading the final index in %s (%llu, %llu)." }
17121E:string { "Failed to read the final index in %s (%d)." }
//unused 17122I:string { "Search one more index after current index (%llu, %llu)." }
17123E:string { "Unexpected genaration value (Gen = %d, MAM IP = %d, MAM DP = %d)." }
17123E:string { "Unexpected generation value (Gen = %d, MAM IP = %d, MAM DP = %d)." }
17124I:string { "Seeking to the final record in %s (%llu, %llu)." }
17125E:string { "Failed to seek to the final record in %s (%d)." }
17126E:string { "Unexpected EOD status (%d, %d)." }
Expand Down Expand Up @@ -709,7 +709,7 @@ v
17156E:string { "Cannot get WRITE MODE: Mode Sense for Device Configuration Extension failed (%d)." }
17157I:string { "Changing the drive setting %s." }
//unused 17158E:string { "Cannot set up tape drive." }
17159I:string { "Process was interruped by user." }
17159I:string { "Process was interrupted by user." }
17160I:string { "Maximum device block size is %d." }
17161I:string { "EOD information (%s) is corrupted." }
17162I:string { "Trying a simple recovery that requires several minutes to complete." }
Expand Down Expand Up @@ -754,7 +754,7 @@ v
17201I:string { "Starting a long wipe operation. This can take over 3 hours." }
17202E:string { "Failed to wipe the medium (%d)." }
17203W:string { "Truncate the tape attribute: %s (%s) to %d bytes." }
17204W:string { "Cannot set: unkown tape attribute type(0x%04x): %s." }
17204W:string { "Cannot set: unknown tape attribute type(0x%04x): %s." }
17205E:string { "Cannot set the tape attribute (type: 0x%04x): %s ." }
17206E:string { "Cannot write XML data to file descriptor (%s, %d, %lu)." }
17207E:string { "Use the ltfsck command with the --salvage-rollback-points option and select the latest index from the list\n Then use the ltfs command with the -o rollback-mount-no-eod option by specifying the generation." }
Expand Down Expand Up @@ -825,7 +825,7 @@ v
17281I:string { "Failed to read from RAO input file: %s (%d)." }
17282I:string { "Read length from RAO input file is unexpected: %s (Actual %ld, Expected %ld)." }
17283I:string { "Detected unmatched VCR value between MAM and VCR (%llu, %llu)." }
17284I:string { "Seaching the final index in %s." }
17284I:string { "Searching the final index in %s." }
17285E:string { "Failed to search the final index in %s (%d)." }
17286I:string { "VCR value is matched between %s-MAM and VCR (%llu)." }
17287I:string { "Making R/O mount from the location (%c, %llu)." }
Expand Down
9 changes: 5 additions & 4 deletions src/tape_drivers/hp_tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@
#include "libltfs/ltfs_endian.h"

struct supported_device *hp_supported_drives[] = {
TAPEDRIVE( HP_VENDOR_ID, "Ultrium 5-SCSI", DRIVE_LTO5, "[Ultrium 5-SCSI]" ), /* HP Ultrium Gen 5 */
TAPEDRIVE( HP_VENDOR_ID, "Ultrium 6-SCSI", DRIVE_LTO6, "[Ultrium 6-SCSI]" ), /* HP Ultrium Gen 6 */
TAPEDRIVE( HP_VENDOR_ID, "Ultrium 7-SCSI", DRIVE_LTO7, "[Ultrium 7-SCSI]" ), /* HP Ultrium Gen 7 */
TAPEDRIVE( HPE_VENDOR_ID, "Ultrium 8-SCSI", DRIVE_LTO8, "[Ultrium 8-SCSI]" ), /* HPE Ultrium Gen 8 */
TAPEDRIVE( HP_VENDOR_ID, "Ultrium 5-SCSI", DRIVE_LTO5, "[Ultrium 5-SCSI]" ), /* HP Ultrium Gen 5 */
TAPEDRIVE( HP_VENDOR_ID, "Ultrium 6-SCSI", DRIVE_LTO6, "[Ultrium 6-SCSI]" ), /* HP Ultrium Gen 6 */
TAPEDRIVE( HP_VENDOR_ID, "Ultrium 7-SCSI", DRIVE_LTO7, "[Ultrium 7-SCSI]" ), /* HP Ultrium Gen 7 */
TAPEDRIVE( HPE_VENDOR_ID, "Ultrium 8-SCSI", DRIVE_LTO8, "[Ultrium 8-SCSI]" ), /* HPE Ultrium Gen 8 */
TAPEDRIVE( HPE_VENDOR_ID, "Ultrium 9-SCSI", DRIVE_LTO9, "[Ultrium 9-SCSI]" ), /* HPE Ultrium Gen 9 */
/* End of supported_devices */
NULL
};
Expand Down
Loading
Loading