From owner-freebsd-questions@freebsd.org Mon Apr 18 20:56:11 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB52CB13614 for ; Mon, 18 Apr 2016 20:56:11 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from cosmo.uchicago.edu (cosmo.uchicago.edu [128.135.70.90]) by mx1.freebsd.org (Postfix) with ESMTP id B3BA819BC for ; Mon, 18 Apr 2016 20:56:11 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: by cosmo.uchicago.edu (Postfix, from userid 48) id 3C17CCB8CA2; Mon, 18 Apr 2016 15:56:05 -0500 (CDT) Received: from 128.135.52.6 (SquirrelMail authenticated user valeri) by cosmo.uchicago.edu with HTTP; Mon, 18 Apr 2016 15:56:05 -0500 (CDT) 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> <20160418065534.GA2198@c720-r292778-amd64> <20160418204526.GA86917@neutralgood.org> Date: Mon, 18 Apr 2016 15:56:05 -0500 (CDT) Subject: Re: tool for mapping away bad blocks on an external disk From: "Valeri Galtsev" To: "Kevin P. Neal" Cc: freebsd-questions@freebsd.org Reply-To: galtsev@kicp.uchicago.edu User-Agent: SquirrelMail/1.4.8-5.el5.centos.7 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2016 20:56:12 -0000 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 ++++++++++++++++++++++++++++++++++++++++