5

I have a hard drive with bad sectors that I've found using badblocks and whatever Windows uses. I have Lubuntu installed on btrfs, and it's running smoothly for now (where Windows would freeze up), but is there a way to feed badblocks output to btrfs? Or does btrfs do all of this automatically already?

I'm not storing any data that isn't important, this is really just to play around with btrfs and see how good it is at dealing with an actual bad hard drive.

guest
  • 51
  • 1
  • 2

1 Answers1

1

brtrfs doen't support badblocks. It currently assumes that all writes to the device succeed. Don't use it for a drive which is returning uncorrectable SMART sector errors.

More info and a work-around is available here.

The btrfs Project Ideas wiki says:

Not claimed — no patches yet — Not in kernel yet

Currently btrfs doesn't keep track of bad blocks, disk blocks that are very likely to lose data written to them. Btrfs should accept a list in badblocks' output format, store it in a new btree (or maybe in the current extent tree, with a new flag), relocate whatever data the blocks contain, and reserve these blocks so they can't be used for future allocations. Additionally, scrub could be taught to test for bad blocks when a checksum error is found. This would make scrub much more useful; checksum errors are generally caused by the disk, but while scrub detects afflicted files, which in a backup scenario gives the opportunity to recreate them, the next file to reuse the bad blocks will just start getting errors instead. These two items would match an ext4 feature (used through e2fsck).

Please comment if the status changes and I will update this answer.

Tom Hale
  • 3,358
  • 5
  • 16
  • 33