SUMMARY: Restoring files corrupted by an EOM.

From: Henrik Schmiediche (henrik@PICARD.TAMU.EDU)
Date: Thu Jul 22 1993 - 05:57:21 CDT


    Hi,
thanks for the all the responses concerning restoring a file from
an 8 mm DAT tape that has a premature EOF marker written on it.
The response that summed it up (written for a similar post is
below). All other response follow.

     - Henrik

----- Begin Included Message -----

>From todd Wed Jul 15 19:05:31 1992
To: sun-managers@eecs.nwu.edu
Subject: Re: how to skip past tape EOM?

Yesterday I asked:

> From: todd@flex.Eng.McMaster.CA (Todd Pfaff)
> Subject: how to skip past tape EOM?
>
> Help!
>
> I have an Exabyte 8500 format tape written under SunOS 4.1.2 which
> was inadvertently rewound before writing a file which was supposed
> to go at the end of the tape. Therefore, the first file (at least)
> has been overwritten, but I'd like to recover the other files if
> possible. Is there someway to skip to the beginning of the first
> file after the end-of-media mark?

I got several helpful responses and one of the suggestions worked.
I'm now in the process of recovering some dump files which I thought
were history.

A bit more detail about what was on my tape: there were a large number
of dump files written one after the other on the tape, and then the
offending dump file written at the beginning of the tape which was
obscuring access to the other dump files because an End-Of-Media mark
is placed after the last file written to tape. I don't know of any
way to tell the driver to skip past the EOM mark (after writing this
I got a response from Perry_Hutchison.Portland@xerox.com which indicates
that I may have been able to skip the EOM using mt and dd, but I didn't
try it so I don't know if it works).

Here's what I did:

1) Rewind the tape.
        mt -f /dev/rst1 rew
2) Skip to the EOM mark (and don't rewind :-).
        mt -f /dev/nrst1 eom
3) Create a large file to write to tape. I don't know how much
   data has to be written to wipe out the EOM mark.
        mkfile 10m junk
4) Start writing this file to tape, but interrupt the write without
   closing the file such that an EOM mark will not be written.
   I let the write proceed for about 5 to 10 seconds and then switched
   off the power to the tape drive. This method works with an external
   Exabyte drive which has an accessible power switch; I don't know how
   to apply it to an internal drive.
        tar cvf /dev/nrst1 junk
        < wait a few seconds and then power cycle the tape drive >
5) Rewind the tape and skip to the desired file.
        mt -f /dev/rst1 rew
        mt -f /dev/nrst1 fsf N
                Actually, I found that this last command would return
                an IO error for N > 1 and then the driver would think
                the drive was offline or the tape was unloaded when
                in fact it was not. The following sequence was
                necessary to skip to file N (anybody know why?):
        mt -f /dev/rst1 rew
        mt -f /dev/nrst1 fsf 1
        mt -f /dev/nrst1 status
        mt -f /dev/nrst1 fsf N-1

Thanks for all the responses.

*******************************************************

>From hello@cs.utwente.nl Tue Jul 13 04:23:37 1993
Date: Tue, 13 Jul 93 11:24:11 +0200
To: henrik@picard.tamu.edu
Subject: Re: Help restoring from an exabyte 8mm tape

mt -f /dev/nrst0 fsf 1
see man mt

Ronald.

__
// Ronald Hello (hello@cs.utwente.nl)
// Twente University
// Department of Computer Science
// The Netherlands

>From raoul@athena.mit.edu Tue Jul 13 06:13:32 1993
Date: Tue, 13 Jul 93 07:14:14 -0400
To: henrik@picard.tamu.edu
Subject: Re: Help restoring from an exabyte 8mm tape
Newsgroups: info.sun-managers
Organization: Massachusetts Institute of Technology
Cc:

There are several ways to deal with this: the easiest is to copy the chunk
on that tape to another tape, using tputil or tprobe (which are popular
tools available via ftp). Also, you can access that chunk of tape using
"mt eom; mt fsf" to get past the eof markers, then use "restore f /dev/nrst0"
to access the non-rewinding device to read the tape without backing up to
the beginning of the tape.

I have sometimes found it to be *much* faster to copy the relevant dumps
off a multiple archive Exabyte tape onto another tape, and access that
tape. That way, I don't have to wind back and forth over large partitions
on that tape....

-- 
				Nico Garcia
				raoul@athena.mit.edu

>From root@ewi.ch Tue Jul 13 06:48:17 1993 Subject: Re: Help restoring from an exabyte 8mm tape To: henrik@picard.tamu.edu Date: Tue, 13 Jul 1993 13:45:53 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL17] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Content-Length: 961

Hallo

Bad news !

We had have the same problem. answer from Sun USA. NOT POSSIBLE !

Greetings from switzerland

Christoph -- +-------------------------------------------------------------------+ | __ Christoph Rothlin | | |__| | | _______ __ phone: +1/385'22'11 | | |_______| /\ /\ /\ | | direct: +1/385'21'75 | | _____ / / / / / / | | fax: +1/385'24'25 | | |_____| \/ / / / / | | | | _______ / / / / | | e-mail: root@ewi.ch | | |_______| \/ \/ |__| X400: o=EWI/p=EUNET/a=ARCOM/c=CH | | | | Electrowatt Engineering Services Ltd. | | Bellerivestrasse 36 P.O.Box CH-8034 Zurich Switzerland | +-------------------------------------------------------------------+ | The opinions are mine, not Electrowatt Engineering Services | +-------------------------------------------------------------------+

>From todd@flex1 Tue Jul 13 08:53:32 1993 Date: Tue, 13 Jul 93 09:54:14 EDT Reply-To: todd@flex.eng.mcmaster.ca To: henrik@picard.tamu.edu Subject: Re: Help restoring from an exabyte 8mm tape

>I have a backup tape that due to an error in the backup scripts >backuped and empty file and put a 'end-of-file' marker after the file. >I need to restore files that I know are on the tape, but which I >cannot get to due to the "end-of-file" marker. Is there any way of >telling the exabyte to skip over the end-of-file marker and restoring >whatever might be beyond the "empty" file?

------------------------------------------------------------ From: blymn@awadi.com.AU (Brett Lymn - System Admin)

A (brutal) solution I have heard is to start the tape drive writing to the tape and then turn the tape drive off, the idea being to overwrite the eom marker and not let the drive write a new one.

-- Brett Lymn Computer Systems Administrator AWA Defence Industries

------------------------------------------------------------ From: David Fetrow <fetrow@biostat.washington.edu>

Past End-of-File is easy enough (use mt). Is that you want?

-- -dave fetrow@biostat.washington.edu

------------------------------------------------------------ From: Russell Ruby <russ@MATH.ORST.EDU>

I had a somewhat similar situation a couple of months ago... i accidentally had recycled all the baseline backup tapes containing a file system of a "dead" disk. After checking backup records, i figured two of the overwritten tapes in fact had the data i wanted somewhere past the a newly rewritten end of information, or end of media "eom" as it is called... Using the following described process (for an exabyte 8200) i was able to recover the 400 megabytes of missing info -- what a relief...

(by the way, a number of suggestions from well-intentioned knowledgeable people involved splicing the tape -- i was a bit chicken to try that approach and was glad this other approach got the job done)

--- included message --- To: arrent!angel@uu.psi.com (A.R. Rivera) Subject: Re: HELP: Getting data from mag tape In-reply-to: Your message of Tue, 23 Jun 92 10:12:12 -0700. <9206231712.AA00083@Arrent.COM> Date: Thu, 25 Jun 92 14:03:20 PDT From: Russell Ruby <russ@intihuasi.MATH.ORST.EDU>

Assuming that what you meant was that you want to get past the "end" of the tape, here is something that works for EXABYTES, and probably works for other tape devices as well...

assuming the Sun device driver 1) first go to the end of media mt ... eom 2) Start copying a large file to the device, but as soon as it writes enough to get past whatever gibberish is involved in the end of information, double file marks and perhaps blank space (... whatever), "interrupt" the writing

[i remember making an estimate based on information in the 8200 hardware manual which came with our drive (and other info), also, i had lots of room before the file i wanted, so i wrote about 10-15 megabytes before interrupting the write...] process by either i) more civilized approach, if information is coming in across the network, break the ethernet connection so that the drive stops writing and waits for data, and then turn the drive off, or ii) less civilized, just turn the drive off. hint: using tar cvf with an a directory full of files of fixed size gives an easy way to judge how much has been written before you "interrupt" the write. you could always write a program too which writes and sleeps (don't close the file - otherwise i think you will get another eom). 3) turn the drive back on, should rewind, or else do "mt ... rewind" 4) use "mt ... fsf #" to skip over whatever boring old information might have existed at the beginning of the tape. With the exabyte, even though i was skipping forward one file at a time, somewhat surprisingly, it appeared to skip over the eof at the end of the "spliced" file, stopping at the eof of the next file and so i needed to do a mt ... bsf 1 to back up to the file i wanted.

HOWEVER -- in your case, you probably had one tar file on the tape, but your tape now looks like one empty file immediately followed by "eom". In this case, do the "mt ... eom", do the writing trick in 2) above... rewind the tape, do a "mt ... fsf 1", and now the next file on the tape will be the junk file spliced together with your original tar file, hmmmm, the block size will be messed up, so you might need to experiment with dd a bit to andle it -- maybe, to probe the boundry where the splice happens, skip, conv=noerror, and a large input block size might be helpful...

i imagine other people might have experiences closer to your exact situation from which to offer advice... i would suggest waiting till you gather as much advice as possible before risking further havoc on your tape :-).

good luck, russell ruby russ@math.orst.edu

--- end of included message ---

------------------------------------------------------------ From: Postmaster <Piete.Brooks@cl.cam.ac.uk>

* I have heard, but never tried ....................... be ware ...............

* Go to the new EOM. Start writing. Remove power from the drive. * Now it is sitting after the EOM ...

* Power drive on again (& hope it doesn't rewind !) and read .....

------------------------------------------------------------ From: sbeard%london@gte.com (simon beard)

Gooday! the answer is yes; use mt.

ie: mt -f /dev/nrst0 fsf 1

the above command will skip over the first EOF on rst0 without rewinding.

You can then use restore ivf /dev/rst0 to go in and get what you want.

Hope this helps.

Simon.

------------------------------------------------------------ From: Perry_Hutchison.Portland@xerox.com

Depending on how the st driver handles the Exabyte tape, something like the following might do the job. I would suggest trying it with n set to each of 1, 2, and 3, ejecting and reinserting the tape between attempts in the hope of avoiding the problem of the driver "remembering" how many files are on the tape and blocking the attempt to space past what it thinks is the last one.

% mt -f /dev/rst8 rewind % mt -f /dev/nrst8 fsf $n % dd if=/dev/nrst8 bs=126b of={whatever} conv=noerror

The plan is to skip past n filemarks, then try to read. There should be either one or two filemarks following the new file at the beginning of the tape, and the first record following it/them will almost certainly be bad.

The goal with n=1 is to read whatever immediately follows the first or only filemark following the new file. If this sees an empty file with no errors, it probably means that there are two filemarks; if there is only one the first block will be bad but the remainder may be readable.

The goal with n=2 is to read the partial file in the two-filemark case, or to skip the partial file and try the next original file if there is only one filemark following the new file.

The goal of the n=3 attempt is to handle the case where the new file is followed by two filemarks, and the bad block following the second filemark is sensed by the driver as EOM so that it refuses to attempt any further operations, by skipping the partial file. It is hoped in this instance that the bad block/EOM condition will not be noticed during a skip-to-filemark operation.

If none of this works, it may be time to contact a data-recovery company.

------------------------------------------------------------

----- End Included Message -----

-- Todd Pfaff \ Internet: todd@flex.eng.mcmaster.ca Dept. of Mechanical Engineering \ Voice: (416) 525-9140 x2902 McMaster University \ FAX: (416) 572-7944 Hamilton, Ontario, CANADA L8S 4L7 \

>From jalge@mtgy.gtegsc.com Tue Jul 13 09:11:35 1993 Date: Tue, 13 Jul 93 09:11:17 CDT To: henrik@picard.tamu.edu Subject: Re: Help restoring from an exabyte 8mm tape

> Hi, >I have a backup tape that due to an error in the backup scripts >backuped and empty file and put a 'end-of-file' marker after the file. >I need to restore files that I know are on the tape, but which I >cannot get to due to the "end-of-file" marker. Is there any way of >telling the exabyte to skip over the end-of-file marker and restoring >whatever might be beyond the "empty" file? > >Any info would be appreciated. > > - Henrik > >-- >Henrik Schmiediche, Dept. of Statistics, Texas A&M, College Station, TX 77843 >E-mail: henrik@stat.tamu.edu | Tel: (409) 845-9447 | Fax: (409) 845-3144 >

This may or may not work, depending on whether or not the data "on the other side" of the EOF marker is complete and uncorrupted, but you might try the following:

(assuming, probably incorrectly, that your tape device is /dev/rst9) mt -f /dev/nrst9 fsf 1 #cause tape to skip over EOF and DO NOT rewind

Now run your favorite restore command, e.g. restore, tar, cpio, whatever.

I hope this works for you. --- Jeff Alge email: jalge@mtgy.gtegsc.com System Administrator MITC, Montgomery, AL voice: (205) 215-5575

>From thielen@irus.rri.uwo.ca Tue Jul 13 09:14:10 1993 Date: Tue, 13 Jul 93 10:14:22 EDT To: henrik@picard.tamu.edu Subject: Re: Help restoring from an exabyte 8mm tape X-Sun-Charset: US-ASCII

Here is a detailed procedure for getting back those needed files... It's voodoo unix for sure...

1) Rewind the tape. mt -f /dev/rst1 rew 2) Skip to the EOM mark (and don't rewind :-). mt -f /dev/nrst1 eom 3) Create a large file to write to tape. I don't know how much data has to be written to wipe out the EOM mark. mkfile 10m junk 4) Start writing this file to tape, but interrupt the write without closing the file such that an EOM mark will not be written. I let the write proceed for about 5 to 10 seconds and then switched off the power to the tape drive. This didn't work for me, unless I turned off the workstation attached to this drive as well. We use the delta microsystem drivers. This method works with an external Exabyte drive which has an accessible power switch; I don't know how to apply it to an internal drive. tar cvf /dev/nrst1 junk < wait a few seconds and then power cycle the tape drive > 5) Rewind the tape and skip to the desired file. mt -f /dev/rst1 rew mt -f /dev/nrst1 fsf N Actually, I found that this last command would return an IO error for N > 1 and then the driver would think the drive was offline or the tape was unloaded when in fact it was not. The following sequence was necessary to skip to file N (anybody know why?): mt -f /dev/rst1 rew mt -f /dev/nrst1 fsf 1 mt -f /dev/nrst1 status mt -f /dev/nrst1 fsf N-1

Thanks for all the responses. Susan KJ Thielen Application Programmer, System Manager Robarts Research Institute Phone: (519) 663-3833 PO Box 5015, 100 Perth Drive Fax: (519) 663-3789 London, ON N6A 5K8 E-mail: thielen@irus.rri.uwo.ca

>From @svr.ssci.liverpool.ac.uk:trevor@ssci.liverpool.ac.uk Tue Jul 13 10:36:01 1993 Date: Tue, 13 Jul 93 16:37:21 GMT To: henrik@picard.tamu.edu Subject: Re: Help restoring from an exabyte 8mm tape Content-Type: X-sun-attachment

---------- X-Sun-Data-Type: text X-Sun-Data-Description: text X-Sun-Data-Name: text X-Sun-Content-Lines: 7

We have several useful aliases for dealing with tar files on exabyte and some are also useful in your circumstances. I have used forward myself in similar situations. Here are all of them. Manual on mt command would be a useful thing for you to look at also!:

---------- X-Sun-Data-Type: default X-Sun-Data-Description: default X-Sun-Data-Name: hendrik X-Sun-Content-Lines: 7

back mt -f /dev/nrst0 nbsf enddata mt -f /dev/nrst0 eom forward mt -f /dev/nrst0 fsf recover tar xvpf /dev/nrst0 !*;mt -f /dev/nrst0 fsf 1;mt -f /dev/nrst0 nbsf 1 rewind mt -f /dev/rst0 rewind tapesave tar cvf /dev/nrst0 tdir tar tvf /dev/nrst0;mt -f /dev/nrst0 fsf 1;mt -f /dev/nrst0 nbsf 1

>From THOANG@gusty.llnl.gov Tue Jul 13 11:23:38 1993 Date: Tue, 13 Jul 1993 16:24:52 GMT To: henrik@picard.tamu.edu Subject: RE: Help restoring from an exabyte 8mm tape

Hi Henrik,

Have you tried the mt (magnetic tape) command:

mt -f /dev/rst0 fsf 1 (or 2, 3....) to skip forward 1 (or 2, 3...) files ? This may help you get pass the "end-of-file" mark.

Hope this helps......Tony

>From green@kodak.com Tue Jul 13 11:30:55 1993 Reply-To: green@kodak.com Date: Tue, 13 Jul 93 12:31:10 EDT To: henrik@picard.tamu.edu Subject: Re: Help restoring from an exabyte 8mm tape

Sure,

mt -f /dev/<norewindtapedevname> fsf 1

for example:

mt -f /dev/nrst0 fsf 1

This will skip one "file" on the tape.

Good-luck! Russ

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Russell J. Green | Rochester Distributed Computer Services ~ ~ Mail Stop 01826 | ~ ~ Eastman Kodak Company | --------------------------------------- ~ ~ Rochester, NY 14650-1826 | Internet mail: green@.Kodak.COM ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>From trynisze@pluto.crd.ge.com Tue Jul 13 11:39:33 1993 Date: Tue, 13 Jul 93 12:39:26 EDT To: henrik@picard.tamu.edu Subject: Re: Help restoring from an exabyte 8mm tape Content-Length: 163

Henrik,

Go to the place where the empty file is and then you may skip over it by mt -f /dev/???? fsf 1 then try your restore. David Tryniszewski

>From manuel@efi.com Tue Jul 13 15:16:27 1993 Date: Tue, 13 Jul 93 13:17:12 PDT To: henrik@picard.tamu.edu (Henrik Schmiediche) Subject: Re: Help restoring from an exabyte 8mm tape Newsgroups: info.sun-managers X-Newsreader: TIN [version 1.2 PL0]

In article <21sgoo$4l2@tamsun.tamu.edu> you wrote: : Hi, : I have a backup tape that due to an error in the backup scripts : backuped and empty file and put a 'end-of-file' marker after the file. : I need to restore files that I know are on the tape, but which I : cannot get to due to the "end-of-file" marker. Is there any way of : telling the exabyte to skip over the end-of-file marker and restoring : whatever might be beyond the "empty" file?

: Any info would be appreciated.

: - Henrik

: -- : Henrik Schmiediche, Dept. of Statistics, Texas A&M, College Station, TX 77843 : E-mail: henrik@stat.tamu.edu | Tel: (409) 845-9447 | Fax: (409) 845-3144

use the "mt" command to skip over eof mark

%mt -f /dev/rst(n) fsf

where n is device number. check man pages for more info. the first fsf will skip 1 file, fsf 2 will skip past 2 file etc...

hope this helps

-manuel-

-- Manuel J. Morales Systems Administrator 415-286-8311 Electronics For Imaging (EFI) manuel@efi.com

>From Piete.Brooks@cl.cam.ac.uk Wed Jul 14 00:09:28 1993 To: henrik@picard.tamu.edu (Henrik Schmiediche) Cc: Piete.Brooks@cl.cam.ac.uk Subject: Re: Help restoring from an exabyte 8mm tape Date: Wed, 14 Jul 93 06:10:02 +0100 X-Mts: smtp

I can provide some info on "reading beyond the LEOT" if no one else does.

>From ucsd.edu!ttsd!sisdbell.Logicon.COM!sisdbell.Logicon.COM!randy Wed Jul 14 09:22:17 1993 Date: Wed, 14 Jul 93 08:24:02 CDT To: ucsd.edu!PICARD.TAMU.EDU!henrik Subject: Re: Help restoring from an exabyte 8mm tape

Use the "mt" command to skip past the file:

mt -f /dev/rst8 fsf

will skip past the first file.

+----------------------------+------------------------+ | Randy J. Ott | ROtt@Logicon.COM | | Logicon, Inc. | (402) 291-7750 (Voice) | | 1408 Fort Crook Road South | (402) 291-2503 (Fax) | | Bellevue, NE 68005 | | +----------------------------+------------------------+

>From uunet.uu.net!imatron!peter Wed Jul 14 10:47:09 1993 Date: Wed, 14 Jul 93 08:15:17 PDT To: uunet.uu.net!uunet!PICARD.TAMU.EDU!henrik Subject: Re: Help restoring from an exabyte 8mm tape

use the "mt" command man mt

>From adamfox@super.org Wed Jul 14 17:41:40 1993 Date: Wed, 14 Jul 93 18:42:15 EDT To: henrik@picard.tamu.edu (Henrik Schmiediche) Subject: Re: Help restoring from an exabyte 8mm tape

|> Hi, |> I have a backup tape that due to an error in the backup scripts |> backuped and empty file and put a 'end-of-file' marker after the file. |> I need to restore files that I know are on the tape, but which I |> cannot get to due to the "end-of-file" marker. Is there any way of |> telling the exabyte to skip over the end-of-file marker and restoring

Try the mt command. There is a an option called fwf (I think) that will do exacly that.

Just when you do it, be sure to use a non-rewinding device (eg. /dev/nrst0).

Try man mt for details..the command will look something like this:

# mt -f /dev/nrst0 fwf 1

We use this to put multiple dumps on one tape.

Good Luck.

-- Adam Fox Systems Programmer/Administrator Supercomputing Research Center Bowie, MD USA adamfox@super.org

-- Henrik Schmiediche, Dept. of Statistics, Texas A&M, College Station, TX 77843 E-mail: henrik@stat.tamu.edu | Tel: (409) 845-9447 | Fax: (409) 845-3144



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:02 CDT