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

Re: Spare Tables error on format



Hello Thomas

On Sat, Oct 30, 2021 at 3:15 AM Thomas Schmitt <scdbackup@gmx.net> wrote:
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.


Noted.!
 
> 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].

Yes 

> 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.

Thank you I will try it
 
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.)


Yes please, if you can share it as an attachment.
 
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

Noted, great information. Downloaded!!! 

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.)

Yes, also noted, I'll take a look. I've followed the link and has the doc.
----------------------------------------------------------------------
Smalltalk and anecdotes:

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

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

I have 2 BD-RE and 1 DVD-RW, yes you have 1 more :))

> 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.

Yes in single session cases (BD-R or BD-RE) I also disable the spare area, is nonsense. Clean discs or new, 1 single use.
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).

Thanks for the advise, I use LUKS over the Blurays sometimes with UDF or XFS, working perfect with small incremental backups, so I do prefer bigger spare areas because I do not use ISO very often than in DVD-RW.
 
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.

Did you recycle the one on the shelf when another 2 or more came? 

> 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 ...

Nice story, actually for me, is more affordable than Tapes or Hardrives for storing incremental backups, of confidential data, DVD-RW lasts about 15 or 20 years in my library and still being readable, I hope BD-RE also has the same durability or more for confidential data that grows from year to year.


Have a nice day :)

Thomas


Have a nice day, I will read all the documentation you suggest.
 

Reply to: