Code Monkey home page Code Monkey logo

Comments (4)

cosmos72 avatar cosmos72 commented on August 21, 2024

Hi @schellingb,

fsremap has no support to specify bad sectors, sorry.

Adding support for such a feature would be relatively straightforward,
but it would require fsremap to know the bad blocks list at start or soon after starting;
changing a (ipotetical) bad block list while running would break support for resuming an unfinished job.

Alternatively, you could hack io/io_posix.cc flush_copy_bytes() to ignore any read request (and maybe also any write request) in a certain range of the device - but this may cause a lot of missing data if part of that range happens to be used as "primary storage" (a kind of persistent buffer) by fsremap.

from fstransform.

schellingb avatar schellingb commented on August 21, 2024

I used dd to read around that area into /dev/null and figured a range of about 100mb that have bad blocks in it. Before and after that range dd was able to read quite large amounts of data with no issues.
I'll try to add some kind of --skip-range=a-b option in flush_copy_bytes and see how that treats me. Should be fun :-)
Thanks for the really quick response!

from fstransform.

cosmos72 avatar cosmos72 commented on August 21, 2024

If the disk is not too badly damaged, I found by experience that writing zeroes with dd into the bad blocks often makes them readable and writeable again (after destroying whatever data was there), so that the disk can be used for a while more. It could be worth a try.

from fstransform.

schellingb avatar schellingb commented on August 21, 2024

I tried writing zeroes over the bad areas but it did not seem to resolve the read errors for me.

Here's the hack I am running for now:

err = ff_log(FC_ERROR, err, "I/O error while copying " CURRENT_OP_FMT, CURRENT_OP_ARGS);
if (read_dev && dev_offset >= 1166647304ULL*512ULL - length*5 && dev_offset <= 1166710592ULL*512ULL + length*5)
{
	ff_log(FC_ERROR, 0, "    Ignoring this read error due to being known bad sector");
	err = 0;
}
else break;

And so far only one error happened:

progress: 19.6% done,   1.4 terabytes still to remap
ERROR: I/O error while copying from device to RAM, read({fd = 5, offset = 597347381248}, address + 363536384, length = 552960): Input/output error
ERROR:     Ignoring this error due to being known bad sector

I'll close this issue for now. Now that I'm not afraid of code modifications I should find my way out of this one way or another :-)

Thanks again for the hints and infos!

from fstransform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.