Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dd: error reading '/dev/sr0': Input/output error

1,134 views
Skip to first unread message

md

unread,
Dec 10, 2018, 1:00:04 AM12/10/18
to
When copying a dvd to file on the harddrive, I'm getting the message
dd: error reading '/dev/sr0': Input/output error
If I first run dvdbackup, then Ctrl-C out of it. I can then reissue the dd command and it will finish fine. If I eject the dvd then insert another dvd, the same situation occurs.

My system:

MD> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.6 (stretch)
Release:        9.6
Codename:       stretch


example terminal session::

MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso
32596480 bytes (33 MB, 31 MiB) copied, 7.00018 s, 4.7 MB/s
dd: error reading '/dev/sr0': Input/output error
67688+0 records in
67688+0 records out
34656256 bytes (35 MB, 33 MiB) copied, 7.55342 s, 4.6 MB/s

MD> dvdbackup -M
libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient
libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000142
libdvdread: Elapsed time 0
<snip>
libdvdread: Elapsed time 0
^C
MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso status=progress
7996654080 bytes (8.0 GB, 7.4 GiB) copied, 1831 s, 4.4 MB/s   
15621264+0 records in
15621264+0 records out
7998087168 bytes (8.0 GB, 7.4 GiB) copied, 1831.44 s, 4.4 MB/s

Gene Heskett

unread,
Dec 10, 2018, 1:50:03 AM12/10/18
to
On Monday 10 December 2018 00:34:58 md wrote:

> When copying a dvd to file on the harddrive, I'm getting the message
> dd: error reading '/dev/sr0': Input/output error
> If I first run dvdbackup, then Ctrl-C out of it. I can then reissue
> the dd command and it will finish fine. If I eject the dvd then insert
> another dvd, the same situation occurs.
>
Classic slow spinup. You can get a better dvd drive that /might/ be
faster.
--
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

Thomas Schmitt

unread,
Dec 10, 2018, 2:50:03 AM12/10/18
to
Hi,

md wrote:
> When copying a dvd to file on the harddrive, I'm getting [...]
> MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso
> 32596480 bytes (33 MB, 31 MiB) copied, 7.00018 s, 4.7 MB/s
> dd: error reading '/dev/sr0': Input/output error

Do you see fresh messages in the output of dmesg ?
Like

Dec 2 13:56:33 ... kernel: [...] Sense Key : Medium Error [current]
Dec 2 13:56:33 ... kernel: [...] Info fld=0x69c0
Dec 2 13:56:33 ... kernel: [...] sr 2:0:0:0: [sr0]
Dec 2 13:56:33 ... kernel: [...] Add. Sense: Unrecovered read error
Dec 2 13:56:33 ... kernel: [...] sr 2:0:0:0: [sr0] CDB:
Dec 2 13:56:33 ... kernel: [...] Read(10): 28 00 00 00 69 b8 00 00 40 00

What do you get from

xorriso -outdev /dev/sr0 \
-check_media use=outdev \
data_to=/sdb1/movie.udf \
--

(It will at least show error messages directly.)


Gene Heskett wrote:
> Classic slow spinup.

After 33 MiB of reading ?

(We have a bug in the kernel since 2008 which prevents waiting for the
drive to become ready after automatic tray loading. But this causes
0 bytes of read result and lets dd end immediately.)


> You can get a better dvd drive

Read failures of decaying drives often show surprising success-or-error
patterns. Depending on how idvdbackup accesses the drive, its doings
might be beneficial.
But reading in

http://manpages.ubuntu.com/manpages/bionic/man1/dvdbackup.1.html
"-M, --mirror
backup the whole DVD"

i'd expect it to read sequentiall, like dd does.

So more questions to md:

- Does a second or third dd run yield success if no dvdbackup was run
inbetween ?

- Does dvdbackup yield a complete set of files if you let it work
until it ends on its own ?


Have a nice day :)

Thomas

md

unread,
Dec 10, 2018, 3:00:04 AM12/10/18
to
>> When copying a dvd to file on the harddrive, I'm getting the message
>> dd: error reading '/dev/sr0': Input/output error
>> If I first run dvdbackup, then Ctrl-C out of it. I can then reissue
>> the dd command and it will finish fine. If I eject the dvd then insert
>> another dvd, the same situation occurs.

> Classic slow spinup. You can get a better dvd drive that /might/ be faster.

You could be right. It hasn't been a problem in the past, but haven't needed to dd a disk in a while.
To test your idea, what other spinup task do you suggest I substitute for dvdbackup?

Gene Heskett

unread,
Dec 10, 2018, 3:20:04 AM12/10/18
to
You could try a two part invocation, dumping the first 3 or 4 megs
to /dev/null with a real invocation separated by a ;
Another thought might be the head sliders are dry, and toothpick sized
drop of light oil on the slider rods might be the ticket if you are up
to cutting the laser warnings off the sheet metal and uncovering it long
enough to apply the drop of oil, the fact that it reads 4 megs or so
could indicate a stuck head carriage because the oil has evaporated, but
the error recovery motions have made it move, and once moving, is ok
until its set a bit and gotten suck again. I'd feel ok doing that but it
does take removal of the covers on the bottom of the drive to access
that area. Just be sure the power and data cables are off it so theres
no chance of the laser coming on while the covers are off doing it.
Those rails could be dirty, in which case not only oil, but qtips to
clean up the first oil and the dirt, then oil again, but be carefull of
bumping the head around.

Gene Heskett

unread,
Dec 10, 2018, 3:30:03 AM12/10/18
to
That much would would also invalidate the dry sliders theory
>
> (We have a bug in the kernel since 2008 which prevents waiting for the
> drive to become ready after automatic tray loading. But this causes
> 0 bytes of read result and lets dd end immediately.)
>
I've noted that too.

> > You can get a better dvd drive
>
> Read failures of decaying drives often show surprising
> success-or-error patterns. Depending on how idvdbackup accesses the
> drive, its doings might be beneficial.
> But reading in
>
> http://manpages.ubuntu.com/manpages/bionic/man1/dvdbackup.1.html
> "-M, --mirror
> backup the whole DVD"
>
> i'd expect it to read sequentiall, like dd does.
>
> So more questions to md:
>
> - Does a second or third dd run yield success if no dvdbackup was run
> inbetween ?
>
> - Does dvdbackup yield a complete set of files if you let it work
> until it ends on its own ?
>
>
> Have a nice day :)
>
> Thomas



--
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
+

Thomas Schmitt

unread,
Dec 10, 2018, 3:50:04 AM12/10/18
to
Hi,

Gene Heskett wrote:
> > > Classic slow spinup.

I wrote:
> > After 33 MiB of reading ?

> That much would would also invalidate the dry sliders theory

There might well be mechanical or optical problems involved. As said,
the failure patterns of drives are variform. Thus my question whether
dd can replace dvdbackup as trailblazer.

------------------------------------------------------------------------
Off topic:

> > (We have a bug in the kernel since 2008 which prevents waiting for the
> > drive to become ready after automatic tray loading.

> I've noted that too.

I identified the two commits involved
(210ba1d1724f5c4ed87a2ab1a21ca861a915f734 and
96bcc722c47d07b6fd05c9d0cb3ab8ea5574c5b1) and have a proposal for a fix.
What i don't have is real iron for kernel development or contact to a
kernel developer who would be interested in the sr driver and its bugs.

The old timeout limit was 20 seconds. My lamest drive needs 18 seconds to
become ready (not by spin-up delay but rather by long reading time when
assessing the medium state). So i'd propose 30 seconds of patience.

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

Jude DaShiell

unread,
Dec 10, 2018, 4:20:03 AM12/10/18
to
On Mon, 10 Dec 2018, Thomas Schmitt wrote:

> Date: Mon, 10 Dec 2018 02:45:43
> From: Thomas Schmitt <scdb...@gmx.net>
> To: debia...@lists.debian.org
> Cc: mick...@protonmail.com
> Subject: Re: dd: error reading '/dev/sr0': Input/output error
> Resent-Date: Mon, 10 Dec 2018 07:46:23 +0000 (UTC)
> Resent-From: debia...@lists.debian.org
Why not prefix that dd command with a sudo udevadm settle command and
only allow the dd command to run on success case?

>

--

Thomas Schmitt

unread,
Dec 10, 2018, 4:40:03 AM12/10/18
to
Hi,

Jude DaShiell wrote:
> Why not prefix that dd command with a sudo udevadm settle command and
> only allow the dd command to run on success case?

man udevadm says:

udevadm settle [options]
Watches the udev event queue, and exits if all current events are
handled.

We have no indication yet that the udev event queue is involved.
(I'd also say that udev traditionally makes additional trouble rather than
preventing some.)

---------------------------------------------------------------------------
Off topic again:
(If dd can read 33 MiB, then it is not a start-up problem.)

The known impatience of Linux with automatic tray loading can be worked
around by pulling in the tray with a burn program (eject -t falls victim
to the kernel impatience).
I use:

xorriso -outdev /dev/sr0

before trying to read the medium by POSIX i/o like dd(1) or read(2).

Gene Heskett

unread,
Dec 10, 2018, 8:00:04 AM12/10/18
to
I personally think thats a heck of a good idea. Someone with commit
rights should make it so.

The best cd/dvd writer we have, k3b, cannot be told to verify its written
image because it times out way too fast at re-recognizing the ejected
and reloaded disk. This has needed fixing since years ago.

> ----------------------------------------------------------------------
>--
>
> Have a nice day :)
>
> Thomas



Gene Heskett

unread,
Dec 10, 2018, 8:10:04 AM12/10/18
to
I was not aware of that utility, from the man page:

udevadm settle [options]
Watches the udev event queue, and exits if all current events are
handled.

--timeout=seconds
Maximum number of seconds to wait for the event queue to become
empty. The default value is 120 seconds. A value of 0 will check
if the queue is empty and always return immediately.

Perhaps there is a place to configure that into k3b, and make a write
verify work?

Gene Heskett

unread,
Dec 10, 2018, 8:30:05 AM12/10/18
to
This is also something that has not been installed till now, and has more
buttons than grandma's button jar. But could it be configured into k3b
for automatic usage? $64k question...

Thanks Thomas
>
> Have a nice day :)
>
> Thomas



md

unread,
Dec 10, 2018, 1:20:03 PM12/10/18
to
In the scenarios when dd fails, the amount that dd reads before failing varies from to movie dvd to movie dvd. At times dd will read 400MB before failing.

A few FWIW snippets:
dvdbackup 'fixes' the dd problem
xorriso doesn't 'fix' the dd problem
xorriso has similar problem to dd
dvdbackup 'fixes' the xorriso problem as well
I haven't spent the time to let dvdbackup or xorriso complete.

=====

When I insert a non-movie dvd (eg a debian install disc I burned) dmesg -w doesn't report anything.

When I insert a movie dvd, dmesg -w reports:

[] sr 4:0:0:0: [sr0] tag#20 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[] sr 4:0:0:0: [sr0] tag#20 Sense Key : Illegal Request [current]
[] sr 4:0:0:0: [sr0] tag#20 Add. Sense: Read of scrambled sector without authentication
[] sr 4:0:0:0: [sr0] tag#20 CDB: Read(10) 28 00 00 3b 23 c0 00 00 40 00
[] blk_update_request: I/O error, dev sr0, sector 15503104
[] sr 4:0:0:0: [sr0] tag#28 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[] sr 4:0:0:0: [sr0] tag#28 Sense Key : Illegal Request [current]
[] sr 4:0:0:0: [sr0] tag#28 Add. Sense: Read of scrambled sector without authentication
[] sr 4:0:0:0: [sr0] tag#28 CDB: Read(10) 28 00 00 3b 23 ce 00 00 02 00
[] blk_update_request: I/O error, dev sr0, sector 15503160
[] Buffer I/O error on dev sr0, logical block 1937895, async page read

Is that normal?

Details in the dmesg report vary from movie dvd to movie dvd, but remain the same for a given movie dvd upon subsequent cycles of eject/insert.

=====
Versions:

dd (coreutils) 8.26
xorriso 1.4.6
dvdbackup 0.4.2

=====
After inserting a movie dvd, dmesg -w makes no no additional
reporting for:

1) dvdbackup -M
   then Ctrl-C

nor

2) xorriso -outdev /dev/sr0 -check_media use=outdev data_to=/sdb1/movie.udf
   then Ctrl-C

nor

3) dvdbackup -M
   then (Ctrl-C)
   then /bin/dd if=/dev/sr0 of=/sdb1/movie.iso

In particular, in (3), dd finishes without causing additional dmesg reporting. Also, subsequent reissues of the dd command doesn't cause additional dmesg reporting..

FWIW, I haven't spent the time to let dvdbackup or xorriso complete.

However, after inserting a movie dvd, running ...

4) /bin/dd if=/dev/sr0 of=/sdb1/movie.iso

or

5) xorriso command
   then Ctrl-C
   then dd if=/dev/sr0 of=/sdb1/movie.iso
  
... causes the following dmesg output:

[] sr 4:0:0:0: [sr0] tag#4 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[] sr 4:0:0:0: [sr0] tag#4 Sense Key : Illegal Request [current]
[] sr 4:0:0:0: [sr0] tag#4 Add. Sense: Read of scrambled sector without authentication
[] sr 4:0:0:0: [sr0] tag#4 CDB: Read(10) 28 00 00 00 04 b8 00 00 40 00
[] blk_update_request: I/O error, dev sr0, sector 4832
[] sr 4:0:0:0: [sr0] tag#7 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[] sr 4:0:0:0: [sr0] tag#7 Sense Key : Illegal Request [current]
[] sr 4:0:0:0: [sr0] tag#7 Add. Sense: Read of scrambled sector without authentication
[] sr 4:0:0:0: [sr0] tag#7 CDB: Read(10) 28 00 00 00 04 b8 00 00 02 00
[] blk_update_request: I/O error, dev sr0, sector 4832
[] Buffer I/O error on dev sr0, logical block 604, async page read

In this scenario, subsequent reruns of the dd command cause dmesg to reissue the same report.  Also, following this scenario, dmesg -w does not issue additional reporting when running ...

dvdbackup -M, then Ctrl-C, /bin/dd if=/dev/sr0 of=/sdb1/movie.iso

=====
xorriso behaves similarly to dd. it succeeds only if dvdbackup -M is run first. Here is the output when running it without dvdbackup -M ...

MD> xorriso -outdev /dev/sr0 -check_media use=outdev data_to=/sdb1/movie.udf
xorriso 1.4.6 : RockRidge filesystem manipulator, libburnia project.

xorriso : NOTE : Disc status unsuitable for writing
Drive current: -outdev '/dev/sr0'
Media current: DVD-ROM
Media status : is written , is closed
Media summary: 1 session, 3871183 data blocks, 7561m data,     0 free
xorriso : UPDATE : 32 blocks read in 3 seconds , 0.0xD
libburn : SORRY : SCSI error on read_10(1216,32): See MMC specs: Sense Key 5 "Illegal request", ASC 6F ASCQ 03.
libburn : SORRY : SCSI error on read_10(1248,32): See MMC specs: Sense Key 5 "Illegal request", ASC 6F ASCQ 03.


Thomas Schmitt

unread,
Dec 10, 2018, 2:00:04 PM12/10/18
to
Hi,

md wrote:
> [] sr 4:0:0:0: [sr0] tag#20 Sense Key : Illegal Request [current]
> [] sr 4:0:0:0: [sr0] tag#20 Add. Sense: Read of scrambled sector without authentication
> [] sr 4:0:0:0: [sr0] tag#20 CDB: Read(10) 28 00 00 3b 23 c0 00 00 40 00

This is probably CSS access restriction.

I guess that dvdbackup is aware how to talk the drive into descrambling.
Some traces in the web point to libdvdcss as helper.
Best looking, content-wise is:
https://cromwell-intl.com/technical/how-to-copy-dvds.html

So it seems not to be a bug but a feature. (Ain't it nice that dvdbackup
can lend its cracking result to subsequent programs ? So we others can
stay out of jail ...)


> libburn : SORRY : SCSI error on read_10(1216,32): See MMC specs: Sense Key 5
> "Illegal request", ASC 6F ASCQ 03.

That's what the sr driver received, too:
5 6F 03 READ OF SCRAMBLED SECTOR WITHOUT AUTHENTICATION

(I should teach libburn to emit the cleartext. ASC 6F has 7 ASCQ variations.)

Gene Heskett

unread,
Dec 10, 2018, 2:10:04 PM12/10/18
to
Has anyone considered that this is some sort of funny business on the
part of the movie publisher so as to constitute a copy prevention
scheme? Not being a movie fan, I now play the movies I do own on an
Apex player with Aussie reflashed firmware, which has no region
recognition by Aussie law. I've never tried but having had a computer
drive bricked by sony music cd's back in the day, has to be considered.
I solved that by feeding my sony cd's to the trash fire and have never
purchased another sony music cd. I lost a drive, but sony has lost much
more than the cost of the drive in sales made to me.

Pascal Hambourg

unread,
Dec 10, 2018, 2:50:04 PM12/10/18
to
Le 10/12/2018 à 06:34, md a écrit :
>
> MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso
> 32596480 bytes (33 MB, 31 MiB) copied, 7.00018 s, 4.7 MB/s
> dd: error reading '/dev/sr0': Input/output error
(...)
> MD> dvdbackup -M
> libdvdread: Attempting to retrieve all CSS keys
> libdvdread: This can take a _long_ time, please be patient
> libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000142

Didn't these messages about CSS keys ring a bell in anybody's mind ?

Looks like it is a video DVD protected with CSS. The DVD drive must be
unlocked first or will issue read errors on some protected sectors.
Check the kernel logs with dmesg.

md

unread,
Dec 10, 2018, 3:20:03 PM12/10/18
to
Using an old PATA-to-USB cable, I attached a 15 year old PATA DVD Drive to the SATA based computer I've been using.  With this drive (/dev/sr1), dd seems to working fine without having to precede it with dvdbackup -M.

In the dvdread README on github, I found this: '..... If you attempt to read scrambled DVD directly with cp/dd/readom, you'll get I/O error (Read of scrambled sector without authentication) on all scrambled sectors ....  dvdread uses libdvdcss to authenticate itself to DVD drive using special IOCTLs, and this eliminates "Read of scrambled sector without authentication" errors'

Thomas Schmitt wrote:
> I guess that dvdbackup is aware how to talk the drive into
> descrambling. Some traces in the web point to libdvdcss
> as helper.
> Best looking, content-wise is:

That is well done.


Thomas Schmitt

unread,
Dec 10, 2018, 3:30:04 PM12/10/18
to
Hi,

md wrote:
> > libdvdread: Attempting to retrieve all CSS keys

Pascal Hambourg wrote:
> Didn't these messages about CSS keys ring a bell in anybody's mind ?

In hindsight, yes.


> Check the kernel logs with dmesg.

This yielded a nice theory about libdvdcss and not going to jail.


md wrote:
> Using an old PATA-to-USB cable, I attached a 15 year old PATA DVD Drive to
> the SATA based computer I've been using.  With this drive (/dev/sr1), dd
> seems to working fine without having to precede it with dvdbackup -M.

But aren't those copied sectors still scrambled ?
(Can you play all the video files that were copied ?)

md

unread,
Dec 11, 2018, 4:10:04 PM12/11/18
to
md wrote:
> Using an old PATA-to-USB cable, I attached a 15 year old PATA DVD Drive to
> the SATA based computer I've been using.  With this drive (/dev/sr1), dd
> seems to working fine without having to precede it with dvdbackup -M.
Thomas Schmitt wrote:
> But aren't those copied sectors still scrambled ?
> (Can you play all the video files that were copied ?)

I don't know if they are scrambled. I suspect so. 
First 30 min of 3 iso's tested fine on Win7 using VLC > OpenFile. 
They play just like the optical disk. 
Temporary. Easier/safer than discs in the station wagon on road trips. YMPGMV

0 new messages