[plug] Tapes

Nick Bannon nick at ucc.gu.uwa.edu.au
Wed Mar 8 21:30:21 AWST 2023


On Wed, Mar 08, 2023 at 04:38:39PM +0800, William KENWORTHY wrote:
> Let tar handle the encryption/compression and use mt to control the drive. That's how we did it in the good old days.  Hopefully the tapes are better these days .. I thought LTO had gone the way of the dinosaurs ... and good riddance!
> 
> e.g., 
> https://www.cyberciti.biz/faq/linux-tape-backup-with-mt-and-tar-command-howto/
> BillK

There's also the linked page which explains the auto-rewind / "standard" names:
https://www.cyberciti.biz/faq/tape-drives-naming-convention-under-linux/
- First (auto rewind) SCSI tape device name: /dev/st0
- Second (auto rewind) SCSI tape device name: /dev/st1
- First the non-rewind SCSI tape devices: /dev/nst0
- Second the non-rewind SCSI tape devices: /dev/nst1

There's extra names for tape "modes", see below.

- You can start with one large backup on a tape and let it auto-rewind
  each time (which seems like it might match what you want); or
- you can use `tar -czf /dev/nst0 /www /home` a number of times to save
  multiple files on the tape
  - Then rewind and skip forward 3 files with: `mt -f /dev/nst0 fsf 3`
  - `mt status` or `mt offline` - the envvar $TAPE device filename is
     convenient, or symlink'ing the correct drive to the default `/dev/tape`

- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_storage_devices/managing-tape-devices_managing-storage-devices

> On 8 March 2023 4:22:31 pm AWST, Brad Campbell <brad at fnarfbargle.com> wrote:
> >G'day all,
> >
> >I've gone and bought an LTO-5 tape drive with the intention of supplementing our already pretty comprehensive backup routine. It won't fit in any of my on-line machines, so the intention is to put it into the office "workshop" machine with a fast disk, stage the backup onto the disk and then write it out to tape overnight. I don't need partial writes or recovery. There will be no issue writing or reading the whole tape. If I need to recover from tape I have bigger issues than the time required.

There's extra layers like AMANDA , but it's not sounding like that's
useful for you right now: https://www.amanda.org/
It still uses the same basic file formats behind the scenes but it does
make you "label" each tape with a tiny file that can be checked by the
software, so you'll have a library of tapes and don't accidently
overwrite a backup that you wanted to keep with the latest one, for example.

> >My thought is to use tar through compression and then encryption streamed out to tape. I'll have a play with compression and encryption that can sustain damage and still recover the remainder as a belt and braces.
> >Anyone have any tips or ideas?
> >Regards,
> >Brad

For encryption (or for compression!) - software or hardware?
All the tools below are in Debian GNU, at least, but I've included
some links to upstream so it's clear "what's what".

You may have a very basic `mt` command installed, that comes with GNU `cpio`.

To configure hardware compression you may need `mt-st`:
https://github.com/iustin/mt-st
https://serverfault.com/questions/261553/how-to-write-to-a-tape-using-hardware-compression-on-linux
https://wiki.debian.org/StinitDef

(or https://sourceforge.net/projects/mtx/ ? which also comes with `tapeinfo`)

- To configure hardware encryption:
  https://github.com/scsitape/stenc/blob/master/man/stenc.rst

- For software encryption:
- You may have `gpgtar` already installed and have it plug straight in for `tar`:
  https://www.gnupg.org/documentation/manuals/gnupg/gpgtar.html
- Otherwise you can use:
- `gpg -c`, you could use a little script (it must accept the -d option,
  for decompression) as a `tar --use-compress-program=COMMAND` filter
- aespipe
- https://github.com/FiloSottile/age
- or have the data already encrypted by the time it's on the staging
  disk/holding disk and go back to plain `tar`
  - and a good way to do that is with a "modern" disc or cloud-targetted
    backup system like https://borgbackup.readthedocs.io/
    - though that would mean a two step recovery process

Nick.

-- 
   Nick Bannon   | "I made this letter longer than usual because
nick-sig at rcpt.to | I lack the time to make it shorter." - Pascal


More information about the plug mailing list