# Can't rebuild kernel with ZFS v15 since upgrade to 8.2



## t0ken (Mar 31, 2011)

I tried posting this to the mailing list but no one seems to have the same problem.

Ever since I upgraded to 8.2 a few weeks ago, I can't seem to rebuild my kernel without it being built with ZFS v14 rather than v15.  This is a problem because I'm using root on ZFS and my box won't boot after the kernel rebuild and reboot.

At first I thought it was because I rebuilt the kernel without rebuilding world, however the same thing happens even after getting up-to-date sources and rebuilding world.  Anyone else having this problem?

For two reasons I know it's running zfs v14 after the rebuild:

1)  During boot, a message shows:


```
ZFS Filesystem version 4
ZFS Storage pool version 14
```
2)  After getting to the failed root mount point of the boot (after it fails to mount my zfs root), I enter:
`ufs:/dev/ad4s1a`
to get to my boot partition (which must remain UFS obviously), and try to mount my pools with the *zfsmount* command, however it errors with something similar to:


```
storage pool version does not match
```
 
I can only get my system working again by manually moving /boot/kernel to /boot/kernel.bad (or whatever) and replacing it with the previous kernel.

Any ideas?


----------



## davidgurvich (Apr 1, 2011)

Are you sure that is the zfs version and not the version of zfs in used in your pool?


----------



## t0ken (Apr 1, 2011)

davidgurvich said:
			
		

> Are you sure that is the zfs version and not the version of zfs in used in your pool?




I'm not sure what you mean.  I upgraded my pools to v15 after the upgrade to 8.2, just as one normally would, so I definitely believe they're version 15.  The following is from my running system, also indicating the version to be zfs v4 zpool v15:



```
[root@daemon ~]# zfs upgrade -v
The following filesystem versions are supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS filesystem version
 2   Enhanced directory entries
 3   Case insensitive and File system unique identifer (FUID)
 4   userquota, groupquota properties

For more information on a particular version, including supported releases, see:

http://www.opensolaris.org/os/community/zfs/version/zpl/N

Where 'N' is the version number.
[root@daemon ~]# zpool upgrade -v
This system is currently running ZFS pool version 15.

The following versions are supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS version
 2   Ditto blocks (replicated metadata)
 3   Hot spares and double parity RAID-Z
 4   zpool history
 5   Compression using the gzip algorithm
 6   bootfs pool property
 7   Separate intent log devices
 8   Delegated administration
 9   refquota and refreservation properties
 10  Cache devices
 11  Improved scrub performance
 12  Snapshot properties
 13  snapused property
 14  passthrough-x aclinherit
 15  user/group space accounting
For more information on a particular version, including supported releases, see:

http://www.opensolaris.org/os/community/zfs/version/N

Where 'N' is the version number.
```



After I rebuild the kernel and try to boot into the newly built kernel is when I see the "version 14" _during boot_, and I'm not able to mount the zfs mounts due to the pool version.

Do you happen to have a ZFS root install and have rebuild your kernel after upgrading to 8.2?  I suppose other people would have this issue, but then I don't know of many others that run a root zfs system and I haven't been able to find anyone else with this problem. :\

I've checked the kernel config, but don't find anything zfs related.  I think the real test would be to find someone who's rebuilt their kernel after upgrading to 8.2, and see if they have zpool v14 or otherwise.


----------



## SirDice (Apr 1, 2011)

t0ken said:
			
		

> I think the real test would be to find someone who's rebuilt their kernel after upgrading to 8.2, and see if they have zpool v14 or otherwise.


That would be me. Version in the kernel after rebuild is v15.

How did you update your box? Using freebsd-update or source?


----------



## t0ken (Apr 1, 2011)

SirDice said:
			
		

> That would be me. Version in the kernel after rebuild is v15.
> 
> How did you update your box? Using freebsd-update or source?



freebsd-update

I tried from source later (after I discovered this issue), however, come to think of it, I did NOT installworld yet.  I think I'll try rebuilding world, rebuilding default kernel, installing kernel/world, THEN rebuild the kernel again with my custom config.  I'll kick myself if that works x(


----------



## SirDice (Apr 1, 2011)

Just skip the rebuild of GENERIC and go straight to your custom kernel. Try installing GENERIC when your custom kernel fails.


----------



## t0ken (Apr 1, 2011)

Well, that would be the point I'm at now.  I've tried:

1)  Freebsd-update from 8.1 to 8.2, then rebuilding custom kernel; resulted in zpool v14
2)  Sync source, cleaned /usr/src using method in Handbook, buildworld, buildkernel (using custom conf), installkernel (using custom conf); resulted in zpool v14

I suppose installing world prior to rebuilding with my custom config will have no affect...    Oh well, I'll try anyways, I'm at wits end.


----------



## SirDice (Apr 1, 2011)

What tag did you use to check out the source?


----------



## t0ken (Apr 1, 2011)

SirDice said:
			
		

> What tag did you use to check out the source?



WOW!  What a dumb mistake.  It's RELENG_8_1.  :\


That's almost certainly the problem.  I'll rebuild again and let you know how it goes (FYI, when I rebuilt a couple hours ago, I got the same problem).


----------



## SirDice (Apr 1, 2011)

That might explain it. But as far as I know ZFS on FreeBSD went from v13 to v15, v14 was skipped. 

In any case I'm waiting for v28 to be MFC'ed, should come anytime soon now :e


----------



## t0ken (Apr 1, 2011)

SirDice said:
			
		

> That might explain it. But as far as I know ZFS on FreeBSD went from v13 to v15, v14 was skipped.
> 
> In any case I'm waiting for v28 to be MFC'ed, should come anytime soon now :e



Success!  Thanks for that suggestion man, I can't believe I didn't notice that!  I remember checking out my supfile too, because when I first began messing with all of this, I only wanted to sync certain sources rather than all of them.  Hitting myself for missing that :e

I too can't wait for v28, haha.  I think that's what we've all (those running ZFS) have been waiting for, for a long time, lol.


----------



## phoenix (Apr 4, 2011)

SirDice said:
			
		

> That might explain it. But as far as I know ZFS on FreeBSD went from v13 to v15, v14 was skipped.



FreeBSD 7.x has ZFSv6, ZFSv13, and ZFSv14.

FreeBSD 8.x has ZFSv14, and ZFSv15.  With patches floating around for ZFSv28.

FreeBSD 9-CURRENT has ZFSv28.


----------

