Operating System - HP-UX
1834939 Members
2362 Online
110071 Solutions
New Discussion

Re: [Can't open /dev/tty to prompt for more media]

 
SOLVED
Go to solution
Eric Antunes
Honored Contributor

[Can't open /dev/tty to prompt for more media]

Sometimes, cron returns this error when backing up (with tar cvf /dev/rmt/0m ) database files. Any ideia??

Thanks,

Eric Antunes
Each and every day is a good day to learn.
30 REPLIES 30
Victor BERRIDGE
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Hi Eric,
Seems your backup is too big to fit on one tape, and it is trying to open an interactive session to ask what you want to do...
Since its a batch...


All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Hi Eric,
Just checked, and yes according to man tar:
"When end-of-tape is reached, tar prompts the user for a new special file and continues."


As you can see it is trying to prompt but you are in batch mode using cron!

Good luck
Victor
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Hi Victor,

How can it be a size issue if the database files have always the same size (19368000)? And sometimes it works fine and others not.

I've noticed that this tape drive never asks for the cleaning tape, is it normal??

Thanks,

Eric Antunes
Each and every day is a good day to learn.
Stephen Keane
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

It might be a compression issue. If the drive does/doesn't compress the data then it might/might not fit on one tape. You should be looking at

(a) Are you using hardware compression or software compression?
(b) Are you using the same device name? (some devices support compression, others don't)
(c) switches on the device itself (enable or disable) compression.
(d) are you using the same length tape each time?

Just my 2cents worth.

Stephen Keane
Honored Contributor
Solution

Re: [Can't open /dev/tty to prompt for more media]

Oh, and if you ARE using compression, the fact that the database files appear the same size on the server is not as important as their size when compressed. A very large database file that is full of zeroes (for example) will compress really well, one full of more random data won't.

(another 2cents worth)
Victor BERRIDGE
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

I agree with Stephen,
rmt/0m should compress, and therefore the result may vary according to what is in the table spaces. You will notice this with full exports, depending when it can almost vary by almost 40% while you see always the same size if you look at disk occupation.
I suppose here lies your problem. about the tape I dont know what type you are using but usually they have some leds indicating a urgent need for cleaning, the next step beeing refusing to write...

All the best
Victor
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Stephen,

(a) Are you using hardware compression or software compression? R: I think it's hardware since the compression led is on. But how can I be certain?

(b) Are you using the same device name? (some devices support compression, others don't)? R: I always use /dev/rmt/0m...

(c) switches on the device itself (enable or disable) compression. R: Enables...

(d) are you using the same length tape each time? R: Yes

Eric
Each and every day is a good day to learn.
Stephen Keane
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

# mt -f /dev/rmt/0m status

e.g.

Drive: Quantum DLT4700
Format: DLT 81633 bpi 64 tracks compressed (40 GB)
Status: [41118384] BOT online compression immediate-report-mode
File: 0
Block: 0

Shows my device has hardware compression enabled. (I think)
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Victor,

I understand this compression variable. But I thought those hp dlt IV data cartdrige tapes I'm using would support 40Gb in compressed mode and 20Gb in non-compressed mode...

Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Stephen,

I'm going to check this in the afternoon since I'm now backing up the files again to see if it works.

Thanks,

Eric
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Here is the result of "mt -f /dev/rmt/0m status":

Drive: QUANTUM DLT8000
Format:
Status: [41118985] BOT online compression immediate-report-mode
File: 0
Block: 0

It seems to have no format defined...?
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

One more thing: with exactely the same datafiles (but not in batch mode) I've sucessfully backed up all files... I read somewhere that this could be related with ulimit being different in batch mode (at, cron, etc...) than in the command line, is it true?
Each and every day is a good day to learn.
Stephen Keane
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Do you have a tape loaded in the drive? Maybe the format indiactes the last tape read or something?


I don't know whether this will help ...

To perform a Basic Health Check (BHC) test from the DLT8000 front panel:

Press and hold the Density Select button until the top two Density Indicators LEDs (1.0/15.0 & 20.0) on the left side of the panel light up.

Release the the Density Select button and press it once.

Result: The top two indicators should start to flash in unison to indicate that the BHC test has been started.

BHC PASS
The top four density LEDs will light and remain solid for approximately five seconds then will return to their original state.

BHC FAIL
The top four Density Indicators will flash in unison for approximately five seconds then will return to their original state.

Patrick Wallek
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

The 40GB number for a DDS4 assumes that you will get a 2-to-1 compression ratio. There is absolutely no guarantee that you will get that. If the data is very compressible then you may get 3-to-1 or better, BUT if it is NOT very compressable then you may get 1.2-to-1 or you may not get any compression at all.

When figuring tape usage, it is best to figure based on the tapes native capacity (20GB in this case) and if you get better than that, then consider yourself lucky.
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Ok Stephen,

I got a BHC FAIL since the top density indicators have flashed for a few seconds... Now what??

Thanks Patrick.

Each and every day is a good day to learn.
Victor BERRIDGE
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Hi Eric,
Just to see, I added 2 lines in my root cronfile with :
1) ulimit
2) ulimit -a
Here is the output:
more ulimit.cron
unlimited
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 2015464
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048

All the best
Victor
Stephen Keane
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Well if the Quantum self-diagnostics are to be believed, I hope you have a support contract for the tape drive.

Do you see any errors in syslog?
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Victor,

I think this can be the real problem (look at my "ulimit" and "ulimit -a" values):

unlimited
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 524288
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 1024
Each and every day is a good day to learn.
Stephen Keane
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Do you have a cleaning tape for the tape drive? The self-diagnostics (which I agree isn't your main problem) may be reporting simply a dirty drive?
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Stephen,

Yes, at the time cron gave the error, I've got this on syslog.log:

Feb 22 07:32:22 hp440 EMS [2503]: ------ EMS Event Notification ------ Value: "CRITICAL (5)" for Resource
: "/storage/events/tapes/SCSI_tape/0_7_0_0.3.0" (Threshold: >= " 3") Execute the following command
to obtain event details: /opt/resmon/bin/resdata -R 164036610 -r /storage/events/tapes/SCSI_tape/0_7_0_0.
3.0 -n 164036611 -a

And running the resdata command as it is said, I get the file in attachment but this may be a consequence of the error at cron, don't you think?
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Yes Stephen, I've cleaned the drive with it just before doing the test...
Each and every day is a good day to learn.
Stephen Keane
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Your error log is indicating that there is a drive hardware failure "Mechanical positioning error". I suppose you could always try the windows approach (i.e. switch it off and back on again). Otherwise, i'd consider contacting your support engineer (if you have one).

Victor BERRIDGE
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Do you have (x)stm installed?
You could try to diagnose after switching off/on again the device with this tool to see if there were any evolution...

Good luck
Victor
Eric Antunes
Honored Contributor

Re: [Can't open /dev/tty to prompt for more media]

Hi,

Don't you think that my "ulimit -a" data (524288 kbytes) is to low? What is ulimit anyway and why is it different with -a option??

I've already switched the tape driver before doing the backup by myself (without using cron). In stm, I get the following (Unit Attention at the last line...):

Log creation time: Tue Feb 22 16:49:37 2005

Hardware path: 0/7/0/0.3.0


Device Qualifier: QUANTUMDLT8000
Product ID: DLT8000 Hardware Path: 0/7/0/0.3.0
Device Type: SCSI Tape Logical Unit Number: 0
Vendor: QUANTUM Product Rev Level: 0255
Firmware Major Version: 85 Firmware Minor Version: 0
Read Errors Corrected: 0 Read Errors Uncorrected: 0
Write Errors Corrected: 0 Write Errors Uncorrected: 0
Tape Motion Hours: 1011 Power On Hours: 6747
Read Compression Ratio: 1.0 : 1 Write Compression Ratio: 1.0 : 1
Compression Status: Enabled
Serial Number: CXA32P2016
Drive Status: Unit Attention

Thanks,

Eric
Each and every day is a good day to learn.