Tape Backup - mt erase, dd, and tar overwriting produce input/output error
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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?
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.