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

Re: Spare Tables error on format



Thankyou Thomas, evidently dvd+rw-format has an error in the source code, because there is no such value that satisfies a proper format inquiry.
dvd+rw-format has a nice idea, about specifying the close spare area size, and finding the closest format index value, but fails.

I did not have much knowledge like others of C/C++ or debugging hardware, but I will try with the hints you write in the next email.

I've found BD-RE brand new from Japan, and I think it is the better than ever storage media for Cold Backups, since I have old, very old, CD-RW, or DVD-RW media intact, without any kind of data loss.

Recently I've been involved in small projects about 1 month each, and I have to keep the information confidential and safe for as long as I can. So, that's because xorriso -outdev /dev/sr1 -format fast_by_index_2 saved my day.

Thank you again, I really appreciate it.

Here my experiment:
################
user@mtrog64:~$ dvd+rw-format -f /dev/sr1 -ssa=262144000
* BD/DVD±RW/-RAM format utility by <appro@fy.chalmers.se>, version 7.1.
* 24.2GB BD media detected.
* formatting .:-[ FORMAT UNIT failed with SK=5h/INVALID FIELD IN PARAMETER LIST]: Input/output error
user@mtrog64:~$ dvd+rw-format -f /dev/sr0 -ssa=262144000
* BD/DVD±RW/-RAM format utility by <appro@fy.chalmers.se>, version 7.1.
:-( mounted media doesn't appear to be DVD±RW, DVD-RAM or Blu-ray
user@mtrog64:~$ dvd+rw-format -f /dev/sr1 -ssa=262144000
* BD/DVD±RW/-RAM format utility by <appro@fy.chalmers.se>, version 7.1.
* 24.2GB BD media detected.
* formatting .:-[ FORMAT UNIT failed with SK=5h/INVALID FIELD IN PARAMETER LIST]: Input/output error
user@mtrog64:~$ xorriso -outdev /dev/sr4 -list_formats
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

libburn : FAILURE : File object '/dev/sr4' not found
libburn : FAILURE : Cannot access '/dev/sr4' as SG_IO CDROM drive
xorriso : FAILURE : Cannot acquire drive '/dev/sr4'
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
user@mtrog64:~$ xorriso -outdev /dev/sr1 -list_formats
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.6g free
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.6g free
Format status: formatted, with 23098.0 MiB
BD Spare Area: 0 blocks consumed, 393216 blocks available
Format idx 0 : 00h , 11826176s , 23098.0 MiB
Format idx 1 : 30h , 11826176s , 23098.0 MiB
Format idx 2 : 30h , 11564032s , 22586.0 MiB
Format idx 3 : 30h , 12088320s , 23610.0 MiB
Format idx 4 : 31h , 12219392s , 23866.0 MiB
user@mtrog64:~$ dvd+rw-mediainfo /dev/sr1
INQUIRY:                [PIONEER ][BD-RW   BDR-209D][1.51]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         43h, BD-RE
 Media ID:              CMCMAG/CN2
 Current Write Speed:   2.0x4495=8990KB/s
 Write Speed #0:        2.0x4495=8990KB/s
 Speed Descriptor#0:    00/11826175 R@2.0x4495=8990KB/s W@2.0x4495=8990KB/s
READ DISC INFORMATION:
 Disc status:           complete
 Number of Sessions:    1
 State of Last Session: complete
 Number of Tracks:      1
READ FORMAT CAPACITIES:
 formatted:             11826176*2048=24220008448
 00h(3000):             11826176*2048=24220008448
 30h(3000):             11826176*2048=24220008448
 30h(5000):             11564032*2048=23683137536
 30h(1000):             12088320*2048=24756879360
 31h(800):              12219392*2048=25025314816
READ TRACK INFORMATION[#1]:
 Track State:           complete
 Track Start Address:   0*2KB
 Free Blocks:           0*2KB
 Track Size:            11826176*2KB
FABRICATED TOC:
 Track#1  :             14@0
 Track#AA :             14@11826176
 Multi-session Info:    #1@0
READ CAPACITY:          11826176*2048=24220008448
user@mtrog64:~$ xorriso -outdev /dev/sr1 -format fast_by_index_0
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.6g free
Beginning to format medium.
xorriso : UPDATE : Formatting  ( 1.0% done in 1 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 2 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 3 seconds )
xorriso : UPDATE : Formatting  ( 1.8% done in 4 seconds )
xorriso : UPDATE : Formatting  ( 2.7% done in 5 seconds )
xorriso : UPDATE : Formatting  ( 3.6% done in 6 seconds )
xorriso : UPDATE : Formatting  ( 4.4% done in 7 seconds )
xorriso : UPDATE : Formatting  ( 5.3% done in 8 seconds )
xorriso : UPDATE : Formatting  ( 6.1% done in 9 seconds )
xorriso : UPDATE : Formatting  ( 6.9% done in 10 seconds )
xorriso : UPDATE : Formatting  ( 7.8% done in 11 seconds )
xorriso : UPDATE : Formatting  ( 8.7% done in 12 seconds )
xorriso : UPDATE : Formatting  ( 9.5% done in 13 seconds )
xorriso : UPDATE : Formatting  ( 10.3% done in 14 seconds )
xorriso : UPDATE : Formatting  ( 11.2% done in 15 seconds )
xorriso : UPDATE : Formatting  ( 12.0% done in 16 seconds )
xorriso : UPDATE : Formatting  ( 12.9% done in 17 seconds )
xorriso : UPDATE : Formatting  ( 13.8% done in 18 seconds )
xorriso : UPDATE : Formatting  ( 14.6% done in 19 seconds )
xorriso : UPDATE : Formatting  ( 15.5% done in 20 seconds )
xorriso : UPDATE : Formatting  ( 16.3% done in 21 seconds )
xorriso : UPDATE : Formatting  ( 17.1% done in 22 seconds )
xorriso : UPDATE : Formatting  ( 18.0% done in 23 seconds )
xorriso : UPDATE : Formatting  ( 18.9% done in 24 seconds )
xorriso : UPDATE : Formatting  ( 18.9% done in 25 seconds )
Formatting done
xorriso : NOTE : Re-assessing -outdev '/dev/sr1'
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.6g free
user@mtrog64:~$ dvd+rw-mediainfo /dev/sr1                      
INQUIRY:                [PIONEER ][BD-RW   BDR-209D][1.51]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         43h, BD-RE
 Media ID:              CMCMAG/CN2
 Current Write Speed:   2.0x4495=8990KB/s
 Write Speed #0:        2.0x4495=8990KB/s
 Speed Descriptor#0:    00/11826175 R@2.0x4495=8990KB/s W@2.0x4495=8990KB/s
READ DISC INFORMATION:
 Disc status:           complete
 Number of Sessions:    1
 State of Last Session: complete
 Number of Tracks:      1
READ FORMAT CAPACITIES:
 formatted:             11826176*2048=24220008448
 00h(3000):             11826176*2048=24220008448
 30h(3000):             11826176*2048=24220008448
 30h(5000):             11564032*2048=23683137536
 30h(1000):             12088320*2048=24756879360
 31h(800):              12219392*2048=25025314816
READ TRACK INFORMATION[#1]:
 Track State:           complete
 Track Start Address:   0*2KB
 Free Blocks:           0*2KB
 Track Size:            11826176*2KB
FABRICATED TOC:
 Track#1  :             14@0
 Track#AA :             14@11826176
 Multi-session Info:    #1@0
READ CAPACITY:          11826176*2048=24220008448
user@mtrog64:~$ xorriso -outdev /dev/sr1 -list_formats          
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.6g free
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.6g free
Format status: formatted, with 23098.0 MiB
BD Spare Area: 0 blocks consumed, 393216 blocks available
Format idx 0 : 00h , 11826176s , 23098.0 MiB
Format idx 1 : 30h , 11826176s , 23098.0 MiB
Format idx 2 : 30h , 11564032s , 22586.0 MiB
Format idx 3 : 30h , 12088320s , 23610.0 MiB
Format idx 4 : 31h , 12219392s , 23866.0 MiB
user@mtrog64:~$ xorriso -outdev /dev/sr1 -format fast_by_index_3
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.6g free
Beginning to format medium.
xorriso : UPDATE : Formatting  ( 1.0% done in 1 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 2 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 3 seconds )
xorriso : UPDATE : Formatting  ( 2.5% done in 4 seconds )
xorriso : UPDATE : Formatting  ( 4.2% done in 5 seconds )
xorriso : UPDATE : Formatting  ( 5.7% done in 6 seconds )
xorriso : UPDATE : Formatting  ( 7.2% done in 7 seconds )
xorriso : UPDATE : Formatting  ( 8.8% done in 8 seconds )
xorriso : UPDATE : Formatting  ( 10.3% done in 9 seconds )
xorriso : UPDATE : Formatting  ( 12.0% done in 10 seconds )
xorriso : UPDATE : Formatting  ( 13.5% done in 11 seconds )
xorriso : UPDATE : Formatting  ( 15.0% done in 12 seconds )
xorriso : UPDATE : Formatting  ( 15.0% done in 13 seconds )
Formatting done
xorriso : NOTE : Re-assessing -outdev '/dev/sr1'
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.1g free
user@mtrog64:~$ xorriso -outdev /dev/sr1 -list_formats          
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.1g free
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.1g free
Format status: formatted, with 23610.0 MiB
BD Spare Area: 0 blocks consumed, 131072 blocks available
Format idx 0 : 00h , 11826176s , 23098.0 MiB
Format idx 1 : 30h , 11826176s , 23098.0 MiB
Format idx 2 : 30h , 11564032s , 22586.0 MiB
Format idx 3 : 30h , 12088320s , 23610.0 MiB
Format idx 4 : 31h , 12219392s , 23866.0 MiB
user@mtrog64:~$ xorriso -outdev /dev/sr1 -format fast_by_index_4
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.1g free
Beginning to format medium.
xorriso : UPDATE : Formatting  ( 1.0% done in 1 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 2 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 3 seconds )
xorriso : UPDATE : Formatting  ( 3.2% done in 4 seconds )
xorriso : UPDATE : Formatting  ( 5.7% done in 5 seconds )
xorriso : UPDATE : Formatting  ( 7.9% done in 6 seconds )
xorriso : UPDATE : Formatting  ( 10.1% done in 7 seconds )
xorriso : UPDATE : Formatting  ( 12.6% done in 8 seconds )
xorriso : UPDATE : Formatting  ( 14.8% done in 9 seconds )
xorriso : UPDATE : Formatting  ( 17.0% done in 10 seconds )
xorriso : UPDATE : Formatting  ( 19.3% done in 11 seconds )
Formatting done
xorriso : NOTE : Re-assessing -outdev '/dev/sr1'
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.3g free
user@mtrog64:~$ xorriso -outdev /dev/sr1 -list_formats          
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.3g free
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.3g free
Format status: formatted, with 23866.0 MiB
BD Spare Area: 0 blocks consumed, 0 blocks available
Format idx 0 : 00h , 11826176s , 23098.0 MiB
Format idx 1 : 30h , 11826176s , 23098.0 MiB
Format idx 2 : 30h , 11564032s , 22586.0 MiB
Format idx 3 : 30h , 12088320s , 23610.0 MiB
Format idx 4 : 31h , 12219392s , 23866.0 MiB
user@mtrog64:~$ xorriso -outdev /dev/sr1 -format fast_by_index_2
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.3g free
Beginning to format medium.
xorriso : UPDATE : Formatting  ( 1.0% done in 1 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 2 seconds )
xorriso : UPDATE : Formatting  ( 1.0% done in 3 seconds )
xorriso : UPDATE : Formatting  ( 2.1% done in 4 seconds )
xorriso : UPDATE : Formatting  ( 3.2% done in 5 seconds )
xorriso : UPDATE : Formatting  ( 4.4% done in 6 seconds )
xorriso : UPDATE : Formatting  ( 5.5% done in 7 seconds )
xorriso : UPDATE : Formatting  ( 6.6% done in 8 seconds )
xorriso : UPDATE : Formatting  ( 7.8% done in 9 seconds )
xorriso : UPDATE : Formatting  ( 8.8% done in 10 seconds )
xorriso : UPDATE : Formatting  ( 9.9% done in 11 seconds )
xorriso : UPDATE : Formatting  ( 11.1% done in 12 seconds )
xorriso : UPDATE : Formatting  ( 12.2% done in 13 seconds )
xorriso : UPDATE : Formatting  ( 13.3% done in 14 seconds )
xorriso : UPDATE : Formatting  ( 14.5% done in 15 seconds )
xorriso : UPDATE : Formatting  ( 15.6% done in 16 seconds )
xorriso : UPDATE : Formatting  ( 15.6% done in 17 seconds )
Formatting done
xorriso : NOTE : Re-assessing -outdev '/dev/sr1'
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.1g free
user@mtrog64:~$ xorriso -outdev /dev/sr1 -list_formats
xorriso 1.5.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.1g free
Drive current: -outdev '/dev/sr1'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 22.1g free
Format status: formatted, with 22586.0 MiB
BD Spare Area: 0 blocks consumed, 655360 blocks available
Format idx 0 : 00h , 11826176s , 23098.0 MiB
Format idx 1 : 30h , 11826176s , 23098.0 MiB
Format idx 2 : 30h , 11564032s , 22586.0 MiB
Format idx 3 : 30h , 12088320s , 23610.0 MiB
Format idx 4 : 31h , 12219392s , 23866.0 MiB
user@mtrog64:~$ dvd+rw-mediainfo /dev/sr1
INQUIRY:                [PIONEER ][BD-RW   BDR-209D][1.51]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         43h, BD-RE
 Media ID:              CMCMAG/CN2
 Current Write Speed:   2.0x4495=8990KB/s
 Write Speed #0:        2.0x4495=8990KB/s
 Speed Descriptor#0:    00/11564031 R@2.0x4495=8990KB/s W@2.0x4495=8990KB/s
READ DISC INFORMATION:
 Disc status:           complete
 Number of Sessions:    1
 State of Last Session: complete
 Number of Tracks:      1
READ FORMAT CAPACITIES:
 formatted:             11564032*2048=23683137536
 00h(3000):             11826176*2048=24220008448
 30h(3000):             11826176*2048=24220008448
 30h(5000):             11564032*2048=23683137536
 30h(1000):             12088320*2048=24756879360
 31h(800):              12219392*2048=25025314816
READ TRACK INFORMATION[#1]:
 Track State:           complete
 Track Start Address:   0*2KB
 Free Blocks:           0*2KB
 Track Size:            11564032*2KB
FABRICATED TOC:
 Track#1  :             14@0
 Track#AA :             14@11564032
 Multi-session Info:    #1@0
READ CAPACITY:          11564032*2048=23683137536

On Mon, Oct 25, 2021 at 7:33 AM Thomas Schmitt <scdbackup@gmx.net> wrote:
Hi,

if you can afford to wait the up to 5000 seconds for a full format,
then try

  dvd+rw-format -force=full /dev/sr0 -ssa=min

-------------------------------------------------------------------------
Long story:

I found an old modified dvd+rw-tools directory which i used to spy on
growisofs when i noticed behavior differences between it and libburn.
(Substantial parts of libburn's DVD and BD knowledge was learned from
dvd+rw-tools. But the need to see its actual SCSI transactions came up
later when supporting growisofs users.)

The failing SCSI command transaction is

  FORMAT UNIT
  04 11 00 00 00 00
  To drive: 12b
  00 82 00 08 00 b8 74 00 c3 00 10 00
  +++ key=5  asc=26h  ascq=00h   (     4 ms)

FOV bit and Immed bit are set in the Format List Header.
8 bytes are announced for the Format Descriptor, which requests 0xb87400
= 12088320 blocks, which is indeed the largest possible payload and thus
requests the smallest possible size of the Spare Area.
Format Type is 0x30 (BD-R or BD-RE with spares).
Format-Subtype is 3 (Quick Certification).
Type Dependend Parameter is 0x00 0x010 0x00.

Spying on libburn by

  xorriso -scsi_log on -outdev /dev/sr4 -format fast_by_index_3 \
    2>&1 | tee -i /tmp/xorriso.log

yields this successful transaction

  FORMAT UNIT
  04 11 00 00 00 00
  To drive: 12b
  00 82 00 08 00 b8 74 00 c0 00 10 00

The only difference to dvd+rw-format is the Format-Subtype:
0 (Quick Reformat) instead of 3 (Quick Certification).


Now i begin to find traces in libburn. A comment from 2008 says
   LG GGW-H20L YL03 refuses on 0x30 with
   "Quick certification". dvd+rw-format
   does 0x00 by default and succeeds quickly.
Newer is a test for the Quick Certification flag in feature 23h,
which would prevent Sub-type 3 if not set.

Looking at
  https://sources.debian.org/src/dvd+rw-tools/7.1-14/dvd%252Brw-format.cpp/#L791
which has

        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"

gives the idea that a run of

  dvd+rw-format -force=full /dev/sr0 -ssa=min

might succeed.

(My test BD-RE currently gets a -format by_index_3 run of xorriso and
will be ready for more experiments in an hour and a half ...)

----------------------------------------------------------------------------

If -force=full helps, then a patch candidate would be to replace

            formats[i+4+4] |= 3;// "Quick Certification"

by a no-op (the 0 is already written to formats[i+4+4]):

            ; // "Quick Reformat" because "Quick Certification" often fails

I am not sure whether this will work with all drives.
Maybe better would be to inquire bit 2 of byte 4 of feature 23h from the
GET CONFIGURATION command which already inquires the mmc_profile, i.e.
the current media type and personality.
If that bit is not set, then libburn uses Format Sub-Type 0 instead of 3
or 2 ("Full Certification").


Further i will have to find out why both softwares send a Type Dependend
Parameter that is not all 0. Might be debris from the Format Descriptors
which gets sent back to the drives. Only good that they gracefully ignore
that 0x10 byte.


Have a nice day :)

Thomas


Reply to: