Erasing RW bluray disks in Mint 21 Vanessa

Questions about hardware, drivers and peripherals
Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
otavioc
Level 1
Level 1
Posts: 18
Joined: Thu Feb 25, 2021 1:33 pm

Erasing RW bluray disks in Mint 21 Vanessa

Post by otavioc »

Hi all, I used to erase RW bluray disks in my LG bluray driver on Mint 19. Both Xfburn and K3b were capable to do so. Since I updated Linux to Cinnamon 5.4.12 (Linux Mint 21 Vanessa), Xfburn, K3b, growisofs and wodim are not capable to do so any more. For example, as seen in the image bellow "Xfburn.png", the option "Apagar (Erase)" never becomes available.

in the command line, wodim is also unable to do so:

Code: Select all

~# wodim -v -force blank=all dev=/dev/sr0
TOC Type: 1 = CD-ROM
scsidev: '/dev/sr0'
devname: '/dev/sr0'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.11
SCSI buffer size: 64512
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   : 
Vendor_info    : 'HL-DT-ST'
Identification : 'BD-RE  BH10LS30 '
Revision       : '1.00'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0043 (BD-RE)
Profile: 0x0040 (BD-ROM) 
Profile: 0x0041 (BD-R sequential recording) 
Profile: 0x0042 (BD-R random recording) 
Profile: 0x0043 (BD-RE) (current)
Profile: 0x0012 (DVD-RAM) 
Profile: 0x0011 (DVD-R sequential recording) 
Profile: 0x0015 (DVD-R/DL sequential recording) 
Profile: 0x0016 (DVD-R/DL layer jump recording) 
Profile: 0x0014 (DVD-RW sequential recording) 
Profile: 0x0013 (DVD-RW restricted overwrite) 
Profile: 0x001A (DVD+RW) 
Profile: 0x001B (DVD+R) 
Profile: 0x002B (DVD+R/DL) 
Profile: 0x0010 (DVD-ROM) 
Profile: 0x0009 (CD-R) 
Profile: 0x000A (CD-RW) 
Profile: 0x0008 (CD-ROM) 
Profile: 0x0002 (Removable disk) (current)
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE 
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
Drive buf size : 2031616 = 1984 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
Drive DMA Speed: 17111 kB/s 97x CD 12x DVD
Current Secsize: 2048
  ATIP start of lead in:  -150 (00:00/00)
Disk type:    unknown dye (reserved id code)
Manuf. index: -1
Manufacturer: unknown (not in table)
Speed set to 10338 KB/s
Waiting for drive to calm down.
Starting to write CD/DVD at speed  58.0 in real force BLANK mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
Errno: 5 (Input/output error), blank unit scsi sendcmd: no error
CDB:  A1 00 00 00 00 00 00 00 00 00 00 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0A A1 00 00 B0 30 05 00 00
Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0
Sense flags: Blk 0 (not valid) 
cmd finished after 0.040s timeout 9600s
Starting to write CD/DVD at speed  58.0 in real force BLANK mode for single session.
No chance to quit anymore. Operation starts.
Performing OPC...
Blanking entire disk
Errno: 5 (Input/output error), blank unit scsi sendcmd: no error
CDB:  A1 00 00 00 00 00 00 00 00 00 00 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0A A1 00 00 B0 30 05 00 00
Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0
Sense flags: Blk 0 (not valid) 
cmd finished after 0.048s timeout 9600s
wodim: Cannot blank disk, aborting.
~# 
By using "inxi" and "lshw", it seems Mint 21 does not recognize the LG driver as a bluray driver:

Code: Select all

~# inxi -d
Drives:
  Local Storage: total: 928.35 GiB used: 280.82 GiB (30.2%)
  ID-1: /dev/sda vendor: Kingston model: SUV400S37240G size: 223.57 GiB
  ID-2: /dev/sdb vendor: Seagate model: ST500LT012-1DG142 size: 465.76 GiB
  ID-3: /dev/sdc type: USB vendor: Samsung model: Flash Drive FIT
    size: 239.02 GiB
  Optical-1: /dev/sr0 vendor: HL-DT-ST model: BD-RE BH10LS30
    dev-links: cdrom
  Features: speed: 40 multisession: yes audio: yes dvd: yes
    rw: cd-r,cd-rw,dvd-r,dvd-ram
~# 
~# 
~# 
~# lshw
aquila                      
    descrição: Computador desktop
    ............
    *-cdrom
         descrição: DVD-RAM writer
         produto: BD-RE  BH10LS30
         fabricante: HL-DT-ST
         ID físico: 1
         informações do barramento: scsi@3:0.0.0
         nome lógico: /dev/cdrom
         nome lógico: /dev/sr0
         versão: 1.00
         capacidades: removable audio cd-r cd-rw dvd dvd-r dvd-ram
         configuração: ansiversion=5 status=ready
         *-medium
            ID físico: 0
            nome lógico: /dev/cdrom
    ............
~# 
any hints? or shall I return to Mint 19? :-(
Thank you all

Image
Attachments
Xfburn.png
Xfburn.png (69.9 KiB) Viewed 154 times
scdbackup
Level 3
Level 3
Posts: 108
Joined: Thu Jun 04, 2015 2:00 am

Re: Erasing RW bluray disks in Mint 21 Vanessa

Post by scdbackup »

Hi,

> wodim -v -force blank=all dev=/dev/sr0

This cannot work because BD-RE are random-access overwritable and thus
cannot be blanked by SCSI command A1h BLANK. The drive refuses righteously
with "Illegal Request".

It is not necessary to erase a BD-RE if you just want to re-use it.
It makes only sense if you want to make (secret) content unreadable.
In this case you simply have to overwrite the medium with new (non-secret)
content.

> it seems Mint 21 does not recognize the LG driver as a bluray driver:

The operating system only has to recognize the burner as optical drive
and to represent it by a /dev/sr device file. The rest of recognition is
the job of the burn program. (And this is good because the kernel code
for optical drives is mainly from last century.)

Xfburn recognizes the BD-RE. Maybe you need to make some choices in the
menu before the greyed out "Apagar" becomes clickable.

If you can tolerate an ugly error message about medium overflow, then try
overwriting by:

Code: Select all

dd bs=2048 if=/dev/zero | \
  xorriso -as cdrecord -v dev=/dev/sr0 stream_recording=on  padsize=0 -
If you want to avoid the overflow error at the end, you need to find out
the formatted capacity by e.g.:

Code: Select all

xorriso -outdev /dev/sr0 -toc
which will reply something like:

Code: Select all

...
Media blocks : 0 readable , 12088320 writable , 12088320 overall
...
Then you use the "overall" number with dd option "count=", like:

Code: Select all

dd bs=2048 count=12088320 if=/dev/zero | \
  xorriso -as cdrecord -v dev=/dev/sr0 stream_recording=on  padsize=0 -
Both overwrite runs need about 40 minutes.

If privacy is very important, then overwriting by zeros might not be
good enough. In this case you need to feed "xorriso -as cdrecord" with
random bytes. (Regrettably /dev/urandom is slow and program "shred" offers
no option to direct its output to standard out.)

(xorriso has a concept of "blank", "appendable", and "closed" BD-RE.
This corresponds to zeroized content of the first 64 KiB of the BD-RE,
to a recognizable ISO 9660 fileystem, and to unrecognizable content in
the first 64 KiB of the BD-RE, respectively.
Apply

Code: Select all

xorriso -outdev /dev/sr0 -blank as_needed
to get the BD-RE into state pseudo-blank.)

Have a nice day :)

Thomas
otavioc
Level 1
Level 1
Posts: 18
Joined: Thu Feb 25, 2021 1:33 pm

Re: Erasing RW bluray disks in Mint 21 Vanessa

Post by otavioc »

Hi, Thomas, thank you for your reply.
It is not necessary to erase a BD-RE if you just want to re-use it ...
Neither Xfburn nor K3b let me write on an already written BD-RW.
The operating system only has to recognize the burner as optical drive ...
That's the point. Both "inxi" and "lshw" seemed to recognize the LG drive as "cd-r, cd-rw, dvd, dvd-r, dvd-ram", but not as a BD drive.
Xfburn recognizes the BD-RE. Maybe you need to make some choices in the menu before the greyed out "Apagar" becomes clickable ...
There is no such an option. It's awkward Xfburn interface offers an option (erase) which does not work... On the other hand, K3b finishes the erasing operation, BUT in fact, the BD-RW keeps its contents.

I installed "xorriso" and it worked! Maybe Xfburn and K3b versions in Mint 19 used "xorriso" to erase RW disks. The Ubuntu repository does not contain the most recent version of Xfburn (0.7.0). Instead it contains the version 0.6.2-1build1. I gave up installing the most recent version because it needs installing/upgrading lots of ancillary packages.

I consider the post solved, and list below the result of running "xorriso", just to help others with the same problem in the future. Thank you very much again.

Code: Select all

~# umount /dev/sr0
~# 
~# xorriso -outdev /dev/sr0 -blank as_needed
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev '/dev/sr0'
Media current: BD-RE
Media status : is written , is appendable
Media summary: 1 session, 323 data blocks,  646k data, 23.1g free
Beginning to blank medium in mode 'fast'.
Blanking done
xorriso : NOTE : Re-assessing -outdev '/dev/sr0'
Drive current: -outdev '/dev/sr0'
Media current: BD-RE
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 23.1g free
~# 
scdbackup
Level 3
Level 3
Posts: 108
Joined: Thu Jun 04, 2015 2:00 am

Re: Erasing RW bluray disks in Mint 21 Vanessa

Post by scdbackup »

Hi,
It's awkward Xfburn interface offers an option (erase) which does not work...
Well, classically "erase" means SCSI command BLANK. libburn would send
this command only if the drive reports to hold a CD-RW or a DVD-RW.

It looks like Xfburn inquires eraseability by libburn call
burn_disc_erasable() in
https://sources.debian.org/src/xfburn/0 ... l=360#L360
With BD-RE, the reply by libburn is 0, which causes in Xfburn function
is_valid_blank_mode() the reply FALSE if the medium is not a DVD-RW
(profiles 0x13 and 0x14):
https://sources.debian.org/src/xfburn/0 ... l=346#L252
Xfburn function fill_combo_mode() counts the valid modes among the big
list of blank, format, and deformat modes.
https://sources.debian.org/src/xfburn/0 ... l=346#L236
But none is valid. So variable n is 0 when gtk_widget_set_sensitive()
gets called to make the button active if n > 0:
https://sources.debian.org/src/xfburn/0 ... l=346#L249
Neither Xfburn nor K3b let me write on an already written BD-RW.
That's strange. Do they tell any reason for their refusal ?
Maybe Xfburn and K3b versions in Mint 19 used "xorriso" to erase RW disks.
Quite unlikely. Xfburn operates the drive via libburn, which also works
under xorriso. Afaik, K3b uses dvd+rw-format for blanking DVD.
I consider the post solved, and list below the result of running "xorriso",
just to help others with the same problem in the future.
The shown xorriso run detected a small ISO 9660 filesystem and invalidated
it by changing a byte in the filesystem's superblock (Primary Volume
Descriptor). So afterwards xorriso considers the medium as "blank" and
would be willing to create a new ISO 9660 filesystem on it.

When the medium was still considered "appendable", xorriso would have been
willing to load the directory tree of the filesystem, to manipulate it,
and to store it and the newly added file content as second session.
Like

Code: Select all

xorriso -dev /dev/sr0 -map /hard/disk/directory /iso/9660/directory
Have a nice day :)

Thomas
HyperBear
Level 1
Level 1
Posts: 8
Joined: Thu May 04, 2023 3:39 am

correction

Post by HyperBear »

Thank you, Thomas, for the elaborate answer.
However, I would like to make a minor correction:
scdbackup wrote: Wed May 03, 2023 4:27 am If privacy is very important, then overwriting by zeros might not be
good enough.
One overwrite pass already nullifies any data. It is like molten ice sculptures. The water provides no hint as to how the ice sculptures looked like. Overwriting with anything destroys any hint about prior data.
Post Reply

Return to “Hardware Support”