LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-28-2012, 04:38 PM   #1
sp00led
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
Angry Tape Backup - mt erase, dd, and tar overwriting produce input/output error


I've been banging my head on this one all day. I've got a HP 1/8 G2 Autoloader I'm using to write some data to an LTO-4 tape.

I've successfully written the data to the tape using:
tar -czf /dev/st0

and I have extracted the data using:
tar -xzf /dev/st0

I now have two archives on the tape and I can rewind and fast forward to the second track no problem.

I now want to erase or write over what is there for my real backup (other data was just junk for testing). I'm getting the following errors.

root@x:/dev# dd if=/dev/zero of=/dev/nst0
dd: writing to `/dev/nst0': Input/output error
dd: closing output file `/dev/nst0': Input/output error

root@x:/dev# mt -f /dev/st0 erase
/dev/st0: Input/output error

root@x:/dev# mt -f /dev/st0 rewind
root@x:/dev# tar -cf /dev/st0 /home
tar: Removing leading `/' from member names
tar: /dev/st0: Cannot write: Input/output error
tar: Error is not recoverable: exiting now

root@x:/dev# lsscsi -g
[0:0:0:0] * *cd/dvd *TEAC * * DVD-ROM DV-28SW *R.2A */dev/sr0 */dev/sg0
[2:0:32:0] * enclosu DP * * * BACKPLANE * * * *1.07 *- * * * * /dev/sg1
[2:2:0:0] * *disk * *DELL * * PERC H700 * * * *2.0. */dev/sda */dev/sg2
[3:0:0:0] * *tape * *HP * * * Ultrium 4-SCSI * U52W */dev/st0 */dev/sg3
[3:0:0:1] * *mediumx HP * * * 1x8 G2 AUTOLDR * 3.00 */dev/sch0 */dev/sg4

# uname -a
Linux dialga 3.0.0-16-generic-pae #29-Ubuntu SMP Tue Feb 14 13:56:31 UTC 2012 i686 i686 i386 GNU/Linux

Anyone know why I'm getting this?

Last edited by sp00led; 03-28-2012 at 04:43 PM. Reason: added nfo
 
Old 03-28-2012, 06:50 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,412

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Well, according to http://linux.die.net/man/1/tapeinfo
Quote:
One good time to use 'tapeinfo' is immediately after a tape i/o operation has failed. On tape drives that support HP's 'tapealert' API, 'tapeinfo' will report a more exact description of what went wrong.
Worth a try ...
 
1 members found this post helpful.
Old 03-29-2012, 11:57 AM   #3
sp00led
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
hey thanks I didn't know about 'tapeinfo'. When i ran it I noticed the following:

TapeAlert[9]: Write Protect: Attempted to write to a write-protected cartridge.

I put a new tape in and the 'mt -f /dev/st0 erase' worked on a brand new tape. The old one is still giving I/O errors due to the WP status. What's weird is I took both out and they were not switched to write protect. I guess the tape is a little flakey but I at least now have one more troubleshooting tool to work with.

Thanks
 
Old 03-29-2012, 02:16 PM   #4
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-17.3 with Cinnamon & KDE
Posts: 1,534
Blog Entries: 3

Rep: Reputation: 103Reputation: 103
The tape has permissions as well as the drive.
If you wrote the tape as user1, then user2 cannot clobber the contents without proper permissions.

I created a 'tape' user and group who "owns" all my tapes.
Then folks who user tape are members of the 'tape' group ...
unless I want to limit the access.

Keep us informed about what you learn.

Still using 4mm tape, too,
~~~ 0;-Dan
 
Old 04-12-2012, 01:55 PM   #5
sp00led
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I thought it was maybe related to the physical tape but I just wrote to another HP LTO-4 tape and I have the same results. When it was brand new it took the erase command. Now that there is a tar there it won't let me run the erase.

TapeAlert[9]: Write Protect: Attempted to write to a write-protected cartridge.

Something is write protecting it and it's not the physical switch on the tape.


SaintDanBert, is this what you were talking about? Do I need to change something?

/dev# ll /dev/st0
crw-rw---- 1 root tape 9, 0 2012-04-11 11:45 /dev/st0
 
Old 04-14-2012, 12:24 AM   #6
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-17.3 with Cinnamon & KDE
Posts: 1,534
Blog Entries: 3

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by sp00led View Post
...
SaintDanBert, is this what you were talking about? Do I need to change something?

/dev# ll /dev/st0
crw-rw---- 1 root tape 9, 0 2012-04-11 11:45 /dev/st0
Is the writing process a member of the "tape" group or the "root" user or both?

I would consider setting "rwx" for both user and group of /dev/st0.

If you look at a tar archive "file" -- whether on disk or on tape
-- there is header details. That header includes the UID and GID
of the process that wrote the archive. For tape, this works in much the same way that the UID+GID works for a file system mount point.
Since tar archives are routinely used for file backup, there are some hoops to make sure that you really want to write over (erase)
a "backup" tape.

My tape drives are offline right now -- in storage while I rehab
my house. If I had access to them, I'd send you exact details.
I used to do this all the time.

~~~ 0;-Dan
 
Old 04-16-2012, 11:10 AM   #7
sp00led
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I'm writing the tapes as "root" so I was under the impression that it wasn't a permission issue.

I just tried this:


root# id root
uid=0(root) gid=0(root) groups=0(root)
root# usermod -a -G tape root
root# id root
uid=0(root) gid=0(root) groups=0(root),26(tape)
root# mt -f /dev/st0 erase
/dev/st0: Input/output error

I'm not sure how to get the header details of the tar or to look at the tape in any more detail than:

tar -tzf /dev/st0
 
Old 05-06-2013, 12:01 PM   #8
sp00led
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
So figured everyone could get a lul from a tape drive noobie. I recently started messing with out tape drive again and discovered I have WORM (write once, read many) tapes.

That would explain the behavior I was getting. Just figured I'd post this in case someone else runs into this and doesn't know what WORM stood for on the tape. HP's don't break down the acronym in small print.
 
1 members found this post helpful.
Old 05-06-2013, 07:46 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,412

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Well, I would have figured the acronym if I'd seen it... OTOH, I've only seen that applied to optical media (CD/DVD).
Didn't know you could get WORM tapes, although for crucial info eg auditing, its obviously a good idea
 
Old 04-28-2014, 04:03 AM   #10
New_in_linux
LQ Newbie
 
Registered: Jan 2014
Posts: 24

Rep: Reputation: Disabled
facing same issue

hi guys,

i am also facing the same issue.
http://www.linuxquestions.org/questi...pe-4175502942/

but in my case i am using HP-LTO3.

Please help me its urgent.

thanks in advance...!!!!
 
  


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
FC Tape Drive: /dev/st0: Input/output error pierre_lg Linux - Hardware 5 11-21-2011 07:02 PM
Tar Input/Output Error TVFilm73 Linux - Software 1 11-23-2010 05:44 PM
tape input/output error sridhar_dct3 Linux - Hardware 0 05-21-2008 03:31 AM
Hp Tape Drive Input/Output Error ammar_linux Linux - Newbie 0 12-31-2007 03:58 AM
Input/output error beim Schreib-/Lesezugriff auf Streamer Tape RetroFX Linux - Hardware 2 09-16-2003 09:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:19 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