From owner-freebsd-fs@FreeBSD.ORG Sun Oct 23 09:49:00 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 5FAD0106567A for ; Sun, 23 Oct 2011 09:49:00 +0000 (UTC) (envelope-from coldwelljames11@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id E515A8FC26 for ; Sun, 23 Oct 2011 09:48:59 +0000 (UTC) Received: by bkbzu17 with SMTP id zu17so8828056bkb.13 for ; Sun, 23 Oct 2011 02:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ehsQ3jjzpa9+VPzDcmI73JQlmr43k3sPDSW3+mnGrFE=; b=JyyWs3LxzLJRKF+8JEc8GUp3jfGQAViA25Ac6t/IxzIwLyyyAZ1jqQdwoARdjjoRQp j1qJge4hyDYP9hOx3/8roh1ep2WC3a0CBFwBw/LZAxTPBUUVLBZFWOiJDUjiITzD+KBx j/LvnfO7zR0iIDXZHku+A7dfnu6UfpxlnXhL8= MIME-Version: 1.0 Received: by 10.223.14.134 with SMTP id g6mr36239967faa.11.1319361989538; Sun, 23 Oct 2011 02:26:29 -0700 (PDT) Received: by 10.152.38.100 with HTTP; Sun, 23 Oct 2011 02:26:29 -0700 (PDT) Date: Sun, 23 Oct 2011 11:26:29 +0200 Message-ID: From: James Coldwell To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: 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 09:49:00 -0000 Hello List, 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. The way I installed FreeBSD on it was with mfsbsd, the zpool was created as such: =A0=A0=A0 set poolname=3D"z0" =A0=A0=A0 set dev1=3D"ad4" =A0=A0=A0 set dev2=3D"ad6" =A0=A0=A0 set swapsize=3D"4G" =A0=A0=A0 set zfssize=3D"300G" =A0=A0=A0 gpart delete -i 1 ${dev1} =A0=A0=A0 gpart delete -i 1 ${dev2} =A0=A0=A0 gpart destroy ${dev1} =A0=A0=A0 gpart destroy ${dev2} =A0=A0=A0 gpart create -s gpt ${dev1} =A0=A0=A0 gpart create -s gpt ${dev2} =A0=A0=A0 gpart add -b 34 -s 64k -t freebsd-boot ${dev1} =A0=A0=A0 gpart add -s ${swapsize} -t freebsd-swap -l swap0 ${dev1} =A0=A0=A0 gpart add -s ${zfssize} -t freebsd-zfs -l disk0 ${dev1} =A0=A0=A0 gpart add -b 34 -s 64k -t freebsd-boot ${dev2} =A0=A0=A0 gpart add -s ${swapsize} -t freebsd-swap -l swap1 ${dev2} =A0=A0=A0 gpart add -s ${zfssize} -t freebsd-zfs -l disk1 ${dev2} =A0=A0=A0 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${dev1} =A0=A0=A0 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${dev2} =A0=A0=A0 zpool create ${poolname} mirror /dev/gpt/disk0 /dev/gpt/disk1 That worked perfectly for half a year. Suddenly, it wouldn't come back up after a reboot. What I want to do now is mount the filesystem and check for misconfiguratio= n. 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: =A0=A0=A0 prealpha# gpart show =A0=A0=A0 =3D>=A0=A0=A0=A0=A0=A0=A0 0=A0 976773168=A0 ada0=A0 BSD=A0 (466G) =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 0=A0=A0=A0=A0=A0=A0=A0=A0 16=A0=A0=A0= =A0=A0=A0=A0 - free -=A0 (8.0K) =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 16=A0=A0=A0=A0=A0 65520=A0=A0=A0=A0 1=A0= !0=A0 (32M) =A0=A0=A0 =A0=A0=A0=A0=A0 65536=A0 976707632=A0=A0=A0=A0=A0=A0=A0 - free -= =A0 (466G) =A0=A0=A0 =3D>=A0=A0=A0=A0=A0=A0 34=A0 976773101=A0 ada1=A0 GPT=A0 (466G) =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 34=A0=A0=A0=A0=A0=A0=A0 128=A0=A0=A0=A0 = 1=A0 freebsd-boot=A0 (64K) =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 162=A0=A0=A0 8388608=A0=A0=A0=A0 2=A0 freeb= sd-swap=A0 (4.0G) =A0=A0=A0 =A0=A0=A0 8388770=A0 629145600=A0=A0=A0=A0 3=A0 freebsd-zfs=A0 (3= 00G) =A0=A0=A0 =A0 637534370=A0 339238765=A0=A0=A0=A0=A0=A0=A0 - free -=A0 (162G= ) =A0=A0=A0 prealpha# ls /dev/gpt/ =A0=A0=A0 disk1=A0=A0=A0 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 files= . After that, I want to restore the mirror setup with ada0 and ada1 and try to boot again. 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. James