Can the disk (ATA) be setup so that a failing read doesn't take too long, so that it can be dropped, and the reading process and the disk wouldn't be blocked, and the next read could be attempted?
No.
My understanding of this is that it's a logical problem resulting from a design choice (not unique to linux) that favours performance and stability for working hardware, since the OS cannot reasonably be expected to deal with the endless possibilities presented by "possibly malfunctioning" hardware. We do have a Q&A about this.
if you are trying to read as much data as can be read from a disk with bad sectors
If it's bad sectors, you are in luck; umount the affected partitions and (presuming they are ext formatted) run e2fsck -cy /dev/whatever
on them. The -c
switch runs badblocks
and adds individual addresses to a "bad blocks list" in the partition; when it is subsequently mounted, the system will never attempt to access them. This may mean you've lost some data; bits of it may be found in the /lost+found
directory. The -y
switch saves you from manually saying "Yes, fix it" to fsck's questions, of which there may be a great many.
However, if it's not bad blocks (e.g., it's a failing controller), you are out of luck. Stuff breaks, which is why keeping regular backups of vital data is so important. I'm not sure if running e2fsck -cy
on a disk with a broken controller may make the situation worse, which is something to consider, but OTOH, if you cannot get what you need anyway, you have nothing to lose.