Editing LTO Tape/6

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
LTO-6
LTO-6
SAS Drive is assumed to be used (for now).
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.




Line 14: Line 12:


== HBA (Host Bus Adaptor) ==
== 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)




Line 35: Line 22:


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...
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 ==
Line 44: Line 29:
=== Tar (Simplest) ===
=== 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]]
 
See [[LTO Tape]]. Make sure to always disable hardware compression using mt.
 
<pre>
# mt -f /dev/nst0 compression 0
# mt -f /dev/nst0 defcompression -1
</pre>


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


Build from the upstream IBM source code rather than using vendor source code, which sucks. A handy source rpm is provided.
Build from the upstream 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/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:
{{bc|sudo dnf install rpm-build rpmdevtools}}
First, create the rpmbuild setuptree in your home directory.
{{bc|rpmdev-setuptree}}
Download [https://github.com/piste2750/rpm-ltfs/blob/master/ltfs.spec this .spec file, and place it into ~/rpmbuild/SPECS/ltfs.spec]. Then run the following src.rpm packaging command.
{{bc|rpmbuild -bb ~/rpmbuild/SPECS/ltfs.spec}}
Install the dependencies needed to build the source rpm.
{{bc|sudo dnf builddep ~/rpmbuild/SRPMS/ltfs-2.4.1.2-10254.src.rpm}}
Build an rpm from a .src.rpm file:
{{bc|rpmbuild --rebuild ~/rpmbuild/SRPMS/ltfs-2.4.1.2-10254.src.rpm}}
Now the rpms can be installed
{{bc|
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) ===
=== BareOS (Enterprise) ===
Line 103: Line 42:


https://www.bareos.org/en/
https://www.bareos.org/en/
<nowiki>  bareos-sd:
    container_name: bareos-sd
    image: barcus/bareos-storage
    devices:
      - /dev/tape/by-id/scsi-3500e09efff0f9bb6:/dev/tape/by-id/scsi-3500e09efff0f9bb6
</nowiki>
=== plain tar, dd, ect ===
Install mt-st package for tape commands mt:
$ sudo yum install mt-st
$ sudo mt -f /dev/nst0 status
$ sudo tapeinfo -f /dev/nst0 # Get information about drive and tape.
Creating a junk data file for testing:
$ head -c 10G < /dev/urandom > junkfile_10GB.jnk
Disabling compression as it will only result in bottlenecks and lower odds of successful file retreival if the tape is damaged.
$ sudo mt -f /dev/nst0 compression 0
$ sudo mt -f /dev/nst0 defcompression -1
Getting status to confirm the drive has compression disabled:
$ sudo mt -f /dev/nst0 status
$ sudo tapeinfo -f /dev/nst0
There should be a line indicating is is not enabled
'DataCompEnabled: no'
LTO6: Density code 0x5a
Setting the block size to something the drive likes results in very significant speedups. (from 7MB/s to 170MB/s):
I determined the value used by going down a power of two from 1024 to 512
$ sudo /usr/bin/time --append --output=tape_time10gb.txt tar -c  -v -b 512 -f /dev/st0 junkfile_10GB.jnk
=== Labelling Tapes ===
https://tapelabel.de/
https://tapelabel.de/lto-sample/lto-sample.html
[http://www-01.ibm.com/support/docview.wss?uid=ssg1S7000429 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"
Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: