I'm trying to use pv
(pipeviewer) along with tar to do tape backups in order to see the progress and eta like so:
du -s /home/myuser
115630916 /home/myuser
tar -cf - /home/myuser/ | pv -s 115630916 > /dev/nst0
Which works fine, it writes to tape successfully. But once I try and test the tar archive:
mt -f /dev/nst0 rewind
tar -tvf /dev/nst0
I get the following errors:
tar: /dev/nst0: Cannot read: Cannot allocate memory
tar: At beginning of tape, quitting now
tar: Error is not recoverable: exiting
I've googled around and there have been suggestions that I use --blocking-factor=128
when creating my backup and restoring. I still get the same error.
It's also worth noting that if I just use tar, everything works 100%, including the restore, so perhaps pv
is breaking it?