bug-xorriso
[Top][All Lists]
Advanced

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

Re: [Support] How to blank the DVD+RW media? thanks.


From: Thomas Schmitt
Subject: Re: [Support] How to blank the DVD+RW media? thanks.
Date: Tue, 01 Dec 2020 11:48:42 +0100

Hi,

> I try to blank the DVD+RW media with xorriso 1.5.3 on debian, seems it can
> not work.

When xorriso "blanks" a DVD+RW then it only invalidates the superblock
of the possibly existing ISO 9660 filesystem or zeroizes the first 64 KiB
of the medium, if it does not bear an ISO 9660 filesystem.

Overwritable media like DVD+RW do not need hardware blanking as re-usable
media need. Re-usable are CD-RW and unformatted DVD-RW.
Overwritable are DVD-RAM, DVD+RW, BD-RE, and formatted DVD-RW.


> seems xorriso not support DVD+RW media to blank?

The man pages mentions "used overwriteable media". So for xorriso's purposes
the overwritable media mentioned above can be blanked.
xorriso's blanking is not guranteed to make the medium unmountable, but
only promises that xorriso will not load sessions from the medium and that
a new session will be written beginning at block 0.


> max@max-PC:/home$ xorriso -dev /dev/sr0 -blank as_needed
> ...
> Media status : is blank

So xorriso does not recognize an ISO 9660 filesystem any more and also
no non-ISO-9660 data in the first 64 KiB of the medium.


> max@max-PC:/home$ sudo mount /dev/sr0 /mnt
> mount: /mnt: WARNING: device write-protected, mounted read-only.

I wonder what kind of filesystem the Linux kernel recognizes.

The easiest guess is that it has enough of the old data of the DVD+RW
buffered and does not really look at the medium. Since only a few KiB of
data have been erased, this illusion can be uphold until the buffers get
flushed.

The only reliable way to flush the Linux buffers belonging to an optical
is to eject the medium. After re-insertion, a mount attempt should rather
yield:

  mount: /dev/sr0 is write-protected, mounting read-only
  mount: wrong fs type, bad option, bad superblock on /dev/sr0,
         missing codepage or helper program, or other error

         In some cases useful info is found in syslog - try
         dmesg | tail or so.

If it still can be mounted, then there are other recognizable remainings
on the medium which let Linux operate on the old data.


If you want to make all data on the medium unreadable you have to make a
full write run with all zeros (or random data):

  xorriso -as cdrecord dev=/dev/sr0 -v /dev/zero

This needs no "blanking" because the cdrecord emulation of xorriso does
not consider any data on the medium. It just determines that the medium
is writable from start and then it does the writing.

The run will end with an error message because /dev/zero delivers more
data than the medium can take.
  libburn : FATAL : Exceeding range of permissible write addresses (2295104 >= 
2295104)
  ...
  xorriso : FAILURE : libburn indicates failure with writing.

This does not hamper the purpose of erasing all data.

If you want to prevent the error, you may curb input to the medium size.

  xorriso -outdev /dev/sr0 -toc 2>/dev/null | fgrep 'Media blocks'

will say something like

  Media blocks : 1173472 readable , 1121632 writable , 2295104 overall

Use the "overall" number as count= with dd bs=2048 and pipe its output
into xorriso -as cdrecord:

  dd if=/dev/zero bs=2048 count=2295104 | \
  xorriso -as cdrecord dev=/dev/sr0 -v padsize=0 -eject -

This run is supposed to end properly if the medium is completely good.
In this case a drive with motorized tray will eject the medium.


After sucessfully erasing the medium, ejecting and reloading, mount is
supposed to fail, because there is no filesystem:

  mount: wrong fs type, bad option, bad superblock on /dev/sr0,
         missing codepage or helper program, or other error

The message
  mount: /dev/sr0 is write-protected, mounting read-only
has obviously nothing to do with the medium properties. I can find it in
/bin/mount but not in the source code of util-linux. So it is a bit a
riddle from where it comes and why it happens.


Have a nice day :)

Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]