From owner-freebsd-stable@FreeBSD.ORG Wed Apr 27 19:35:45 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B2C21065676 for ; Wed, 27 Apr 2011 19:35:45 +0000 (UTC) (envelope-from freebsd-stable@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id C09E88FC17 for ; Wed, 27 Apr 2011 19:35:44 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QFAWM-0004HG-5B for freebsd-stable@freebsd.org; Wed, 27 Apr 2011 21:35:34 +0200 Received: from p5dcd6b31.dip.t-dialin.net ([93.205.107.49]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Apr 2011 21:35:34 +0200 Received: from jumper99 by p5dcd6b31.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Apr 2011 21:35:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-stable@freebsd.org From: "Helmut Schneider" Date: Wed, 27 Apr 2011 19:35:22 +0000 (UTC) Lines: 89 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p5dcd6b31.dip.t-dialin.net User-Agent: XanaNews/1.19.1.320 X-Ref: news.gmane.org ~XNS:00000165 X-Antivirus: avast! (VPS 110427-1, 27.04.2011), Outbound message X-Antivirus-Status: Clean Subject: Re: correct way to setup gmirror on 7.4? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2011 19:35:45 -0000 Michael Proto wrote: > I'm migrating away from my old pseudo-RAID partitions to GEOM gmirror > and I have some questions on the right way to accomplish this. I've > got two new 1TB disks that I'm setting up for the new mirror, and > unfortunately they're Western Digital drives with 4k sectors that > report themselves as 512b. > > Here's what I'm currently doing to setup this array. The disks are > detected as ad4 and ad6 on my FreeBSD 7.4 server. > > # initialize/wipe MBR > dd if=/dev/zero of=/dev/ad4 bs=512 count=79 > dd if=/dev/zero of=/dev/ad6 bs=512 count=79 > # gpart > gpart create -s gpt ad4 > gpart create -s gpt ad6 > gpart bootcode -b /boot/pmbr ad4 > gpart bootcode -b /boot/pmbr ad6 > # add partitions > gpart add -t freebsd-ufs -l raidhome1-2 -b 2048 -s 195330048 ad4 > gpart add -t freebsd-ufs -l raidhome2-2 -b 2048 -s 195330048 ad6 > gpart add -t freebsd-ufs -l raidvault1-2 -b 195338240 -s 1758167040 > ad4 gpart add -t freebsd-ufs -l raidvault2-2 -b 195338240 -s > 1758167040 ad6 > > (I'm using these partition start values because they divide evenly > into 4k blocks. I don't mind wasting a few MB on each disk to have > correctly-aligned partitions) > > gpart show ad4 > => 34 1953525101 ad4 GPT (932G) > 34 2014 - free - (1.0M) > 2048 195330048 1 freebsd-ufs (93G) > 195332096 6144 - free - (3.0M) > 195338240 1758167040 2 freebsd-ufs (838G) > 1953505280 19855 - free - (9.7M) > > gpart show ad6 > => 34 1953525101 ad6 GPT (932G) > 34 2014 - free - (1.0M) > 2048 195330048 1 freebsd-ufs (93G) > 195332096 6144 - free - (3.0M) > 195338240 1758167040 2 freebsd-ufs (838G) > 1953505280 19855 - free - (9.7M) > > gmirror label -v -n -b round-robin gm0p1 /dev/ad4p1 > newfs -U -b 32768 -f 4096 -S 4096 /dev/mirror/gm0p1 > > gmirror label -v -n -b round-robin gm0p2 /dev/ad4p2 > newfs -U -b 32768 -f 4096 -S 4096 /dev/mirror/gm0p2 > > (then I mount /dev/mirror/gm0p1 and /dev/mirror/gm0p2 and copy data > from my original array to this new array) > > Finally I insert the ad6 disk and wait for the array to sync: > > gmirror configure -a gm0p1 > gmirror insert gm0p1 /dev/ad6p1 > > gmirror configure -a gm0p2 > gmirror insert gm0p2 /dev/ad6p2 > > > Once the array is synchronized things generally look good, although > after a reboot I did see the following that had me concerned (from > dmesg output): > > GEOM: ad4: the primary GPT table is corrupt or invalid. > GEOM: ad4: using the secondary instead -- recovery strongly advised. > > Am I using the correct process to create this array? No. While this works with MBR it fails with GPT as GPT and GEOM both want to use the last sector of the disk. First create the mirror and after that gpart it. It will create a message like GEOM: da0: the secondary GPT header is not in the last LBA. GEOM: da1: the secondary GPT header is not in the last LBA. which afaik is ignorable. At least it works fine here and I didn't find any caveats in the net. Another workaround is not to mirror the disk but only slices or partitions. HTH, Helmut