2

So, I have a tape drive, and use it to permanently archive some stuff (old projects). These are "copy once" things, no versioning/incremental backups/etc. Though of course, new projects might be added to a tape later on.

I use tar for this (GNU tar 1.29 on Ubuntu 18.04):

tar --create --verbose --verbose --blocking-factor=128 --checkpoint=10000  
 --checkpoint-action="echo=[%{%F %T}t] [%s] #%u: %T" --format=posix
 --label="`date -Iseconds`" --totals --multi-volume --file=/dev/nst0 <Folders to backup>

Since this leaves me with a bunch of tapes that I have to manually keep track of, I wonder if there are common tools to catalogue those tapes, and maybe even keep track of stuff like the blocking factor, etc.

I know I can manually run a tar --list into a file and keep notes, which is my current approach, but before I start off wrong, I figure I ask.

I am not looking at "big" programs like bacula/bareos and the like, mainly because I want to be able to restore with just the tape in hand and a brand new *NIX system. With tar, I know that I can just scan every tape to find what I need in an emergency. (But I'd like to avoid that, hence the question)

  • 1
    I cannot recommend your gtar usage since gtar is known to reject follow up tapes from multi volume archives with a probability of ~ 5%. Also note that your command happily archives long pathnames that gnu tar later rejects to restore. Did you think about whether you really like to use gtarfor backups? – schily Nov 15 '19 at 10:07
  • @schily Thanks! Haven't heard of that, that's interesting. Does that apply to posix-format as well? tar --show-defaults says it's using gnu format by default, which is documented to have incompatible extensions. I was hoping that by using POSIX.1-2001, I get a broad compatibility with different systems (while also supporting large files). Do you recommend something else that runs on Linux (and optionally, BSD)? – Michael Stum Nov 15 '19 at 18:22
  • The main problem with gtar is that it is not cleanly written and does not correctly control the use of features based on a current archive format. I recommend star that is recent in schilytools. If you like to verify that gtar does not support long pathnames, try to extract the file star/testscripts/longpath.tar.bz2 using star and gtar. – schily Nov 16 '19 at 11:26
  • @schily star doesn't support multi-volume archives in pax format - is that a limitation of the pax standard? The output (along with -block-number) is pretty good for my cataloging needs, so that's neat. experimenting with this command line for now: star -c artype=xstar -block-number blocks=128 file=/dev/st0 -fifo -fifostats fs=1g -multivol -time -v -v VOLHDR="``date -Iseconds``" <Folders> – Michael Stum Nov 16 '19 at 21:22
  • The pax format is strictly POSIX compliant and does not impmement extensions. For backups, I recommend the option -dump that switches to the exustar format plus additional meta data. A blocksize of 128 is not supported by all hardware, 126 is recommended for best portability. -fifo is the default since 30 years. Make sure to use at least release 1.6.1, since before there have been some hangs in the fifo on Linux. – schily Nov 17 '19 at 11:06
1

Following the discussion in the comments, I went with star, which gave me a good output using -block-number -v -v VOLHDR="`date -Iseconds`". I can use this as a catalogue.

block         0: a   0   0 V---------  root/root Nov 18 02:26 2019 2019-11-18T02:26:47-05:00 --Volume Header--
block         3: a       0 drwxr-xr-x   2 root/root Nov 18 02:25 2019 ./
block         6: a 17656337143 -rwxr-xr-x   1 root/root Dec 22 13:20 2016 Project1.zip

I can also extract the tape with either star or GNU tar (without some of the extended attributes - but that's fine, this is my "in case of an apocalypse" fallback).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.