Categories
Computer Crap

Tape drives can go to hell

After exploring the options available for an offsite backup of my growing collection of scans (I have some good shit lined up once this goddamn coronavirus fucks off), I indulged myself and got a tape drive and some tapes off eBay. This post will explain to you all the ways in which they suck and confirms why everyone I mentioned my tape drive to was correct in telling me I was wasting my time with it.

The main reason I was lured in to LTO tapes was the price, which after I scoured eBay properly were even lower than I expected:

  • Tape drive (HP Ultrium 920) – $100
  • SAS controller (HP P212) & SAS cable – $30
  • 14x Dell LTO3 tapes – $140

For just $270 I got 5.4TB of offsite backup capability, by far the cheapest of all the options I investigated. I could have purchased an 8TB HDD for about $250, but I gave LTO tapes the benefit of the doubt due to longevity compared to a HDD that’ll seize up if not touched for a while.

Installation was easy in my home server, but actually writing data to the tape was more of a hassle than I expected. I assumed you could just insert the tape, mount it and copy files to it like every other storage device I’ve ever used. Sure, it would be slow but I’m not in a rush. I was a little concerned about the weird noises it makes, but apparently that’s normal?

My first tape related disappointment happened about 10 minutes after installing the drive. The unit I purchased uses the LTO3 standard, but the method I was hoping to use to write to the tape uses a file system format called LTFS (Linear Tape File System) that lets you read and write to a tape drive like it’s a normal block device. Not until I tried to use the classic cp command did I find out that LTFS is only supported on LTO5 or later drives. Fuck. I just assumed LTFS works on any LTO drive.

That’s okay, it just means using tar for actual tape archival, like a long bearded computer wizard from 1979. Pop in a tape, point it to a directory of roughly 400GB of files and “archive” those files to the tape device – easy, right? Yeah, nah.

The first major headache I had was being unable to write consecutive archives to the tape. So for example, I’d write one set of files to the tape that’s say, 10GB, then a second set that’s 12GB but all I’d see on the tape is the second archive. Where did the first archive go?! Apparently it was still there, but I was just a fucking n00b. A nice person called tthatfreak on Reddit helped me to figure out what was going on. Go read it if you’re interested as it’s way too long to go into detail here.

For reference here’s the commands that came in handy for me coming to grips with the tape drive and tar:

/dev/st0 - the tape drive device
/dev/nst0 - the tape drive device, but it won't rewind the tape when the operation is complete
mt -f /dev/st0 status - tell me what the drive is up to and what position the tape is in
mt -f /dev/st0 rewind - rewind the tape
mt -f /dev/st0 erase - erase the tape
tar -tvf /dev/nst0 - show me what's on the tape one archive at a time
tar -cvf /dev/nst0 file_for_tape - write file_for_tape to the tape
sg_logs -a /dev/st0 | grep "Main" - show me how much space is left on the tape

After getting confident with the basics of actually writing a damn file to the damn tape, I ran into my second hurdle – tape capacity. I’m well aware that the 800GB written on the box of the tape is for “compressed” data and basically bullshit, but I assumed the 400GB of “native” capacity meant 400GB. Apparently not.

I know it says “LTO-5 and LTO-6 specific” but I couldn’t find any other way to determine free space on the tape.

Despite the tape drive reporting that the tape has “Main partition remaining capacity (in MiB): 400308” (aka 390 Gibibytes), I couldn’t get any more than about 300GiB on the tape. How did I find this out? Trying to copy 329GiB overnight and waking up to an error message saying “OUT OF SPACE FUCKO HAHAHA”. I moved some of the data out of the directory to get it to 300GiB, tried again and it worked. Hooray!! After all that fucking around I finally have 300GiB of data stored on a single tape.

Fuck me for having a modicum of joy though, as the tape drive demons snatched it away from me when I tried to write to a 2nd tape. Cannot write?? Cannot close??? Error is not recoverable, exiting now?? Goddamn it.

Checking the kernel log reveals it’s a “medium error”, which after some investigation (Google) is likely a dirty tape drive. Fair enough, it is old and probably never cleaned. Shit happens, buy a cleaning tape ($15 off eBay) and off we go. After almost 2 weeks (thanks COVID-19) despite the bright orange cleaning tape arrives. All you do is pop the tape it and the drive knows its a cleaning tape, so it starts its cleaning cycle. Easy!

Pop a new tape in, run tar to write some files and 20 minutes later it craps out with the same error. In goes the cleaning tape again, and again, and again – 3 runs in total. A third fresh tape goes in and the same bullshit error. The very first tape I successfully wrote data to goes in and even reading that didn’t work, with the kernel throwing up a medium error.

This entire ordeal has seriously turned me off tape drives as a long term backup method. The perception of them I had prior to owning one has well and truly been shattered and left me looking at the other options more seriously. I’ll open up the tape drive mechanism, poke around inside and give it a good going over with some isopropyl alcohol wipes, so I can try flog it off to the next unsuspecting chump nerd and look at what else is out there.

If I wanted to continue down the tape path, I’d probably pick up an LTO-5 drive along with some tapes. A suitable drive is going for $400 on eBay and 5x tapes (each hold approx 1.5TB) would set me back $100 – $500 all up. This is still quite cost effective compared to other options, but tape drives aren’t welcome in my home now. Everyone was right, tape drives are a pain in the arse and good riddance to them.

Leave a Reply

Your email address will not be published. Required fields are marked *