On Tue, Nov 26, 2019 at 8:30 PM Christopher Staples <mastercatz@xxxxxxxxx> wrote: > > will their ever be a better way to handle bad sectors ? I keep > getting silent corruption from random bad sectors > scrubs keep passing with out showing any errors , but if I do a > ddrescue backup to a new drive I find the bad sectors Bad sectors manifest in two ways: the drive reports UNC on read or write, or Btrfs reports a checksum mismatch. If Btrfs isn't catching it, but the data is wrong, it's probably a memory problem that causes the corruption and subsequently a checksum computation based on that corruption which is why Btrfs thinks it's correct. > I like btrfs for the snapshot ability , but when it comes to keeping > data safe ext4 seems better ? at least it looks for bad sectors and > marks them , btrfs just seems to write and assumes its written .. That's the wrong way of looking at it. If there are a small number of bad physical sectors, upon write, the drive firmware will remap the LBA to a reserve sector. There's no appearance of bad sectors outside the drive at all, and no error reported. That's normal behavior. If the drive has a lot of bad sectors, eventually all the reserve sectors get used up, and now the drive has to report UNC on write - a write error. This is a device that's inevitably going to betray you with far worse problems and data loss, so papering over it with an external bad sector map isn't something anyone will recommend in a data integrity context. Replace the drive. -- Chris Murphy
