Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Apr 2011 10:23:25 +0100
From:      krad <kraduk@gmail.com>
To:        David Newman <dnewman@networktest.com>
Cc:        fs@freebsd.org
Subject:   Re: fixing a busted ZFS upgrade
Message-ID:  <AANLkTikt%2BG_1Mbm5G3qbdQvkr-rho7LR0sTSM9nJOSEA@mail.gmail.com>
In-Reply-To: <4D941BFF.6050807@networktest.com>
References:  <4C51ECAA.2070707@networktest.com> <4C51FE41.8030906@FreeBSD.org> <4D941BFF.6050807@networktest.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 31 March 2011 07:15, David Newman <dnewman@networktest.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikt%2BG_1Mbm5G3qbdQvkr-rho7LR0sTSM9nJOSEA>