From owner-freebsd-questions@FreeBSD.ORG Mon Mar 14 10:31:47 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A487106564A for ; Mon, 14 Mar 2011 10:31:47 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8AB058FC08 for ; Mon, 14 Mar 2011 10:31:46 +0000 (UTC) Received: by wyf23 with SMTP id 23so5020391wyf.13 for ; Mon, 14 Mar 2011 03:31:45 -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=lO8QXjwb0RChF1zJaWJ9POwXtB0FVMO/3m2Z8Ms+Zzc=; b=baXhctx++baXTOQ+i4Qdgy0OCsRmUreYIW0Zg4V84s+aXir4qOoPAJmcP2DcsWSi9h oeBM0Jv+EDxO+ebMZKjp0ZkwReZwQY0YEALZta2xUkIWXv03royXO0a6FO7sn5mvkGwz iO6A9ltiCLaRYgTQG226uTbLPVK5+zuOHyufI= 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=AN5/X7oYpe52GYDC1HGgR7BZ5txJhUVBTa5qrwNROaUfSXYYRkmSACGVI3T5zS2NI2 rB4X6sdI2oyM2L72fgkTmkEF6CPEvv9IOKjGzAGWwbvbnG1jXlN545yqEgdpY+0/ci3N o3HGl7vbWIWoXyGCc6to7vngWakzt+Vm7CgXw= MIME-Version: 1.0 Received: by 10.216.179.133 with SMTP id h5mr2165204wem.69.1300098705350; Mon, 14 Mar 2011 03:31:45 -0700 (PDT) Received: by 10.216.187.16 with HTTP; Mon, 14 Mar 2011 03:31:45 -0700 (PDT) In-Reply-To: References: <21D3DE2D-2C1E-4C7B-860E-C637C746150A@forsythia.net> <86lj0j9cwd.fsf@red.stonehenge.com> <86hbb6aply.fsf@red.stonehenge.com> Date: Mon, 14 Mar 2011 10:31:45 +0000 Message-ID: From: krad To: Andrew Moran Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: Upgrading FreeBSd when using a zfs-only installation? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 10:31:47 -0000 On 14 March 2011 00:10, Andrew Moran wrote: > I have successfully upgraded form FreeBSD 8.1 to FreeBSD 8.2. Here were my > steps: > > cvsup /root/stable-supfile > cd /usr/src > make buildworld > make buildkernel > make installkernel > shutdown -r now > > *select single user mode* > > mount -u / > zfs mount -a > mergemaster -p > make installworld > mergemaster > > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad4 > gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad5 > > zpool upgrade -a > zfs upgrade -a > > shutdown -r now > > > NOTE 1: the gpart commands are specific to my setup - I'm using a ZFS > mirror on ad4 and ad5. Your system may be different. > NOTE 2: my "zfs upgrade -a" ran out of swap space and died. I ran "zfs > upgrade" to see what filesystems were left un-upgraded and did those > manually. > > Thanks Scott Ballantyne and everyone else who responded. > > Cheers! > > --Andy > > _______________________________________________ > 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" > sorry this is a bit late but here is the update script I use. I basically creates a structure like this. Makes if very easy to flip flop between os installs by modifying the pool bootfs variable system-4k/be 35.2G 1.20T 156K /system-4k/be system-4k/be/current 1.22G 1.20T 740M legacy system-4k/be/root20110226 2.80G 1.20T 882M legacy system-4k/be/root20110302 3.24G 1.20T 882M legacy system-4k/be/root20110306 1.32G 1.20T 882M legacy system-4k/be/root20110312 1.36G 1.20T 923M legacy system-4k/be/tmp 776K 1.21T 260K /tmp system-4k/be/usr-local 2.84G 1.20T 2.47G /usr/local/ system-4k/be/usr-obj 5.08G 1.20T 2.09G /usr/obj system-4k/be/usr-ports 5.82G 1.20T 4.33G /usr/ports system-4k/be/usr-ports/distfiles 1.20G 1.20T 1.19G /usr/ports/distfiles system-4k/be/usr-src 1.49G 1.20T 973M /usr/src system-4k/be/var 4.72G 1.21T 805M /var system-4k/be/var/log 3.66G 1.21T 2.34G /var/log system-4k/be/var/mysql 82.5M 1.21T 33.9M /var/db/mysql #!/usr/local/bin/bash if [ $UID != 0 ] ; then echo your not root !! ; exit 1 fi date=`date '+%Y%m%d'` oroot=`grep "vfs.root.mountfrom=\"zfs:system-4k/" /boot/loader.conf | sed -e "s#^.*\"zfs:system-4k/be/##" -e "s#\"##"` nroot="root$date" snap="autoup-$RANDOM" zpool=system-4k export DESTDIR=/$zpool/be/$nroot if [ "$oroot" = "$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=legacy $zpool/be/$nroot zpool set bootfs=$zpool/be/$nroot $zpool\n\n"