From owner-freebsd-questions@FreeBSD.ORG Fri Nov 23 19:55:32 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEDF516A418 for ; Fri, 23 Nov 2007 19:55:31 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 7733C13C467 for ; Fri, 23 Nov 2007 19:55:31 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-25-183.bredband.comhem.se ([83.253.25.183]:64591 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Ivecb-0004L8-9Q for freebsd-questions@freebsd.org; Fri, 23 Nov 2007 20:55:30 +0100 Received: (qmail 58921 invoked from network); 23 Nov 2007 20:55:29 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 23 Nov 2007 20:55:29 +0100 Received: (qmail 86994 invoked by uid 1001); 23 Nov 2007 20:55:29 +0100 Date: Fri, 23 Nov 2007 20:55:29 +0100 From: Erik Trulsson To: Gert Lynge Message-ID: <20071123195529.GA86913@owl.midgard.homeip.net> Mail-Followup-To: Gert Lynge , freebsd-questions@freebsd.org References: <20071122155640.fa7e0536.wmoran@potentialtech.com> <20071123092146.E0E1B2878E@smtp.proximedia.com> <14989d6e0711230545k4b32c55bs3564647043f9f4ed@mail.gmail.com> <20071123150500.GA85473@owl.midgard.homeip.net> <01e301c82dfa$f049c720$d0dd5560$@org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01e301c82dfa$f049c720$d0dd5560$@org> User-Agent: Mutt/1.5.16 (2007-06-09) X-Originating-IP: 83.253.25.183 X-Scan-Result: No virus found in message 1Ivecb-0004L8-9Q. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1Ivecb-0004L8-9Q 5c2e25445f93ed6f1d6f2286e490198e Cc: freebsd-questions@freebsd.org Subject: Re: SV: RAID1 synchronisation - howto OR not necessary? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2007 19:55:32 -0000 On Fri, Nov 23, 2007 at 07:01:56PM +0100, Gert Lynge wrote: > >The disks themselves handle the checksumming to detect bad blocks. > >With modern disks it is *very* rare that a block on the disk goes bad > >without the disk being able to report it it as such. > >This means that if you have a functioning RAID1 setup and one of the > >disks report a bad block, then the controller can simply read the > >corresponding block from the other disk, and rewrite it to the disk > >with the bad block. If a disk has problems writing a block it will > >transparently re-map the block to another. > >The problems can occur when one disk in a RAID-array has failed and you > >try to rebuild it from the other disk(s). If you then encounter a bad block > >on that disk you have a problem since you don't have a good copy of that > >block. > >This is what verification (which, btw, is not the same as synchronization) > >tries to prevent by reading every block on each disk on a regular basis. > >Then the RAID controller can recover the data on any bad blocks from the > >other disk(s) in the array. > > I've been wondering how to do this with a BIOS assisted soft raid for some > time. > I have a server with ad4 ad6 in a mirror detected as ar0: > ---- > ws# atacontrol status ar0 > ar0: ATA RAID1 subdisks: ad4 ad6 status: READY > ---- > ws# cat /var/run/dmesg.boot > [...] > ar0: 76316MB status: READY > ar0: disk0 READY (master) using ad4 at ata2-master > ar0: disk1 READY (mirror) using ad6 at ata3-master > [...] > ---- > > ...and was wondering if dd could not do the job for me? > ---- > ws# man dd > [...] > EXAMPLES > Check that a disk drive contains no bad blocks: > dd if=/dev/ad0 of=/dev/null bs=1m > [...] > ---- > > What if I run: > dd if=/dev/ad4 /of=/dev/null bs=1m > dd if=/dev/ad6 /of=/dev/null bs=1m > > ...once a week - will that not verify that the two drives can read all > blocks? Yes. If those complete without any errors then you know that the disks are fine. If one of the disks show a bad block you could then try using 'dd' to copy that block from the other disk. Hopefully this will not confuse the ataraid(4) code. It shouldn't, but you never know. > > It would be nice to limit the load (the throughput of dd) though - anyone > know if that is possible? Maybe by pipeing through a second command (I guess > a throughput limiter could easily be programmed?). > -- Erik Trulsson ertr1013@student.uu.se