Re: Spare Tables error on format

Listas Canal <[email protected]> Wed, 3 Nov 2021 12:41:05 -0600
Newsgroups gmane.comp.audio.cd-record
Message-ID <CAEzMNBH-BokrBuAivmifVjcnHMN6SNtPaVQMqXofjH+AZEJQ6Q@mail.gmail.com>
--00000000000054a77f05cfe6c107
Content-Type: text/plain; charset="UTF-8"

Hello Thomas

On Sat, Oct 30, 2021 at 3:15 AM Thomas Schmitt <[email protected]> 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.

--00000000000054a77f05cfe6c107
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello Thomas</div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr" class=3D"gmail_attr">On Sat, Oct 30, 2021 at 3:15 AM Thomas Sc=
hmitt &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wr=
ote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Listas Canal wrote:<br>
&gt; user@mtrog64:~$ dvd+rw-format -f /dev/sr1 -ssa=3D262144000<br>
&gt; ...<br>
&gt; * formatting .:-[ FORMAT UNIT failed with SK=3D5h/INVALID FIELD IN PAR=
AMETER<br>
&gt; LIST]: Input/output error<br>
<br>
My current theory is that this is because of formatting sub type 3 Quick<br=
>
Certification.<br>
<br>
<br></blockquote><div>Noted.!</div><div>=C2=A0</div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">
&gt; user@mtrog64:~/Documentos/db/dvdrwtools/dvd-rw-tools$ ./dvd+rw-format<=
br>
&gt; /dev/sr1 -force=3Dfull -ssa=3Dmin<br>
&gt; ...<br>
&gt; * formatting .:-[ FORMAT UNIT failed with SK=3D5h/INVALID FIELD IN PAR=
AMETER<br>
&gt; LIST]: Input/output error<br>
&gt;<br>
&gt; Also commenting out the block for Quick Certification, does not work.<=
br>
<br>
So my theory seems wrong.<br>
Now it would be interesting to see what dvd+rw-format sent as cmd[0] to<br>
cmd[7] and as formats[i] to formats[i + 11].<br>
<br></blockquote><div>Yes=C2=A0</div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex">
<br>
&gt; Wondering how you printf f[0]..f[7] I&#39;ve tried as char and int, an=
d I&#39;ve got<br>
&gt; different values per run.<br>
<br>
&quot;char&quot; is a tricky data type in C. It&#39;s signedness differs fr=
om CPU type<br>
to CPU type. SCSI bytes are meant unsigned and often are mentioned in<br>
the specs as hexadecimal XYh. So one should cast them to unsigned and use<b=
r>
printf formatter %x or %X.<br>
<br></blockquote><div>Thank you I will try it</div><div>=C2=A0</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
I have in one of my modified versions of dvd+rw-format.cpp :<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 { int j;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &quot;BD-RE FORMA=
T command:&quot;);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (j =3D 0; j &lt; 8; j++)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &qu=
ot; %2.2x&quot;, (unsigned int) cmd[j]);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &quot;\nParameter=
 list:&quot;);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (j =3D 0; j &lt; 12; j++)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &qu=
ot; %2.2x&quot;, (unsigned int) formats[i + j]);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, &quot;\n&quot;);<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
<br>
It is inserted between<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (full &amp;&amp; (formats[i+4+4]&gt;&gt;2)!=
=3D0x31)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 formats[i+4+4] |=3D 2;// &quot;Fu=
ll Certificaton&quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else if ((formats[i+4+4]&gt;&gt;2)=3D=3D0x30)<b=
r>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 formats[i+4+4] |=3D 3;// &quot;Qu=
ick Certification&quot;<br>
<br>
and<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((err=3Dcmd.transport(WRITE,formats+i,12)))<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sperror (&quot;FORMAT UNIT&quot;,=
err), exit(1);<br>
<br>
(You could insert a command spy in method Scsi_Command.transport()<br>
of the file transport.hxx. The diff between original and spying version<br>
of transport.hxx has 179 lines. Ask me if you want to have it.)<br>
<br></blockquote><div><br></div><div>Yes please, if you can share it as an =
attachment.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">
The meaning of the bytes is specified in SCSI volumes SPC and MMC.<br>
I wrote a guideline text<br>
=C2=A0 <a href=3D"https://dev.lovelyhq.com/libburnia/libburn/raw/branch/mas=
ter/doc/cookbook.txt" rel=3D"noreferrer" target=3D"_blank">https://dev.love=
lyhq.com/libburnia/libburn/raw/branch/master/doc/cookbook.txt</a></blockquo=
te><div><br></div><div>Noted, great information. Downloaded!!!=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex"><br>
which quotes heavily from the meanwhile unavailable drafts of those<br>
specs. Regrettably T10 demands money for the PDFs of SPC and MMC and<br>
hid the drafts from the public. But<br>
=C2=A0 <a href=3D"https://en.wikipedia.org/wiki/MultiMedia_Commands" rel=3D=
"noreferrer" target=3D"_blank">https://en.wikipedia.org/wiki/MultiMedia_Com=
mands</a><br>
has a link to a PDF which sits in a directory with old draft copies.<br>
(I do not mention its URL here, because else that last source of free<br>
SCSI wisdom could vanish, too.)<br>
<br></blockquote><div>Yes, also noted, I&#39;ll take a look. I&#39;ve follo=
wed the link and has the doc.</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">
----------------------------------------------------------------------<br>
Smalltalk and anecdotes:<br>
<br>
&gt; libburn : FAILURE : File object &#39;/dev/sr4&#39; not found<br>
<br>
Well, i seem to have more drives attached than you. :))<br>
<br></blockquote><div>I have 2 BD-RE and 1 DVD-RW, yes you have 1 more :))<=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt; user@mtrog64:~$ xorriso -outdev /dev/sr1 -format fast_by_index_4<br>
&gt; ...<br>
&gt; user@mtrog64:~$ xorriso -outdev /dev/sr1 -list_formats =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0<br>
&gt; ...<br>
&gt; Format status: formatted, with 23866.0 MiB<br>
&gt; BD Spare Area: 0 blocks consumed, 0 blocks available<br>
<br>
I rarely use BD-RE without spare area. But given the poor performance<br>
of Defect Management it is plausible to do so, at least for single<br>
session use cases.<br></blockquote><div><br></div><div>Yes in single sessio=
n cases (BD-R or BD-RE) I also disable the spare area, is nonsense. Clean d=
iscs or new, 1 single use.</div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">
With multi-session i would propose minimal spare area because the<br>
emulation of multi-session needs to overwrite the first 64 blocks for<br>
each session. The other blocks get written only once until the medium<br>
is reused from scratch (after pseudo-blanking).<br>
<br></blockquote><div>Thanks for the advise, I use LUKS over the Blurays so=
metimes 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.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex">
I have a BD-RE which takes a small incremental update session every day<br>
since imeanwhile 20 months:<br>
=C2=A0 Media summary: 610 sessions, 9060897 data blocks, 17.3g data, 5894m =
free<br>
Next spring or summer i will have to put it on the shelf and start with<br>
a blank BD-RE again.<br>
<br></blockquote><div>Did you recycle=C2=A0the one on the shelf when anothe=
r 2 or more came?=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">
<br>
&gt; I was enchanted by optical media, because the price/durability is more=
<br>
&gt; affordable than SSD or USBs.<br>
<br>
I began to love them after a DAT tape drive at work turned out to have<br>
made bad backups for two years and the last usable backup was on an old<br>
QIC tape for which we had to buy a used drive to be able to read it.<br>
I gained reputation by presenting new backups as ISO 9660 on CD which the<b=
r>
boss could put into his own desktop computer to check by normal means<br>
whether his favorite files are there and readable. Especially he loved<br>
that he could read the files but not alter them, and that he could read<br>
the backup media at home.<br>
Oh yeah. The late 1990s ...<br>
<br></blockquote><div>Nice story, actually for me, is more affordable than =
Tapes or Hardrives=C2=A0for storing incremental backups, of confidential da=
ta, DVD-RW lasts about 15 or 20 years in my library and still being readabl=
e, I hope BD-RE also has the same durability or more for confidential data =
that grows from year to year.</div><div><br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">
<br>
Have a nice day :)<br>
<br>
Thomas<br>
<br></blockquote><div><br></div><div>Have a nice day, I will read all the d=
ocumentation you suggest.</div><div>=C2=A0</div></div></div>

--00000000000054a77f05cfe6c107--