News for hackers. Stuff that matters.
Re:Debian-installer, mdadm configuration and the Bad Blocks ... by nisa on Tuesday September 15, 2020 @03:50AM (#24478831)
bad blocks on harddisks are also often remapped when written to. However in my (limited) experience once you get badblocks the disk detoriates often. So this badblocks feature is probably not as useful because the harddisk firmware is the only place that knows about badblocks and "lies" to you.

However for deciding if an old disk is still usable I've found that overwriting the whole disks multiple times with the badblocks utility (https://linux.die.net/man/8/badblocks) - if the disk passes multiple runs without generating new bad blocks it's often still usable

Re:Debian-installer, mdadm configuration and the Bad Blocks ... by jwilk on Tuesday September 15, 2020 @05:39AM (#24479431)
linux.die.net man pages tend to be badly outdated. And you can't easily tell this is the case, because because they strip version information.

For example, this one doesn't document the -B option, which was added in 2011(!):

https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/...

Better man page link:

https://man7.org/linux/man-pages/man8/badblocks.8.html

Re:Debian-installer, mdadm configuration and the Bad Blocks ... by teddyh on Tuesday September 15, 2020 @01:32PM (#24484071)
If you use Debian, I would suggest https://manpages.debian.org/stable/e2fsprogs/badblocks.8.en.... (where you can replace “stable” with whatever designator you like.)
Re:Debian-installer, mdadm configuration and the Bad Blocks ... by magicalhippo on Tuesday September 15, 2020 @04:03AM (#24478909)
> However in my (limited) experience once you get badblocks the disk detoriates often.

This used to be my experience as well. However I've had a couple of WD Reds that developed a few (~20) bad sectors, one two years ago the other three. Both have been stable since, and I run periodic scrubs on them.

When the first one happened I had planned to swap it out, but was a bit low on cash right then so waited a bit. Then I saw it didn't deteriorate further so I go curious and decided to wait. Still waiting.

Re:Debian-installer, mdadm configuration and the Bad Blocks ... by hoseja on Tuesday September 15, 2020 @09:06AM (#24480746)
Feels like handling OOM; an abstraction breakdown you think you can cleverly work around but is actually not easily handled at all.
Re:Debian-installer, mdadm configuration and the Bad Blocks ... by marcan_42 on Tuesday September 15, 2020 @04:27AM (#24479040)
Generally, a small handful of bad blocks (and they come in groups due to the physical format and sector size emulation) aren't an indicator of imminent trouble. If they can be written to properly, then that could just be random data corruption caused by e.g. an unlucky hard shutdown, vibration, or other random thing. If they can't be written to, it could just be very minor drive damage or a weak area of the platter (and in this case, the drive will remap them and increase the bad block count in the SMART data)

Now if you start getting into the hundreds, then yeah, the drive is dying.

Re:Debian-installer, mdadm configuration and the Bad Blocks ... by londons_explore on Tuesday September 15, 2020 @07:45AM (#24480115)
Lots of drives don't seem to measure their own power supply... That means if you run them on a laptop with a slightly out of spec power supply, you can get the drive marking hundreds of bad sectors, yet when you put them in another machine they're fine again.

If you're designing something as complex as a drive, you would have thought they'd have a bit of electronics to test the power supply and refuse to work (with some relevant error code) if it's out of spec.