tool for mapping away bad blocks on an external disk

Valeri Galtsev galtsev at
Mon Apr 18 20:56:12 UTC 2016

On Mon, April 18, 2016 3:45 pm, Kevin P. Neal wrote:
> On Mon, Apr 18, 2016 at 08:55:34AM +0200, Matthias Apitz wrote:
>> Thanks for all the hints; I started last night with overwriting the full
>> disk with:
>> # dd conv=noerror if=/dev/zero of=/dev/da0 bs=1m
> Just curious: Does anyone know what happens when there is not enough space
> at the end of a disk (or tape) to write the entire block? Does a partial
> block get written, or does no block get written?

As far as I understand, block device (/dev/da0) operations are "quantized"
in size of blocks the device reports to the system. (which are either 512
bytes or 4kbytes on most modern 4kn drives) So, the last thing that will
happen is: last writable block will be fully written, then as next block
is beyond the device border error will be reported. So, you will never
have "few bits at the end of drive" not overwritten by dd command above.


> It is because I don't know what happens that I usually pick a block size
> that is mathematically factored out from the number of blocks on the disk
> (and then multiplied by the number of bytes in a block obviously).
> --
> Kevin P. Neal                      
>  "Good grief, I've just noticed I've typed in a rant. Sorry chaps!"
>                             Keir Finlow Bates, circa 1998
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at"

Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

More information about the freebsd-questions mailing list