# FreeBSD 9.2 + ZFS on root + kernel panic



## arrowcloud (Oct 11, 2013)

Hi,
I installed 9.2 stable (AMD64) with ZFS on root following these instructions :
http://ostanin.org/blog/2011/12/19/root-on-zfs-with-freebsd-9/

Setup : AMD 6 core 3.1ghz, Dual 1.9 TB Hitachi, 16 gig RAM (to be used as an internal file, web and database server)

I didnt use ZFS mirror, instead I created one big pool of 3.8 TB with mount points created as per the instructions on the link. 
1. The setup worked fine, I then proceeded install several ports (MariaDB, OpenJDK, Subversion etc)
2. I also manually added linux loading by adding a line in the /etc/fstab (I also manually created /usr/compat and the appropriate symlinks) :
linproc        /compat/linux/proc linprocfs rw,last 0       0
3) Enabled linux loading and several other services with /etc/rc.conf and boot/loader.conf

The server started crashing on boot since the next reboot. Same crash occurs on single user mode also so there is no way for me to turn off the newly added services. The dump message (screen attached) is : 
panic: solaris assert: nvlist_lookup_uint64(configs_, .........../fs/zfs/spac. c, line 3798
along with a long KDB stack trace

4. I have absolutely no idea about how to rescue this. Trying to debug this systematically, error could be because :
    a) There is an issue with some of the services I loaded. But I dont know how to turn them off after booting with a live cd because I dont know how to mount the currently installed ZFS (couldn't find an easy to comprehend guide on rescuing root on ZFS type setups)
    b) There is an issue with the ZFS setup. This seems more likely but again I would'nt know where to start in terms of debugging this.

Ideally I wouldn't like to spend time reinstalling stuff and would like to rescue this setup as I spent a lot of time installing packages etc. This kind of error really worries me about using ZFS + FreeBSD in prod.

I would appreciate any methods or guides to attempt to rescue my setup or to debug this issue.

Many thanks.




_


----------



## arrowcloud (Oct 12, 2013)

Because I was time constrained I ended up re-installing FreeBSD 9.2; this time it worked (I think).

NOTE : INSTALLING FREEBSD 9.2 WITH ZFS USING OLDER TUTORIALS FOR 9.0 and 9.1 WILL LEAD TO PROBLEMS (esp if you are new to ZFS and are simply copying the commands specified).Things have changed in 9.2 wrt importing and temporarily mounting zpools. 

The best FreeBSD ZFS tutorial is here but this works for pre 9.2 :
http://forums.freebsd.org/showthread.php?t=31557

The tweak and issue for 9.2 is here :
http://forums.freebsd.org/showpost.php?p=232151&postcount=9
Specifically the -m and the -R flags are required for altroots. 

The other thing different that I wanted was two hard drives pooled together rather than mirrored for that I did the following while creating the pool :

```
zpool create -m / -R /mnt -o cachefile=/var/tmp/zpool.cache zroot /dev/gpt/disk0 /dev/gpt/disk1
```

Hope this helps someone else.


----------

