LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-26-2013, 03:37 PM   #1
Mhd.Golden
LQ Newbie
 
Registered: Aug 2013
Posts: 2

Rep: Reputation: Disabled
Tape Problem


Hello Dears,
I have problem with reading files backed up on a tape
I have three backed up files, when I run tar tvf /dev/nst0, the first file returns, then when I run the same command again, the following error returns:
tar: /dev/nst1: Cannot read: Input/output error
tar: At beginning of tape, quitting now
tar: Error is not recoverable: exiting now

But when I run the same command for the third time, it returns the second file.

what is the problem?
 
Old 08-26-2013, 04:02 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,738

Rep: Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753Reputation: 1753
Quote:
tar: /dev/nst1: Cannot read: Input/output error
Is nst1 a typo or did you actually copy / paste the message in your post. If you copied / pasted the error message then you used the wrong device id. Make sure you used /dev/nst0 every time you ran the tar command.
 
Old 08-26-2013, 04:55 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
The thing you are running up against is called tape marks.

A tape contains files recorded starting from the beginning of the tape, and continuing until the end of file mark (a tape mark). A "end of volume" is identified by two tape marks with no file in between.

Running "tar -xvf /dev/nst1" reads the first file (a tar file) from the tape, and stops after reading the tape mark.

Running it again hits the second tape mark.. (usually the name nst1 means "no rewind on drive st1"), causing the EOT/BOT(end-of-tape/beginning-of-tape) error message. Running it a third time puts you AFTER the marked EOT (the two tape marks already read) and it attempts to read the next file.

That last read is not necessarily a valid read... What is usually done after creating a tar tape is that the tape is rewound at the end (causing the second tape mark). This second tape mark USUALLY corrupts the beginning of any following data, but doesn't have to - if the new file recorded from the beginning of tape is a bit shorter than an old file, the two tape marks CAN just occur before the second old file. Sometimes this is EXACTLY what you want (as in recovering data from a damaged tape, or an accidentally overwritten tape).

Before writing a tape, you must first position the tape to the right place. By default that is the beginning of tape. IF the tape is rewound at this point, two tape marks are recorded (the EOT), thus there are actually 3 tape marks there, one for the end of file for the first file, and two to mark the end of tape. In normal recording, the last two are then spaced backwards to position the tape after the first tape mark. A second file can then be recorded, which will overwrite the EOT.

But whenever the tape is rewound will leave the two tape marks marking the end of tape.

To record two (or more) files on the tape in different sessions, you must position the tape at the EOT, so that the new file added will overwrite the EOT mark.
 
Old 08-26-2013, 05:14 PM   #4
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US, Earth, end border$! ◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that works well on my cheapest; has been KDE or CLI but open... http://goo.gl/NqgqJx &c ;-)
Posts: 3,514
Blog Entries: 2

Rep: Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048
Tape lol transfer it to Blu-ray...
 
Old 08-26-2013, 05:28 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
Quote:
Originally Posted by jamison20000e View Post
Tape lol transfer it to Blu-ray...
Can Blu-ray hold 3 TB of data???

Didn't think so.

Tapes have grown as fast, if not faster, than disk drives. And for massive amounts of data, is more reliable, and MUCH faster at writing or reading.
 
Old 08-26-2013, 08:14 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,401

Rep: Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489
Quote:
Originally Posted by jpollard View Post
Running "tar -xvf /dev/nst1" reads the first file (a tar file) from the tape, and stops after reading the tape mark.
Close, but not quite right. What actually happens is that tar recognizes the all-zero header block that marks the end of the archive and stops reading before encountering EOF. That leaves the tape positioned just before the file mark. The next process that reads from the tape gets an immediate EOF.

The solution is either (a) advance the tape beyond the file mark either by reading from it or by running "mt fsf /dev/nst0", or else (b) use the "-i" or "--ignore-zeros" option to tell tar to ignore the all-zero block and read to EOF.
 
Old 08-26-2013, 08:45 PM   #7
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US, Earth, end border$! ◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that works well on my cheapest; has been KDE or CLI but open... http://goo.gl/NqgqJx &c ;-)
Posts: 3,514
Blog Entries: 2

Rep: Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048
Not reliable at all. My dad keep his old VHS tapes in the attic you know what happened.

I personally have a zipp tape drive and 5 1/4 floppy (from thrift stores) for the capability of loading old data but would never rely on them for current data. And, true BD only 22\25 gigs (annoying for lots of data but last for ever compared to tape), hard drives tho, are cheap and bigger but it's your\their data.

Last edited by jamison20000e; 08-26-2013 at 08:51 PM.
 
Old 08-27-2013, 02:49 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
VHS tapes were not designed for reliability.

Storing any magnetic media outside its storage temperatures will always introduce errors - even new tapes will be damaged.

And that is true for any storage media (including clay tablets - too high a temperature will melt them, too low can crack them).

And hard drives don't like to be moved.

I did forget about tars own end of file handling.

Last edited by jpollard; 08-27-2013 at 02:53 AM.
 
Old 08-27-2013, 09:06 AM   #9
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,380

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Quote:
Originally Posted by jamison20000e View Post
Tape lol transfer it to Blu-ray...
A blu-ray that'll hold 1.6Tb per media? Nope.
A blu-ray that'll let me mount 8 media in one go and have my backup segmented on to defined media? Nope.

Quote:
Originally Posted by jamison20000e View Post
hard drives tho, are cheap and bigger but it's your\their data.
~$25 for an LTO4 tape that'll hold 800Gb uncompressed is pretty cheap. Our current backup/storage runs to approximately 200 tapes including long-term backup as well as daily rotation and I'd not be happy with 8 hard disks (no matter how securely packaged) being shiped between site/archive once a week.

So while hard disk may be suitable for home/hobby level backup I'll stick with my LTO4 tapes.

Until 2014, when we'll be switching to LTO6
 
Old 08-27-2013, 12:26 PM   #10
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US, Earth, end border$! ◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that works well on my cheapest; has been KDE or CLI but open... http://goo.gl/NqgqJx &c ;-)
Posts: 3,514
Blog Entries: 2

Rep: Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048
Industries can spend more (but don't need to the readers cost a fortune) because they make more so as long as you don't want any tapes lasting more than 15\30 years and paying more than disk (even for the tapes only according to Wikipedia)...

P.s: sorry for getting this thread a little of track (no pun intended) aside from the title of which I still LL

:Edits.

Last edited by jamison20000e; 08-27-2013 at 01:05 PM.
 
Old 08-27-2013, 01:21 PM   #11
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,380

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Quote:
Originally Posted by jamison20000e View Post
as long as you don't want any tapes lasting more than 15\30 years
7 years statutory data retention policy and then tapes physically destroyed, so I'm good thanks

Yes tape drives are expensive, our next one will be in the $15,000 range!

Last edited by TenTenths; 08-27-2013 at 01:23 PM.
 
Old 08-27-2013, 01:24 PM   #12
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,270
Blog Entries: 1

Rep: Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304Reputation: 2304
Quote:
Originally Posted by jamison20000e View Post
Tape lol transfer it to Blu-ray...
Unless Blu-ray is way, way better than all the other lousy optical media, you would do better keeping a shelf of spiral notebooks!
 
Old 08-27-2013, 01:40 PM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
"paying more than disk"??

Over the lifetime of a drive (which alone is rather expensive) gets amortized by the volume of tapes used. Usually between 300-1000 per drive (which would be between 450TB to 2,500 TB depending on actual compression rates). Most sites using tapes for backup will have roughly 7000 to 9000 tapes for every 4 drives. The site I worked at had about 30,000 tapes for 6 drives. So the primary expense was the tapes, not the drives.

And tapes are cheaper than disks - little to no electronic parts (the LTO drives do have a usage/error monitor flash memory unit).

The cost of the drive is in the motion control - the drives transfer data as fast, if not faster, than disks - limited mostly to whatever the controller-memory interface can do. And the drive does onboard data compression/decompression, which disks can't do (it tends to destroy the block nature of a disk - no space is saved by compressing disk blocks). The only speed penalty is the initial seek to a file location, and since the tapes now have directory entry capability, seeks over 1.5 TB is under 45 seconds. After that, no seeks required, allowing continuous I/O around 140MB/sec, or better.
 
Old 08-27-2013, 10:28 PM   #14
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US, Earth, end border$! ◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that works well on my cheapest; has been KDE or CLI but open... http://goo.gl/NqgqJx &c ;-)
Posts: 3,514
Blog Entries: 2

Rep: Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048Reputation: 1048
Arrow

http://www.storagecraft.com/blog/tap...e-future-hold/
http://www.ntbackup.us/Articles/tape...sk-backups.htm
http://blogs.computerworld.com/data-...up-war-exposed

My searching (+) brings up no debate hard drives are cheaper and last longer (even more portable if you ask me. Tapes can't evolve anymore.)

Last edited by jamison20000e; 08-27-2013 at 10:30 PM.
 
Old 08-28-2013, 05:25 AM   #15
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
Oh, tapes can evolve.

If disks can evolve, so can tapes. Both are based on the same technology. The advantage of tapes is their mechanical stability over time (fewer moving parts).

Drop a tape, and it still works. Drop a disk... and it doesn't work, usually.

And the cost advantage is in favor of tapes - if you use thousands. Also uses less power.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugging slow tape: Big disparity between iostat and tape speed wsanders Linux - Server 2 05-23-2009 09:02 AM
Check tape drive availability (full tape) TripleOne Linux - Server 0 02-12-2009 03:45 AM
Unable to insert the DAT72 Tape in tape drive. peddip Red Hat 8 01-08-2009 09:27 AM
Tape Backups and How can i find out the Name (label) of the tape in the drive?? helptonewbie Linux - Newbie 2 10-27-2008 07:20 AM
Using a DDS5 tape drive to restore from a DDS3 backup tape. AndrewCAtWayofthebit Linux - Hardware 1 05-14-2006 09:15 AM


All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration