From owner-freebsd-stable@FreeBSD.ORG Wed Apr 27 19:07:18 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 31E931065675 for ; Wed, 27 Apr 2011 19:07:18 +0000 (UTC) (envelope-from mike@jellydonut.org) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id CC1978FC19 for ; Wed, 27 Apr 2011 19:07:17 +0000 (UTC) Received: by ewy1 with SMTP id 1so805320ewy.13 for ; Wed, 27 Apr 2011 12:07:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.110.203 with SMTP id o11mr1070346ebp.82.1303929822535; Wed, 27 Apr 2011 11:43:42 -0700 (PDT) Received: by 10.213.10.131 with HTTP; Wed, 27 Apr 2011 11:43:42 -0700 (PDT) Date: Wed, 27 Apr 2011 14:43:42 -0400 Message-ID: From: Michael Proto To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: 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:07:18 -0000 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? Since I still have my old array in the system I can rebuild it again if needed, and would prefer to do it correctly if I'm not already. Thanks all! -Proto