From owner-freebsd-questions@FreeBSD.ORG Mon Mar 4 09:58:46 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E59A4DE6 for ; Mon, 4 Mar 2013 09:58:46 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id B046D9AF for ; Mon, 4 Mar 2013 09:58:46 +0000 (UTC) Received: from r56.edvax.de (port-92-195-109-47.dynamic.qsc.de [92.195.109.47]) by mx02.qsc.de (Postfix) with ESMTP id 56E4727A10; Mon, 4 Mar 2013 10:58:38 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r249widS030011; Mon, 4 Mar 2013 10:58:44 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Mon, 4 Mar 2013 10:58:44 +0100 From: Polytropon To: Damien Fleuriot Subject: Re: Grepping though a disk Message-Id: <20130304105844.72c259f6.freebsd@edvax.de> In-Reply-To: <8402144E-5ECB-44E9-99FB-0258C855FE7B@my.gd> References: <20130304013608.7981e8a9.freebsd@edvax.de> <8402144E-5ECB-44E9-99FB-0258C855FE7B@my.gd> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 09:58:47 -0000 On Mon, 4 Mar 2013 10:09:50 +0100, Damien Fleuriot wrote: > Hey that's actually a pretty creative way of doing things ;) It could be more optimum. :-) My thought is that I could maybe use a better bs= to make the whole thing run faster. I understand that for every unit, a subprocess dd | grep is started and an if [] test is run. Maybe doing this with 1 MB per unit would be better? Note that I need to grep through 1 TB in 10 kB steps... > Just to make sure, you've stopped daemons and all the stuff > that could potentially write to the drive and nuke your > blocks right ? Of course. The /dev/ad6 disk is a separate data disk which is not in use at the moment (unmounted). Still it is possible that the block has already been overwritten, but when the search has finished, it's almost certain in what state the data is. I would rewrite the file, but my eidetic memory is not working well anymore, so I can only remember parts of it... :-( -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...