2

At my new workplace, I am expected to backup older data (large image-files) to tape. As someone who as never used tapes, I have a few questions regarding them. It would be great if someone can point me to a guide on the web or answer them here.

Currently, I am able to query the tape drive using the command mt. Along with this mt has options to move the tape head from one file boundary to another

mt -f /dev/st0 status

Moving the data seems straight forward using tar.

tar cvf /dev/st0 somedirectory/

The part that I am not able to understand is how do I query how much space is available on the tape volume? The tapes I am testing are HP LTO-5 Ultrium(1.5TB uncompressed).

Also, how does one create volumes that can span over multiple tapes? Say a folder of size 10TB?

Once this system is working, I intend to archive 10TB of data every six months on two different sets of tapes.

feverDream
  • 151
  • 5
  • 2
    You probably don't want to "roll your own" backup solution when there's many freely and commercially available solutions available that will nicely catalog and manage the whole process. And provide support when something unexpected happens -- ever have tape #2 of a 3 tape tar backup set go bad? (it's not as bad as it used to be, but still . . .) – Brandon Xavier Jun 22 '17 at 23:47
  • Having worked with that stuff in the past myself, I can assure you that it is complicated. The drive firmware surely knows which track it is writing to, so it has a pretty good idea of how much space is left, but I know of no way to query the drive for this information. However when you are getting close to the end of the tape every other `write` system call will give you `ENOSPC`, so software which understands this can take appropriate action before it really reaches the end. – kasperd Jun 25 '17 at 21:31
  • There is one misconception in your question. The uncompressed capacity of LTO tapes is not a constant. It varies depending on the quality of the tape and how worn the drive head is. On LTO-4 tapes I have seen it vary between 270GB and 840GB. – kasperd Jun 25 '17 at 21:34
  • And just to clarify my previous comment an LTO-4 head assembly actually consists of 3 heads, but one of them tend to wear down before the others. – kasperd Jun 25 '17 at 22:03

1 Answers1

2

To display status of the tape/drive use:

mt status  #Use default 
mt -f /dev/rmt/0  status #Unix
mt -f /dev/st0 status #Linux 
mt -f /dev/nsa0 status #FreeBSD
mt -f /dev/rmt/1 status #Unix unity 1 i.e. tape device no. 1

Source: https://www.cyberciti.biz/hardware/unix-linux-basic-tape-management-commands/

Joshua Turnwell
  • 530
  • 3
  • 12