Date: Sun, 23 Oct 2011 11:26:29 +0200 From: James Coldwell <coldwelljames11@googlemail.com> To: freebsd-fs@freebsd.org Subject: Restore a ZFS mirror setup (GPT, ZFS-on-root) Message-ID: <CAJWXFzNDn%2B6%2B0zoXFECk=1Jd7gOPWfKqJzKGA6PQjxhjA=D-Yw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJWXFzNDn%2B6%2B0zoXFECk=1Jd7gOPWfKqJzKGA6PQjxhjA=D-Yw>