badsect(8) is gone -- what now?

Peter Jeremy peter at rulingia.com
Mon Jul 30 06:38:26 UTC 2018


On 2018-Jul-27 15:07:43 +0200, Robert Clausecker <fuz at fuz.su> wrote:
>Is there any way the kernel interface for badsect(8) or a utilitiy
>fulfilling a similar purpose is going to come back?  I understand that
>kernel support was removed due to possible misuse of mknod(S_IFMT)
>leading to crashes [1], but there really ought to be some way to mark a
>sector as bad if the disk doesn't want to do it for you.

All modern disks do bad sector mapping in the drive firmware.  In general,
if you disk reaches a point where it can't remap a visibly bad sector then
the drive's internal set of spare blocks is exhausted and the disk is about
to fail completely.  The recommended solution is to replace the disk.  Have
you looked at the disk's SMART stats (using eg ports/sysutils/smartmontools)?

One approach I've used in the past is to create a file covering the bad
sector(s), mark it immutable and stash it somewhere where you don't attempt
to read it.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20180730/a66a14f8/attachment.sig>


More information about the freebsd-fs mailing list