Amanda-Users

Re: dd question

2004-04-29 11:50:36
Subject: Re: dd question
From: Paul Bijnens <paul.bijnens AT xplanation DOT com>
To: "Dege, Robert C." <robert.dege AT ngc DOT com>
Date: Thu, 29 Apr 2004 17:47:19 +0200
Dege, Robert C. wrote:
Most of the time, I'll get the header information, but every so often
I have to run the command twice for the system to successfully read
the tape.  i.e.:

bash$ dd if=/dev/tape bs=32k
0+0 records in
0+0 records out

bash$ dd if=/dev/tape bs=32k
AMANDA: TAPESTART DATE 20180319 TAPE SIMNET-02

1+0 records in
1+0 records out

Maybe the first time the tape is not rewound?
E.g. amcheck uses the nonrewinding device, and lets the tape
positioned just after the label (but in that case you

By opening it as /dev/tape, it gets rewound automatically.

You can see it like this:

$ amcheck -s daily
... finds correct tape ...
$ mt -t /dev/nst1 status
SCSI 2 tape drive:
File number=0, block number=1, partition=0.
Tape block size 0 bytes. Density code 0x30 (AIT-1 or MLR3).
Soft error count since last status=0
General status bits on (1010000):
 ONLINE IM_REP_EN

# !!! We are positioned on file 0, block 1

$ dd if=/dev/st1 bs=32k
0+0 records in
0+0 records out

# we tried to read block 2 of the header, which is only 32K large
# we read 0 byte, signaling EOF.
# But we used /dev/st1, and the tape is rewound now

$ mt -t /dev/nst1 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x30 (AIT-1 or MLR3).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN

#  Now are at the BOT (Beginning Of Tape), file 0, block 0

$ dd if=/dev/st1 bs=32k
AMANDA: TAPESTART DATE 20040331 TAPE DAILY-08

1+0 records in
1+0 records out

#  And this time we find the header


--
Paul Bijnens, Xplanation                            Tel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM    Fax  +32 16 397.512
http://www.xplanation.com/          email:  Paul.Bijnens AT xplanation DOT com
***********************************************************************
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, F6, *
* quit,  ZZ, :q, :q!,  M-Z, ^X^C,  logoff, logout, close, bye,  /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* kill -9 1,  Alt-F4,  Ctrl-Alt-Del,  AltGr-NumLock,  Stop-A,  ...    *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************


<Prev in Thread] Current Thread [Next in Thread>