LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   fclose() getting failed in SCSI tape (https://www.linuxquestions.org/questions/linux-software-2/fclose-getting-failed-in-scsi-tape-702533/)

Lakki 03-09-2009 06:11 PM

Rick,

Given the command "mt -f /dev/nst0 status" doesnt actually display any data. It just tells File Numbers as "0"

May be, should i try moving to the end of tape and issue an feof (after backing up the data)

By doing so, can we make sure the informix doesnt skip the end of file and stops at the marker?

Thanks,
Lakshmi

rnturn 03-10-2009 11:25 AM

Quote:

Given the command "mt -f /dev/nst0 status" doesnt actually display any data. It just tells File Numbers as "0"
Odd. What type/model of tape drive is it?

Quote:

By doing so, can we make sure the informix doesnt skip the end of file and stops at the marker?
Not exactly sure what this means. I can't see how Informix's backup utility would care about whether there's a tape mark at the end of the tape before trying to read it. Though, since you mentioned that it wants to use the rewinding interface (st0 as opposed to nst0) I wonder if it isn't confused by your tape label when you attempt to restore. By insisting on rewinding (by using /deb/st0), perhaps it's seeing your tape label instead of the beginning of the Informix dump.

Q: Any luck figuring out if you can override the default tape device that the "ontape" utility wants to use? If you can't, you may be outta luck trying to add a label to the tape.

Cheers...
Rick

Lakki 03-12-2009 01:06 PM

Hi Rick,

Instead of using fopen, fprint and fclose, i have used open, write and close to write a label to the tape. It works fine without any error!! :-)

Then i just put a "weof" and written the informix contents. This time, i used dbexport, (different from ontape as that requires tape in rewinding mode). With dbexport, i can specify the tape device, whether in rewinding/non-rewinding mode.

I am able to successfully do the database export and import operations along with the label too.

During import, as specified by you, i have used the "fsf" option to advance to the next contents and did the dbimport in non-rewinding mode.

Though i need to look into the ontape usage, its a different issue. But i am able to successfully do dbexport/dbimport.
Your suggestions really helped me a lot!!!!!!

Thanks,
Lakki

Thanks,
Lakshmi

Lakki 03-12-2009 01:08 PM

FYI, the tape model is "TANDBERG DATA - Tape Drive - 20/40 GB SLR7"

rnturn 03-13-2009 03:35 PM

Quote:

With dbexport, i can specify the tape device, whether in rewinding/non-rewinding mode.

I am able to successfully do the database export and import operations along with the label too.

During import, as specified by you, i have used the "fsf" option to advance to the next contents and did the dbimport in non-rewinding mode.
Cool!

I suspect that because the "ontape" tool only (at least by default, anyway) knows how to use "st0" instead of "nst0" it's rewinding the tape before attempting to read and upon finding that label of yours gets horribly confused and errors out.

At least you're able to get the database backed up in some fashion.

Cheers...
Rick


All times are GMT -5. The time now is 02:10 PM.