coreutils
[Top][All Lists]
Advanced

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

dd - behavior on read error


From: David Balažic
Subject: dd - behavior on read error
Date: Mon, 10 Apr 2017 15:37:11 +0200

Hi!

Using dd on Ubuntu 16.04.2 LTS (64 bit) I discovered this behavior
that was (for me) unexpected.

There is a bad sector on /dev/sda which on read attempt returns an i/o error.
Suppose it is sector number 50.

So: dd if=/dev/sda bs=512 count=1 skip=50
result: I/O error printed on stderr, exit status code is 1 (non zero,
don't remember the exact value)

But this: dd if=/dev/sda bs=2048 count=1 skip=12
returns exit code 0 and no error. It reads 1024 bytes (up to the
erroring sector)

Is this by design? I would expect an I/O error to be reported (in exit code).

Regards,
David



reply via email to

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