[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Spare Tables error on format



Hi,

Listas Canal wrote:
> user@mtrog64:~$ dvd+rw-format -f /dev/sr1 -ssa=262144000
> ...
> * formatting .:-[ FORMAT UNIT failed with SK=5h/INVALID FIELD IN PARAMETER
> LIST]: Input/output error

My current theory is that this is because of formatting sub type 3 Quick
Certification.


> user@mtrog64:~/Documentos/db/dvdrwtools/dvd-rw-tools$ ./dvd+rw-format
> /dev/sr1 -force=full -ssa=min
> ...
> * formatting .:-[ FORMAT UNIT failed with SK=5h/INVALID FIELD IN PARAMETER
> LIST]: Input/output error
>
> Also commenting out the block for Quick Certification, does not work.

So my theory seems wrong.
Now it would be interesting to see what dvd+rw-format sent as cmd[0] to
cmd[7] and as formats[i] to formats[i + 11].


> Wondering how you printf f[0]..f[7] I've tried as char and int, and I've got
> different values per run.

"char" is a tricky data type in C. It's signedness differs from CPU type
to CPU type. SCSI bytes are meant unsigned and often are mentioned in
the specs as hexadecimal XYh. So one should cast them to unsigned and use
printf formatter %x or %X.

I have in one of my modified versions of dvd+rw-format.cpp :

        { int j;
            fprintf(stderr, "BD-RE FORMAT command:");
            for (j = 0; j < 8; j++)
                fprintf(stderr, " %2.2x", (unsigned int) cmd[j]);
            fprintf(stderr, "\nParameter list:");
            for (j = 0; j < 12; j++)
                fprintf(stderr, " %2.2x", (unsigned int) formats[i + j]);
            fprintf(stderr, "\n");
        }

It is inserted between

        if (full && (formats[i+4+4]>>2)!=0x31)
            formats[i+4+4] |= 2;// "Full Certificaton"
        else if ((formats[i+4+4]>>2)==0x30)
            formats[i+4+4] |= 3;// "Quick Certification"

and

        if ((err=cmd.transport(WRITE,formats+i,12)))
            sperror ("FORMAT UNIT",err), exit(1);

(You could insert a command spy in method Scsi_Command.transport()
of the file transport.hxx. The diff between original and spying version
of transport.hxx has 179 lines. Ask me if you want to have it.)

The meaning of the bytes is specified in SCSI volumes SPC and MMC.
I wrote a guideline text
  https://dev.lovelyhq.com/libburnia/libburn/raw/branch/master/doc/cookbook.txt
which quotes heavily from the meanwhile unavailable drafts of those
specs. Regrettably T10 demands money for the PDFs of SPC and MMC and
hid the drafts from the public. But
  https://en.wikipedia.org/wiki/MultiMedia_Commands
has a link to a PDF which sits in a directory with old draft copies.
(I do not mention its URL here, because else that last source of free
SCSI wisdom could vanish, too.)

----------------------------------------------------------------------
Smalltalk and anecdotes:

> libburn : FAILURE : File object '/dev/sr4' not found

Well, i seem to have more drives attached than you. :))


> user@mtrog64:~$ xorriso -outdev /dev/sr1 -format fast_by_index_4
> ...
> user@mtrog64:~$ xorriso -outdev /dev/sr1 -list_formats          
> ...
> Format status: formatted, with 23866.0 MiB
> BD Spare Area: 0 blocks consumed, 0 blocks available

I rarely use BD-RE without spare area. But given the poor performance
of Defect Management it is plausible to do so, at least for single
session use cases.
With multi-session i would propose minimal spare area because the
emulation of multi-session needs to overwrite the first 64 blocks for
each session. The other blocks get written only once until the medium
is reused from scratch (after pseudo-blanking).

I have a BD-RE which takes a small incremental update session every day
since imeanwhile 20 months:
  Media summary: 610 sessions, 9060897 data blocks, 17.3g data, 5894m free
Next spring or summer i will have to put it on the shelf and start with
a blank BD-RE again.


> I was enchanted by optical media, because the price/durability is more
> affordable than SSD or USBs.

I began to love them after a DAT tape drive at work turned out to have
made bad backups for two years and the last usable backup was on an old
QIC tape for which we had to buy a used drive to be able to read it.
I gained reputation by presenting new backups as ISO 9660 on CD which the
boss could put into his own desktop computer to check by normal means
whether his favorite files are there and readable. Especially he loved
that he could read the files but not alter them, and that he could read
the backup media at home.
Oh yeah. The late 1990s ...


Have a nice day :)

Thomas


Reply to: