From owner-freebsd-fs@FreeBSD.ORG Sun Oct 23 11:54:01 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53F6F106564A for ; Sun, 23 Oct 2011 11:54:01 +0000 (UTC) (envelope-from ml@my.gd) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id DE8E08FC0C for ; Sun, 23 Oct 2011 11:54:00 +0000 (UTC) Received: by wyi40 with SMTP id 40so6862369wyi.13 for ; Sun, 23 Oct 2011 04:53:59 -0700 (PDT) Received: by 10.216.9.216 with SMTP id 66mr1916992wet.7.1319370839613; Sun, 23 Oct 2011 04:53:59 -0700 (PDT) Received: from [10.101.174.142] ([92.90.16.50]) by mx.google.com with ESMTPS id e7sm32716170wbh.12.2011.10.23.04.53.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 23 Oct 2011 04:53:58 -0700 (PDT) References: In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8J2) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (8J2) From: Damien Fleuriot Date: Sun, 23 Oct 2011 13:53:50 +0200 To: James Coldwell Cc: "freebsd-fs@freebsd.org" Subject: Re: Restore a ZFS mirror setup (GPT, ZFS-on-root) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Oct 2011 11:54:01 -0000 On 23 Oct 2011, at 11:26, James Coldwell wr= ote: > Hello List, >=20 > My Problem: > My server wouldn't come back up after a reboot. > It is a 8.2-RELEASE system, running a two-disk ZFS mirror setup. > It is a dedicated box in a remote datacenter. > I can boot up some linux-based rescue system. >=20 > The way I installed FreeBSD on it was with mfsbsd, the zpool was > created as such: > set poolname=3D"z0" > set dev1=3D"ad4" > set dev2=3D"ad6" > set swapsize=3D"4G" > set zfssize=3D"300G" > gpart delete -i 1 ${dev1} > gpart delete -i 1 ${dev2} > gpart destroy ${dev1} > gpart destroy ${dev2} > gpart create -s gpt ${dev1} > gpart create -s gpt ${dev2} > gpart add -b 34 -s 64k -t freebsd-boot ${dev1} > gpart add -s ${swapsize} -t freebsd-swap -l swap0 ${dev1} > gpart add -s ${zfssize} -t freebsd-zfs -l disk0 ${dev1} > gpart add -b 34 -s 64k -t freebsd-boot ${dev2} > gpart add -s ${swapsize} -t freebsd-swap -l swap1 ${dev2} > gpart add -s ${zfssize} -t freebsd-zfs -l disk1 ${dev2} > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${dev1} > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${dev2} > zpool create ${poolname} mirror /dev/gpt/disk0 /dev/gpt/disk1 >=20 > That worked perfectly for half a year. > Suddenly, it wouldn't come back up after a reboot. >=20 > What I want to do now is mount the filesystem and check for misconfigurati= on. > So I once again booted into the linux-based rescue system, dd'd mfsbsd > onto the first disk (/dev/sda), booted it up. > This FreeBSD-based system is called "prealpha". > That's where I am now: > prealpha# gpart show > =3D> 0 976773168 ada0 BSD (466G) > 0 16 - free - (8.0K) > 16 65520 1 !0 (32M) > 65536 976707632 - free - (466G) >=20 > =3D> 34 976773101 ada1 GPT (466G) > 34 128 1 freebsd-boot (64K) > 162 8388608 2 freebsd-swap (4.0G) > 8388770 629145600 3 freebsd-zfs (300G) > 637534370 339238765 - free - (162G) > prealpha# ls /dev/gpt/ > disk1 swap1 > The devices changed name from ad4/ad6 to ada0/ada1 because mfsbsd > loads the ahci module now. > I want to mount the zpool from ada1, and view/edit some configuration file= s. > After that, I want to restore the mirror setup with ada0 and ada1 and > try to boot again. >=20 > How do I do that? > Any help would be appreciated, I probably forgot to mention vital > details, I am in a bit of a panic right now. > Please tell me if you need for details. >=20 Did you try zpool import ?