Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2017 18:19:54 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        "Mikhail T." <mi+thun@aldan.algebra.com>
Cc:        freebsd-fs <freebsd-fs@freebsd.org>
Subject:   Re: Low-level format an SATA-drive?
Message-ID:  <CANCZdfp1jGZyxmSamDdDURe%2Bzt-G-dijVfWwC9Hk8cd%2B39D65g@mail.gmail.com>
In-Reply-To: <5b6394f6-1c0a-5b1e-bf5e-84e848905392@aldan.algebra.com>
References:  <5b6394f6-1c0a-5b1e-bf5e-84e848905392@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 3, 2017 at 6:13 PM, Mikhail T. <mi+thun@aldan.algebra.com>
wrote:

> 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...

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfp1jGZyxmSamDdDURe%2Bzt-G-dijVfWwC9Hk8cd%2B39D65g>