Low-level format an SATA-drive?

Warner Losh imp at bsdimp.com
Mon Dec 4 01:19:55 UTC 2017

On Sun, Dec 3, 2017 at 6:13 PM, Mikhail T. <mi+thun at aldan.algebra.com>

> It used to be, performing a "low-level format" could get a few more months
> -- may be a year -- out of a failing drive. How would I try that today?
> The camcontrol has a "format" subcommand, but it just gives me an error:
>    # camcontrol format /dev/ada3
>    You are about to REMOVE ALL DATA from the following device:
>    camcontrol: scsiformat: error sending inquiry
> Is my drive simply beyond repair, or is camcontrol being "naive" in some
> way?

I don't think that SATA support low level format.

If it is spinning rust, then dd if=/dev/zero of=/dev/ada3 bs=1m might do
the trick. If it's an SSD, then maybe a secure erase will help.

I say maybe in both cases because it's a crapshoot once drives get bad
enough to start throwing bad sectors back to the OS. Modern HDD will remap
bad sectors on rewrite, and doing a full write sequentially is a little
nicer to some drives, but won't hurt. SSDs try very hard to get your data
back, so if it's throwing errors and hasn't been through a 'shock event'
(eg, baking in a datacenter in PR after the hurricanes hit for months),
chances are very high that even a secure erase won't help much at all...


More information about the freebsd-fs mailing list