From owner-freebsd-fs@FreeBSD.ORG Sat Apr 2 09:45:44 2011 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4160D106566B; Sat, 2 Apr 2011 09:45:44 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD5C8FC1A; Sat, 2 Apr 2011 09:45:43 +0000 (UTC) Received: by wwc33 with SMTP id 33so4747076wwc.31 for ; Sat, 02 Apr 2011 02:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zkpWQCK0b2xukR/XofHw5gCQIDwpILZfuK6LZJYJqpw=; b=TUyJK0NjiFuabK9j8b9Yr++vO2a7PjZ25CjjYTdYGtHHrPp0PRI7jlkfE9Tz5et3rx /vlvvCYRzBtjX5s2QSpivlDrSDsqoFCpJrd66zIjyfj+evcYSfzwFQcjxPmOHGVOtvfK io6nez+yIOJtJbjQZ5Qnoxhetx0SmfZpv7JBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=PXng/XSOrsNcdVxzatMzOM8Vzj2VjHSkOPU0vWIVWScVS0n5IKfxoVwEbRa7X92Fdq 3UNnjTXsme2RVy+4pmele8YeFyy+TJ700TimqBnsFt7OkbnbMT2knEXo3zjoydd9xzcV pjSmQaFRgvvTTdpWhd46ub94v4k3SeoNDdD6M= MIME-Version: 1.0 Received: by 10.216.82.142 with SMTP id o14mr4608724wee.114.1301736205779; Sat, 02 Apr 2011 02:23:25 -0700 (PDT) Received: by 10.216.187.16 with HTTP; Sat, 2 Apr 2011 02:23:25 -0700 (PDT) In-Reply-To: <4D941BFF.6050807@networktest.com> References: <4C51ECAA.2070707@networktest.com> <4C51FE41.8030906@FreeBSD.org> <4D941BFF.6050807@networktest.com> Date: Sat, 2 Apr 2011 10:23:25 +0100 Message-ID: From: krad To: David Newman Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: fs@freebsd.org Subject: Re: fixing a busted ZFS upgrade 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: Sat, 02 Apr 2011 09:45:44 -0000 On 31 March 2011 07:15, David Newman wrote: > On 7/29/10 3:18 PM, Martin Matuska wrote: > > > > > For recovering a system that does not boot anymore, you can use mfsBSD > > ISO's: > > http://mfsbsd.vx.sk > > > > You can boot from the iso and repair the boot record. > > Nearly a year ago mfsBSD saved me from a munged 8.0->8.1 upgrade of a > ZFS box and allowed me to revive a ZFS root partition. > > I've done the same stupid thing again in moving from 8.1 to 8.2, only > now the server won't boot from the 8.2 mfsBSD ISO, or the 8.1 ISO. In > both cases it hangs at loader.conf. > > Thanks in advance for any clues on reviving this system. > > dn > > > > I recommend you check your gpart partitions with "gpart show" and verify > > discovered pools with "zpool import" > > (without any flags or arguments) first. > > > > mm > > > > D=C5=88a 29. 7. 2010 23:03, David Newman wrote / nap=C3=ADsal(a): > >> Attempting to upgrade an 8.0-RELEASE to 8.1-RELEASE failed on a system > >> running a bootable ZFS partition. > >> > >> The system boots to the loader prompt and complains there's no bootabl= e > >> kernel. Running 'lsmod' shows there are four ZFS disks present. > >> > >> Thanks in advance for clues on fixing this, and also on the right way = to > >> upgrade FreeBSD systems with bootable ZFS partitions. > >> > >> Steps to reproduce: > >> > >> 1. Build 8.0-RELEASE system following the freebsd.org wiki: > >> > >> http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/RAIDZ1 > >> > >> In this case the system uses raidz1 across four SATA drives. > >> > >> 2. Upgrade to 8.1-RELEASE using the 'FreeBSD Update' directions: > >> > >> http://www.freebsd.org/releases/8.1R/announce.html > >> > >> 3. After first reboot, system boots to the loader prompt. > >> > >> dn > >> > >> _______________________________________________ > >> freebsd-fs@freebsd.org mailing list > >> http://lists.freebsd.org/mailman/listinfo/freebsd-fs > >> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" > I script my installs for upgrading zfsroot as its safer that way. Hes my script for installing after everything is built #!/usr/local/bin/bash if [ $UID !=3D 0 ] ; then echo your not root !! ; exit 1 fi date=3D`date '+%Y%m%d'` oroot=3D`grep "vfs.root.mountfrom=3D\"zfs:system-4k/" /boot/loader.conf | s= ed -e "s#^.*\"zfs:system-4k/be/##" -e "s#\"##"` nroot=3D"root$date" snap=3D"autoup-$RANDOM" zpool=3Dsystem-4k export DESTDIR=3D/$zpool/be/$nroot if [ "$oroot" =3D "$nroot" ] ; then echo "i cant update twice in one day"; exit 1 fi echo building in $zpool/be/$nroot zfs snapshot $zpool/be/$oroot@$snap && zfs send $zpool/be/$oroot@$snap | zfs receive -vv $zpool/be/$nroot && cd /usr/src && make installkernel && make installworld && sed -i -e "s#$zpool/be/$oroot#$zpool/be/$nroot#" /$zpool/be/$nroot/boot/loader.conf && \ echo "Installing boot records.." && zpool status system-4k | grep -A 2 mirror | grep ad | sed -e "s/p[0-9]//" | while read a b; do gpart bootcode -b /zfsboot/pmbr -p /zfsboot/gptzfsboot -i 1 $a; done && cp -v /zfsboot/zfsloader /$zpool/be/$nroot/boot/. && echo -en "\n\nNow run these two commands to make the changes live, and reboot zfs set mountpoint=3Dlegacy $zpool/be/$nroot zpool set bootfs=3D$zpool/be/$nroot $zpool\n\n" it assumes this kind of layout $ zfs list | grep be system-4k/be 35.7G 1.03T 156K /system-4k/b= e system-4k/be/current 1.40G 1.03T 924M legacy system-4k/be/root20110226 2.80G 1.03T 882M legacy system-4k/be/root20110302 3.24G 1.03T 882M legacy system-4k/be/root20110306 1.32G 1.03T 882M legacy system-4k/be/root20110312 1.36G 1.03T 923M legacy system-4k/be/tmp 852K 1.03T 336K /tmp system-4k/be/usr-local 2.98G 1.03T 2.61G /usr/local/ system-4k/be/usr-obj 5.10G 1.03T 2.10G /usr/obj system-4k/be/usr-ports 5.99G 1.03T 2.29G /usr/ports system-4k/be/usr-ports/distfiles 1.18G 1.03T 156K /usr/ports/distfiles system-4k/be/usr-src 1.53G 1.03T 999M /usr/src system-4k/be/var 5.30G 1.03T 812M /var system-4k/be/var/log 4.21G 1.03T 2.67G /var/log system-4k/be/var/mysql 82.5M 1.03T 33.9M /var/db/mysq= l