LTO Tape/6: Difference between revisions

From Bibliotheca Anonoma
Line 52: Line 52:
# mt -f /dev/nst0 defcompression -1
# mt -f /dev/nst0 defcompression -1
</pre>
</pre>
==== Block Size ====
A block size no larger than 256 KB (262144 bytes) is strongly recommended when working with HP-UX and tape or VTL devices. Backup applications should be configured to work with I/O block sizes that are no larger than 256 KB. Please check your application documentation to find out how to check or configure block sizes used for transfers to and from tape or VTL devices.
This is because, by default, the HP-UX stape driver processes a block size larger than 256 KB by subdividing it into 256 KB blocks for writing to tape (giving a net effect of 256 KB I/O transfers)
For example a 1 MB block (1048576 bytes) is written to tape as four 256 KB blocks. During restore, stape attempts to reconstruct the original block size that was larger than 256 KB with the 256 KB blocks from tape. This subdivision and subsequent reconstruction process of block sizes larger than 256 KB adds unnecessary complexity and risk to tape positioning and restore operations and offers no net gain in terms of increased block size. It should therefore be avoided.


=== LTFS (Medium) ===
=== LTFS (Medium) ===

Revision as of 01:55, 11 November 2019

Don't trust this information.

LTO-6 SAS Drive is assumed to be used (for now).

RHEL/CentOS 8, or Fedora 28 and up is assumed to be used in this guide, but tape drivers are part of the mainline Linux kernel and supported by all distros.


Links:

https://www.reddit.com/r/sysadmin/comments/3qfyhm/how_to_start_using_an_lto6_tape_backup_drive_with/cyxpzo5/ https://www.reddit.com/r/sysadmin/comments/3qfyhm/how_to_start_using_an_lto6_tape_backup_drive_with/ https://www.quantum.com/serviceandsupport/softwareanddocumentationdownloads/ltfs/index.aspx?whattab=Third https://www.ibm.com/support/knowledgecenter/en/STQNYL_2.2.2/ltfs_reference_tools_linux.html

HBA (Host Bus Adaptor)

Currently using: LSI 9267-8i 6Gb/s PCI-Express 2.0 512MB 8Port SATA/SAS + 8087 SATA Cable Battery

RAID-on-Chip Controller: LSISAS2208 Dual-Core RAID on Chip (ROC) Host Bus Type: x8 lane PCI Express® 2.0 Cache Memory:512MB 1333MHz DDRIII SDRAM Internal Ports: 8 Data Transfer Rates: Up to 6Gb/s per port Devices Supported: Up to 128 SAS and/or SATA devices Internal Connectors: 2 Mini-SAS SFF8087 (side mount)


Drive

LTO5 and up support LTFS. But all support Tar and BareOS.

LTO Tape Drive support is part of the mainline Linux kernel through the `st` module thanks to contributions from IBM, so no drivers are actually needed for a tape drive to work.

To check to see that a tape drive is accessible, first check that /dev/tape/by-id exists and contains an nst0 device. If so, the Linux kernel already detected your tape drive and no further drivers are necessary. As for software though...

Also add your normal user to group `tape`.

Backup Software

Backup Software determine the format of the data being pushed to the tape. We will only describe open source software available at no cost, because if you are an actual enterprise willing to pay big bucks stop reading this guide and start calling your IBM sales rep to purchase IBM Spectrum Protect(tm).

Tar (Simplest)

It is good to run tar to test write speed, though using it as a backup method leaves much to be desired, so rely on bareos after.

See LTO Tape. Make sure to always disable hardware compression using mt.

# mt -f /dev/nst0 compression 0
# mt -f /dev/nst0 defcompression -1

Block Size

A block size no larger than 256 KB (262144 bytes) is strongly recommended when working with HP-UX and tape or VTL devices. Backup applications should be configured to work with I/O block sizes that are no larger than 256 KB. Please check your application documentation to find out how to check or configure block sizes used for transfers to and from tape or VTL devices.

This is because, by default, the HP-UX stape driver processes a block size larger than 256 KB by subdividing it into 256 KB blocks for writing to tape (giving a net effect of 256 KB I/O transfers)

For example a 1 MB block (1048576 bytes) is written to tape as four 256 KB blocks. During restore, stape attempts to reconstruct the original block size that was larger than 256 KB with the 256 KB blocks from tape. This subdivision and subsequent reconstruction process of block sizes larger than 256 KB adds unnecessary complexity and risk to tape positioning and restore operations and offers no net gain in terms of increased block size. It should therefore be avoided.

LTFS (Medium)

Build from the upstream IBM source code rather than using vendor source code, which sucks. A handy source rpm is provided.

https://github.com/LinearTapeFileSystem/ltfs/wiki

https://github.com/piste2750/rpm-ltfs

https://fedoramagazine.org/how-rpm-packages-are-made-the-source-rpm/

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/packaging_and_distributing_software/packaging-software_packaging-and-distributing-software#building-source-rpms

All commands should be done as normal unprivileged user: the sudo commands are elevated to root.

In RHEL/CentOS 8, install the dependencies:

sudo dnf install rpm-build rpmdevtools

First, create the rpmbuild setuptree in your home directory.

rpmdev-setuptree

Download this .spec file, and place it into ~/rpmbuild/SPECS/ltfs.spec. Then run the following src.rpm packaging command.

rpmbuild -bb ~/rpmbuild/SPECS/ltfs.spec

Install the dependencies needed to build the source rpm.

sudo dnf builddep ~/rpmbuild/SRPMS/ltfs-2.4.1.2-10254.src.rpm

Build an rpm from a .src.rpm file:

rpmbuild --rebuild ~/rpmbuild/SRPMS/ltfs-2.4.1.2-10254.src.rpm

Now the rpms can be installed

cd ~/rpmbuild/RPMS/x86_64
sudo dnf localinstall ltfs-2.4.1.2-10254.x86_64.rpm  ltfs-debuginfo-2.4.1.2-10254.x86_64.rpm  ltfs-debugsource-2.4.1.2-10254.x86_64.rpm

Now the LTO Drive can be used. Skip all the build and install instructions in this post and use that:

https://www.reddit.com/r/sysadmin/comments/3qfyhm/how_to_start_using_an_lto6_tape_backup_drive_with/cyxpzo5/

BareOS (Enterprise)

Not an operating system, but "Backup Archiving REcovery Open Sourced" with tape as one key storage backend. It was forked from Bacula. Does not require LTFS.

https://www.bareos.org/en/


bareos-sd: container_name: bareos-sd image: barcus/bareos-storage devices: - /dev/tape/by-id/scsi-3500e09efff0f9bb6:/dev/tape/by-id/scsi-3500e09efff0f9bb6




Labelling Tapes

https://tapelabel.de/

https://tapelabel.de/lto-sample/lto-sample.html

IBM LTO Ultrium Cartridge Label Specification


I have been using Avery brand model "J8167" A4 size "Premium inkjet" "White Trueblock" "Mailing Labels" label sheets to reasonable short-term success. Long-term properties are not yet tested.

Printing was done in a decent quality multifunction household printer.

A metal ruler and craft knife was used to cut out the labels by gently cutting along the lines between the labels.

Settings:

"Stock label type": "blank"