Help on SCSI ERASE Command

  • Thread starter Thread starter Shiera
  • Start date Start date
S

Shiera

Excerpt from IBM TotalStorage LTO Ultrium Tape Drive: SCSI Reference

ERASE
CDB:
----------------------------------------------------------------------
| Bit |
-----------------------------------------------------------------
Byte | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
----------------------------------------------------------------------
0 | OPERATION CODE (19H) |
----------------------------------------------------------------------
1 | LOGICAL UNIT NUMBER | RESERVED | Immed | Long |
----------------------------------------------------------------------
2 | RESERVED |
----------------------------------------------------------------------
3 | Reserved |
----------------------------------------------------------------------
4 | RESERVED |
----------------------------------------------------------------------
5 | Control |
----------------------------------------------------------------------

If the Long field is set to 0, no further writing occurs. If the Long
field is set to 1, the DataSet Separator (DSS) pattern is written from
EOD to the end of the medium to overwrite any data that is currently
on the tape.


QUESTIONS:

1. For first sentence, "no further writing occurs" - does this mean
that from EOD til the end of the medium, no user data could be
written?

2. For the second sentence, what really is DATASET SEPARATOR (DSS)?
Is it just a markings on tape, or does it have a value, say, 0x00 to
indicate erased portions?


=====================================================================

I would always be grateful to all of your help!
Thanks,
shiera
 
Previously Shiera said:
Excerpt from IBM TotalStorage LTO Ultrium Tape Drive: SCSI Reference
ERASE
CDB:
----------------------------------------------------------------------
| Bit |
-----------------------------------------------------------------
Byte | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
----------------------------------------------------------------------
0 | OPERATION CODE (19H) |
----------------------------------------------------------------------
1 | LOGICAL UNIT NUMBER | RESERVED | Immed | Long |
----------------------------------------------------------------------
2 | RESERVED |
----------------------------------------------------------------------
3 | Reserved |
----------------------------------------------------------------------
4 | RESERVED |
----------------------------------------------------------------------
5 | Control |
----------------------------------------------------------------------

If the Long field is set to 0, no further writing occurs. If the Long
field is set to 1, the DataSet Separator (DSS) pattern is written from
EOD to the end of the medium to overwrite any data that is currently
on the tape.

I do not have solid knowledge on this, but maybe some helpful
guesses:
QUESTIONS:
1. For first sentence, "no further writing occurs" - does this mean
that from EOD til the end of the medium, no user data could be
written?

I think that long=0 is a Quick-Erase that just writes an
End Of Data (EOD) mark, but leaves the actual data after this
mark alone, which could be recovered, possibly without significant
effort.

long=1 is a "true erase" that writes one EDO and then further ESSes
until the tape has been pverwritten to the end. This is moderately
secure and commercial data recovery companies at least claim
they cannot recover overwritten data from magnetic media. For
increased recurity, write random data, erase-long and repeat this
4-20 times, depending on paranoia level. With true paranoia,
burn the tape instead ;-)
2. For the second sentence, what really is DATASET SEPARATOR (DSS)?
Is it just a markings on tape, or does it have a value, say, 0x00 to
indicate erased portions?

Usually it is a special pattern that cannot occure in normal data.
For MFM coding in floppies (similar case, I believe), ordinary data
has a change of signal every 2 or 4 usec. But there are special
marks where these changes are 6 usec (or was it 8 usec?) from each
other, that are used to indicate start of sector header and start of
sector. Is supect that DSS is something along these lines. This way
it can be identified.

Since this type of coding violates the normal rules, such marks are
less reliable than normal data. Hovever they are usually repeated
several times to compensate. Since they are used very sparingly
the additional space needed does not matter.

One other possibility for special marks that does not require
special coding is to use e.g. 128 bit "random" magic numbers.
If they are unstructured enough, the probability of the
bit-pattern happening in normal data is less likely than
undetected tape failure and other problems.

I don't know whether the second option is used in tape storage,
but the first one works fine and is simple to implement.

Hope this helps,
Arno
 
Shiera said:
Excerpt from IBM TotalStorage LTO Ultrium Tape Drive: SCSI Reference

ERASE
CDB:
----------------------------------------------------------------------
| Bit |
-----------------------------------------------------------------
Byte | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
----------------------------------------------------------------------
0 | OPERATION CODE (19H) |
----------------------------------------------------------------------
1 | LOGICAL UNIT NUMBER | RESERVED | Immed | Long |
----------------------------------------------------------------------
2 | RESERVED |
----------------------------------------------------------------------
3 | Reserved |
----------------------------------------------------------------------
4 | RESERVED |
----------------------------------------------------------------------
5 | Control |
----------------------------------------------------------------------

If the Long field is set to 0, no further writing occurs. If the Long
field is set to 1, the DataSet Separator (DSS) pattern is written from
EOD to the end of the medium to overwrite any data that is currently
on the tape.


QUESTIONS:

1. For first sentence, "no further writing occurs" - does this mean
that from EOD til the end of the medium, no user data could be
written?

From the SCSI-2 spec:
A long bit of one indicates that all remaining medium in the current partition shall be erased beginning at the
current logical position. If the Immed bit is one, the target shall return status as soon as all buffered commands
have completed execution and the command descriptor block of the ERASE command has been validated. The
logical position following an ERASE command with a long bit of one is not specified by this standard.
NOTE 138 Some targets may reject an ERASE command with the long bit set to one if the logical unit is not at
beginning-of-partition.
A long bit of zero specifies an erase gap defined by the gap size field in the device configuration page (10.3.3.1).
If the gap size is zero or the field is not supported, a device defined erase gap operation shall be performed. If the
Immed bit is one, the target shall return status as soon as the command descriptor block has been validated.
Erase gaps may be used in initiator controlled error recovery or update in place applications.

And:
The GapSize field value determines the size of the inter-block gap when writing data. A value of 00h specifies the
device’s defined gap size. A value of 01h specifies a device defined gap size sufficiently long to support update-in-
place.
2. For the second sentence, what really is DATASET SEPARATOR (DSS)?
Is it just a markings on tape,
or does it have a value, say, 0x00 to indicate erased portions?

That is what it appears to say.
Unfortunately I haven't been able to trace "DATASET SEPARATOR" (or 'dataset'
or 'data set') in any SCSI-3 document I have ever downloaded on earlier occasions.
Have you searched the IBM document for it?
 
Back
Top