fixing a busted ZFS upgrade
krad
kraduk at gmail.com
Sat Apr 2 09:45:44 UTC 2011
On 31 March 2011 07:15, David Newman <dnewman at 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ňa 29. 7. 2010 23:03, David Newman wrote / napísal(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 bootable
> >> 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 at freebsd.org mailing list
> >> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> >> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at 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 != 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"
it assumes this kind of layout
$ zfs list | grep be
system-4k/be 35.7G 1.03T 156K /system-4k/be
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/mysql
More information about the freebsd-fs
mailing list