Discussion:
Backing up to tape
(too old to reply)
Frank Leonhardt
2018-04-25 17:48:00 UTC
Permalink
Old LTO drives are cheap and offer a good $/Gb. And I could do with some
archiving. But it's been a while since I used tape (System V IIRC). Are
my assumptions correct?

If I plug a SAS drive in to an HBA it'll just appear as /dev/sa0 (or
similar) - right?

Then I can backup everything with tar -cf /dev/sa0 /* - right?

Well I could if my HD was small or the tape was big, as the tar
documentation says "There is not yet any support for multi-volume
archives." Does the tape driver take care of this (i.e. "Insert Tape 2
and press a key") or does it just bomb?

I like tar for archiving stuff, but is dump/restore the way to go?
Probably not, because you can't specify files really.

And I'm probably more likely to backup ZFS datasets these days, so would
be relying on the tape driver to handle multi-volume tape sets.

One idea I have is to write a very quick and dirty program and pipe the
output of tar to it, and have it write to the tape unit - pausing for
tape changes. This is so obvious that it must already exist, or be a bad
idea for a subtle reason I haven't spotted.

Is anyone using tape able to confirm any of this one way or another?

Thanks, Frank.
Sergey Matveev
2018-04-25 18:10:02 UTC
Permalink
If I plug a SAS drive in to an HBA it'll just appear as /dev/sa0 (or similar)
- right?
Then I can backup everything with tar -cf /dev/sa0 /* - right?
Is anyone using tape able to confirm any of this one way or another?
I have purchased Ultrium LTO5 SAS tape drive for several months ago and
use it with HardenedBSD. Everything you wrote is right. It appears
(connected through SAS HBA) as /dev/sa0, /dev/nsa0, /dev/esa0 and you
can directly use tar with it without any problems. mt command allows you
to rewind and seek records on the tape. And neither native tar supports
multivolume archives nor tape drive will do anything with it -- you have
to split volumes manually somehow. You can easily do something like:
zfs send zroot > /dev/sa0 to write your ZFS dataset directly to the tape
and then restore from it.
--
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263 6422 AE1A 8109 E498 57EF
Frank Leonhardt (m)
2018-04-25 20:42:55 UTC
Permalink
Post by Frank Leonhardt
Post by Frank Leonhardt
If I plug a SAS drive in to an HBA it'll just appear as /dev/sa0 (or
similar)
Post by Frank Leonhardt
- right?
Then I can backup everything with tar -cf /dev/sa0 /* - right?
Is anyone using tape able to confirm any of this one way or another?
I have purchased Ultrium LTO5 SAS tape drive for several months ago and
use it with HardenedBSD. Everything you wrote is right. It appears
(connected through SAS HBA) as /dev/sa0, /dev/nsa0, /dev/esa0 and you
can directly use tar with it without any problems. mt command allows you
to rewind and seek records on the tape. And neither native tar supports
multivolume archives nor tape drive will do anything with it -- you have
zfs send zroot > /dev/sa0 to write your ZFS dataset directly to the tape
and then restore from it.
Thanks Sergey! Good to know the tape stuff still works. I've ordered a drive.

I'll need a utility to save/restore ZFS datasets that are larger than one tape if anyone knows of one. Otherwise I'll be writing one, if anyone is interested.

Regards, Frank.
--
Sent from my Cray X/MP with small fiddling keyboard.
Olivier
2018-04-26 10:32:28 UTC
Permalink
Post by Frank Leonhardt (m)
Post by Frank Leonhardt
Post by Frank Leonhardt
If I plug a SAS drive in to an HBA it'll just appear as /dev/sa0 (or
similar)
Post by Frank Leonhardt
- right?
Then I can backup everything with tar -cf /dev/sa0 /* - right?
Is anyone using tape able to confirm any of this one way or another?
I have purchased Ultrium LTO5 SAS tape drive for several months ago and
use it with HardenedBSD. Everything you wrote is right. It appears
(connected through SAS HBA) as /dev/sa0, /dev/nsa0, /dev/esa0 and you
can directly use tar with it without any problems. mt command allows
you
to rewind and seek records on the tape. And neither native tar supports
multivolume archives nor tape drive will do anything with it -- you
have
zfs send zroot > /dev/sa0 to write your ZFS dataset directly to the
tape
and then restore from it.
Thanks Sergey! Good to know the tape stuff still works. I've ordered a drive.
I'll need a utility to save/restore ZFS datasets that are larger than one tape if anyone knows of one. Otherwise I'll be writing one, if anyone is interested.
While it should not be too difficult to design such a utility, you have
to consider that each time you will want to access any data on the tar,
you will have to stream through all the tapes, because tar format does
not allow you to start with the tape 5 even if you know that the file
you are looking for is not on the first 4 tapes.

And tar will continue to stream through all the trailing tapes even if
the file you are looking for was found on the first tape (I think that
tar strores the newer version of a file at the end of the archive, so it
has to process the tar file to the end to be sure there is no newer
version of the file you extract).

It would be much better to split the data you want to tar, to have one
set of data filling almost one tape.

Best regards,

Olivier
Polytropon
2018-04-29 08:54:09 UTC
Permalink
Post by Olivier
Post by Frank Leonhardt (m)
I'll need a utility to save/restore ZFS datasets that are larger
than one tape if anyone knows of one. Otherwise I'll be writing
one, if anyone is interested.
While it should not be too difficult to design such a utility, you have
to consider that each time you will want to access any data on the tar,
you will have to stream through all the tapes, because tar format does
not allow you to start with the tape 5 even if you know that the file
you are looking for is not on the first 4 tapes.
In this case, pax is a convenient tool to deal with
multi-volume archives. It is part of the default OS
installation, of course. See "man pax" for details.
Post by Olivier
It would be much better to split the data you want to tar, to have one
set of data filling almost one tape.
Splitting the data beforehand probably is the best
way to deal with tar archives on tape. Maintaing a
"tape catalog" (usually automated) is a nice addition.
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Loading...