# Recovery from failed upgrade to 8.1 from 8.0 (zfs root)



## pseudonomous (Aug 16, 2010)

Hello Everyone,

I attempted to do a an upgrade with freebsd-update from 8.0 to 8.1, which failed and now the bootloader fails to load my kernel.  I took zfs snapshots of all my filesystems except /boot and swap before updating (because my boot partition is still ufs), and I want to attempt to revert all my filesystems to the snapshots from before I began updating.  

However, when I booted off the freebsd 8.0 dvd and started a "fixit" shell, I encountered library load errors (after loading opensolaris.ko and zfs.ko) when running zpool and zfs commands.  Actually, attempting to run "reboot" resulted in library load errors as well.

I'm downloading the 8.1 release dvd now, and will try booting off that later, but in the meantime, if anybody has any suggestions for attempting to recover my system, or at least some of my data (mostly I want to get some of my config files, and probably also the binary packages I had installed).


----------



## pseudonomous (Aug 16, 2010)

Actually, on further thought, and more careful reading, I'm probably suffering from the bug described in this thread:

http://forums.freebsd.org/showthread.php?t=16535

and maybe I should be attempting to patch the bootloader instead.


----------



## gkontos (Aug 16, 2010)

pseudonomous said:
			
		

> Actually, on further thought, and more careful reading, I'm probably suffering from the bug described in this thread:
> 
> http://forums.freebsd.org/showthread.php?t=16535
> 
> and maybe I should be attempting to patch the bootloader instead.



This bug applies only if you have lost your primary drive. What errors do you get when you try to boot ?


----------



## pseudonomous (Aug 16, 2010)

kernel not found.  I have a non-redundant zpool of disks.  I can't remember if I set them up in a raid0 configuration (probably I did) or just left them as JBOD.


----------



## pseudonomous (Aug 17, 2010)

Well, I was able to do a "zfs rollback" and get my system to boot again.  I'm convinced now that the library load errors I experienced with th 8.0-RELEASE DVD are probably "mostly harmless".  I experienced them again when using the 8.1-RELEASE DVD, but not consistently; if I exited out of the "fixit" shell and started it back up again, this seems to allow me to continue to execute commands again.  At any rate, I did successfully do a "zfs restore" from my snapshots.  And I have a working 8.0 system again.

So now I can break it again by attempting to upgrade again.


----------



## pseudonomous (Aug 17, 2010)

The problem I faced was that I needed to re-initialize the bootcode and bootloader, I followed ben's instruction's from this thread.

For the very lazy I repost some of that thread here:

Like in the release announcemnt directions:

```
# freebsd-update upgrade -r 8.1-RELEASE
# freebsd-update install
```

Now before rebooting the machine I wrote the bootcode, using the files from the 8.1-RELEASE dvd, however swa claims, in the linked thread that you can use the files on your newly updated system: (replace ad4 and/or ad6 to your own needs):

```
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad4
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad6
```

Literally what I did was mounted the 8.1-RELEASE DVD to to mount and ran:

```
# gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptzfsboot -i 1 ad10
# gpart bootcode -b /mnt/boot/pmbr -p /mnt/boot/gptzfsboot -i 2 ad12
```

And, yep, things booted just fine.  Swa has a further note for dealing with Custom kernels, but since I use GENERIC I didn't worry about that.


----------

