Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Mar 2011 10:31:45 +0000
From:      krad <kraduk@gmail.com>
To:        Andrew Moran <amoran@forsythia.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Upgrading FreeBSd when using a zfs-only installation?
Message-ID:  <AANLkTimF4X4dpqjhj_g_Mv=mcBkN9Q5Ez%2Bf5vS0LVK1A@mail.gmail.com>
In-Reply-To: <A807A05C-9D20-45FC-9833-422E8C38820C@forsythia.net>
References:  <21D3DE2D-2C1E-4C7B-860E-C637C746150A@forsythia.net> <86lj0j9cwd.fsf@red.stonehenge.com> <AANLkTin2gSwVE2DeFLq73SE1ef4AYiG37o3hLcnHo54S@mail.gmail.com> <86hbb6aply.fsf@red.stonehenge.com> <A807A05C-9D20-45FC-9833-422E8C38820C@forsythia.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 14 March 2011 00:10, Andrew Moran <amoran@forsythia.net> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimF4X4dpqjhj_g_Mv=mcBkN9Q5Ez%2Bf5vS0LVK1A>