Author: Hendrik Boom Date: To: dng Subject: Re: [DNG] Can this drive be saved?
On Sat, Aug 29, 2020 at 06:45:15PM -0700, Gregory Nowak wrote: > On Sat, Aug 29, 2020 at 04:35:01PM -0500, golinux@??? wrote:
> > What are the chances of fsck repairing the bad sectors? I shamefully admit I
> > have not thought about fsck for years.
> This looks to be at the media level, so is most likely beyond
> fsck. Since you said you can afford to lose this drive's contents, I
> would suggest using dd to fill the drive with zeros:
> dd if=/dev/zero of=/dev/sdx
> where /dev/sdx is the designation for your drive. This might cause the
> drive to reallocate the bad sector, or to mark the bad sector as good
There's also the badblocks program, which can be set up either to do a
nondestructive read-only test for bad blocks, or a more throrough
destructive test, where it writes every block and later checks tht it
can read it correctly again, using a variety of bit patterns.
That might make the hard drive reassign the bad blocks on its own.
If the hard drive doesn't do that, you can always use the -c option of
the e2fsck and mke2fs so that the ext2 file system will avoid using any
of the bad blocks of its own accord.
It's possible to feed the results from badblocks in to the e2fsck or
mke2fs yourself (instead of using the -c option) but it's recommended
you *not* do that because you have to tell badblocks several file-system
paramters in order for its list of bad blocks to match the file-system's
block numbering scheme, and e2fsck and mke2fs know how to do this
> Then, run a SMART test on the drive again. If it still fails,
> then that drive probably can't be fixed. If the SMART test passes this
> time, you can restore your backups on to it and keep using it. If you
> do that, be very sure to sync that drive with your other backups
> frequently, and don't rely on it exclusively.
> If you don't want to wait for dd to write the entire drive, you can try
> following this tutorial instead:
badblocks in its most thorough mode will likely take longer than dd
because it writes and reads the entire drive multiple times, but it is
I use it to test new drives after purchase before use, and I have
occasionally ended up returning a new drive under warranty. The
replacement worked fine.