From owner-freebsd-questions@FreeBSD.ORG Wed Apr 23 07:22:51 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBDDD7C3 for ; Wed, 23 Apr 2014 07:22:50 +0000 (UTC) Received: from mail-yk0-x236.google.com (mail-yk0-x236.google.com [IPv6:2607:f8b0:4002:c07::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE7CB1A65 for ; Wed, 23 Apr 2014 07:22:50 +0000 (UTC) Received: by mail-yk0-f182.google.com with SMTP id 142so472519ykq.41 for ; Wed, 23 Apr 2014 00:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4oE3oxWjFGNvdsOoiulOXF53rYfFs79PiaoB6GtXnpA=; b=xplORmWatHjAw5nK6tFGoyFxBkKzm9PKElyIZWCyEXsCIgejYQeRqYJCh9zMVZFji9 aVZFNZk4kFECafk8kke/WHJh4PjegTZxkO9JdQuz4c7DDLsXBrt3Iqs9OawRlXGA2uPh fEKvB3q/APMHFAib4PUy5RL6NcR768UCmdLUA/15eiNA2ZXs4A9/uXpjLIUO1sz955nI UYRe1ID2tG2xEKuLMbYDrMpQbDTeZ2Ehu/VO1XAgFHskH7SlijxxSdfJBjhLFzu4DOTB yWytHWshfR5N88/fg3twMWhddjJpW9YJs64aOujdLKIORWLInYonwhgii7S+X44W9otN PAKw== MIME-Version: 1.0 X-Received: by 10.236.199.78 with SMTP id w54mr8684236yhn.139.1398237769876; Wed, 23 Apr 2014 00:22:49 -0700 (PDT) Received: by 10.170.54.17 with HTTP; Wed, 23 Apr 2014 00:22:49 -0700 (PDT) In-Reply-To: <5356E7C7.6000503@fjl.co.uk> References: <5344484C.9000504@fjl.co.uk> <5356E7C7.6000503@fjl.co.uk> Date: Wed, 23 Apr 2014 08:22:49 +0100 Message-ID: Subject: Re: Adding second drive to ZFS mirror - FreeBSD, atacontrol, gptid and documentation From: krad To: Frank Leonhardt Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 07:22:51 -0000 I dont think wiping was needed. What I would have done is 1. create a new gpt layout on the new disk leaving 4MB free at the end to cater for small differencies in drive size. Also using raws isnt ideal as you wont be 4k aligned. 2. Once the new gpt layout is in place, create a new pool on it. 3. duplicate any root dataset and pool set options 4. do a recursive snapshot of the old pool from the root dataset 5. recursively send the above snapshot to the new pool 6. install any required boot blocks 7. recreate any zpool.cache files you need 8. reboot and make sure the new pool is all in place how you want 9. double check 8 10 double check 9 11. destroy old pool 12. gpart backup/restore new drives gpt 13. install boot blocks on old drive 14. attach old drive sorry i didnt read this sooner On 22 April 2014 23:05, Frank Leonhardt wrote: > On 08/04/2014 20:04, Frank Leonhardt wrote: > >> Background: I ordered two identical drives with a view to installing >> FreeBSD 10 on a ZFS mirror. One drive was DOA so I sent it back and pressed >> on. It was replaced with an identical drive. Now I come to creating a >> mirrored ZFS root post-install. >> >> The new drive is there and appears in the gptid directory (I think). I >> have: >> >> # ls -l /dev/gptid >> crw-r----- 1 root operator 0x5d Mar 20 11:24 b20a8b87-9419-11e3-9063- >> 001fc6b111fc >> crw-r----- 1 root operator 0x61 Mar 18 16:50 b251371d-9419-11e3-9063- >> 001fc6b111fc >> >> I'm a little hazy about how I tie this up. I definitely have /dev/ad4p? >> and /dev/ad6 when I look. >> >> But this get's weird. atacontrol is missing - we're supposed to use >> camcontrol now, right? Okay, it's implied as being there in the release >> notes, but there's no man page for it and camcontrol produces: >> >> # camcontrol devlist >> at scbus0 target 0 lun 0 (ada0,pass0) >> at scbus1 target 0 lun 0 (ada1,pass1) >> at scbus5 target 0 lun 0 (da0,pass2) >> at scbus5 target 0 lun 1 (da1,pass3) >> at scbus5 target 0 lun 2 (da2,pass4) >> >> The top two are my babies, and they appear in /dev too. (I am certain >> there are NO SCSI or USB drives on this box): >> >> crw-r----- 1 root operator 0x51 Mar 18 16:50 /dev/ada0 >> crw-r----- 1 root operator 0x53 Mar 20 11:24 /dev/ada0p1 >> crw-r----- 1 root operator 0x55 Mar 18 16:50 /dev/ada0p2 >> crw-r----- 1 root operator 0x57 Mar 18 16:50 /dev/ada0p3 >> crw-r----- 1 root operator 0x5a Mar 18 16:50 /dev/ada1 >> >> What's going on? I just ran with it and tried to add the second drive as >> a mirror using the instructions for Solaris published by Oracle: >> >> # zpool attach zroot gptid/b251371d-9419-11e3-9063-001fc6b111fc >> gptid/b20a8b87-9419-11e3-9063-001fc6b111fc >> >> And for my trouble I got: >> >> cannot attach gptid/b20a8b87-9419-11e3-9063-001fc6b111fc to >> gptid/b251371d-9419-11e3-9063-001fc6b111fc: device is too small >> >> For completeness: >> >> # zpool status >> >> pool: zroot >> state: ONLINE >> scan: none requested >> config: >> >> NAME STATE READ WRITE >> CKSUM >> zroot ONLINE 0 0 0 >> gptid/b251371d-9419-11e3-9063-001fc6b111fc ONLINE 0 0 0 >> >> >> Does anyone understand this? Am I doing something wrong? The FreeBSD >> installer slices up the drive whereas Solaris doesn't (AFAIK) and this may >> relevant. In case the new drive, although theoretically identical, was >> actually "too small" as per the error message I checked: >> >> Old Drive: >> >> Model Family: Western Digital Red (AF) >> Device Model: WDC WD10EFRX-68JCSN0 >> Serial Number: WD-WCC1U4956043 >> LU WWN Device Id: 5 0014ee 2b3cb08f1 >> Firmware Version: 01.01A01 >> User Capacity: 1,000,204,886,016 bytes [1.00 TB] >> Sector Sizes: 512 bytes logical, 4096 bytes physical >> Device is: In smartctl database [for details use: -P show] >> ATA Version is: ATA8-ACS (minor revision not indicated) >> SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s) >> >> New Drive: >> >> Model Family: Western Digital Red (AF) >> Device Model: WDC WD10EFRX-68PJCN0 >> Serial Number: WD-WCC4J1746659 >> LU WWN Device Id: 5 0014ee 25ef68b37 >> Firmware Version: 01.01A01 >> User Capacity: 1,000,204,886,016 bytes [1.00 TB] >> Sector Sizes: 512 bytes logical, 4096 bytes physical >> Rotation Rate: 5400 rpm >> Device is: In smartctl database [for details use: -P show] >> ATA Version is: ACS-2 (minor revision not indicated) >> SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s) >> >> As I said, identical. I've obviously guessed the runes incorrectly. Help! >> >> > Well, so much for ZFS. After a couple more weeks trying, and no one > hereabouts having any clue, I gave up and reinstalled FreeBSD 10, wiping > out the first drive in the process. It was a PITA to have to do it, but it > worked just fine (no messages about the drives being the wrong size or > anything else like that). > > Adding a mirror drive to a zroot initially created by the FreeBSD 10 > installer remains unanswered question. > > Regards, Frank. > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions- > unsubscribe@freebsd.org" >