# Can't boot from ZFS anymore



## pomdos (Dec 1, 2013)

Hello,

I have trouble booting my machine. I originally installed 9.1 amd64 (no own kernel) with root on ZFS (two disks mirroring each other). This worked well and I could reboot without problems. Some time ago I upgraded to 9.2. Today I had to reboot. I get the following error message:

```
mounting from zfs:zroot/ROOT failed with error 2
```
I already tried out several things without success.

Booting from a USB stick into a live system. From here I imported zroot with the option -altroot and copied over the cache file.
Doing the above with `zfs unmount -a` before reboot.

Is there anything that changed in 9.2 and I should have adjusted? Any idea is really welcome!

Peter


----------



## ShelLuser (Dec 12, 2013)

I know this is a late response, but alas..

FreeBSD 9.2 also provides some changes to the ZFS pool. In order to activate these you need to issue the `# zpool upgrade` command (where you also need to supply the name of the pool you wish to upgrade).

Now, here's the part which I think could be relevant here; if you boot from ZFS you also need to update your boot sector. Note that this is something which zpool will also mention after you finished the upgrade. To do this you need to issue this command: `# gpart bootcode -p /boot/gptzfsboot -i 1 vtbd0`, where vtbd0 should obviously be replaced with a valid disk entry (tip: to easily identify those you can use the `sysctl kern.disks` command).

Keep in mind; if you're using an MBR approach instead of GPT then you probably need to use /boot/zfsboot instead.

It is of course a guess on my part, but I think this is where you might have gone wrong.


----------



## graudeejs (Jan 8, 2014)

I have _a_ similar issue. However it popped out from nowhere after I updated ports and rebooted. _Until_ then my FreeBSD 9.2 was booting fine. Rewriting _the_ bootcode didn't help either (but I'll try again tonight to double check). I hope to have time to fix this tonight. I'll update you on my progress.


----------



## graudeejs (Jan 9, 2014)

I tried it all over and failed miserably with _the_ same error. So I went ahead and from _a_ bootable flash shell I created _a_ new _ZFS_ filesystem, installed _a_ fresh FreeBSD 9.2 system, copied _the_ config_uration_ files over and rebooted. It works now. Perhaps I had my kernel misconfigured.


----------

