Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2016 15:56:05 -0500 (CDT)
From:      "Valeri Galtsev" <galtsev@kicp.uchicago.edu>
To:        "Kevin P. Neal" <kpn@neutralgood.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re:  tool for mapping away bad blocks on an external disk
Message-ID:  <31454.128.135.52.6.1461012965.squirrel@cosmo.uchicago.edu>
In-Reply-To: <20160418204526.GA86917@neutralgood.org>
References:  <20160417072641.GA2358@c720-r292778-amd64> <20160417093957.0b1acb4c37d7c15a4b06af88@sohara.org> <alpine.BSF.2.20.1604171023510.30232@wonkity.com> <nf0h0u$5ij$1@ger.gmane.org> <alpine.BSF.2.20.1604171136320.30232@wonkity.com> <20160418065534.GA2198@c720-r292778-amd64> <20160418204526.GA86917@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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.

Valeri

>
> 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                                http://www.pobox.com/~kpn/
>
>  "Good grief, I've just noticed I've typed in a rant. Sorry chaps!"
>                             Keir Finlow Bates, circa 1998
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe@freebsd.org"
>


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31454.128.135.52.6.1461012965.squirrel>