# zpool not mounting at boot after upgrade to 12.2



## maxwalktheplanck (Oct 31, 2020)

I recently upgraded from 12.1 to 12.2, since then my non-root zpool no longer mounts at boot. It is my only pool, root is using UFS.

Running `zfs mount -a` correctly mounts the pool with no issues.

My rc.conf is unchanged, and still has `zfs_enable="YES"` in it.


```
#: zpool status
  pool: tank
state: ONLINE
  scan: scrub repaired 0 in 0 days 13:17:24 with 0 errors on Sat Oct 31 04:55:24 2020
config:

    NAME        STATE     READ WRITE CKSUM
    tank        ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        ada0    ONLINE       0     0     0
        ada1    ONLINE       0     0     0
      mirror-1  ONLINE       0     0     0
        ada2    ONLINE       0     0     0
        ada3    ONLINE       0     0     0
    logs  
      nvd0      ONLINE       0     0     0
errors: No known data errors
```

Looking at the parent pool info:

```
#: zfs get all tank | grep mount
tank  mounted               no                     -
tank  mountpoint            /tank                  default
tank  canmount              on                     default
```

and:

```
#: zfs get all tank/filestorage | grep mount
tank/filestorage  mounted               no                     -
tank/filestorage  mountpoint            /tank/filestorage      default
tank/filestorage  canmount              on                     default
```

`canmount` is on for both, yet neither mounts until I pass `zfs mount -a`.

I actually exported the pool, did a fresh install of 12.2 and re-imported the pool, but the issue remains.


----------



## Sebastian (Nov 1, 2020)

Try to export your zpool and import it again.


----------



## maxwalktheplanck (Nov 1, 2020)

Sebastian said:


> Try to export your zpool and import it again.


I just tried that, no success. 

Kernel messages say that ZFS is loaded, rc debug enabled checkyesno states zfs_enable is set to yes. Just not mounting!


----------



## T-Daemon (Nov 1, 2020)

This sounds exactly like a item from head/UPDATING (CURRENT):


```
69
70             Pool auto import behavior at boot has been moved from the kernel module
71             to an explicit "zpool import -a" in one of the rc scripts enabled by
72             zfs_enable=YES. This means your non-root zpools won't auto import until
73             you upgrade your /etc/rc.d files.
```

I would ask on freebsd-fs mailing list, there the chances are higher to get the issue resolved. ZFS developers are tracking that list.


----------



## maxwalktheplanck (Nov 1, 2020)

T-Daemon said:


> This sounds exactly like a item from head/UPDATING (CURRENT):
> 
> 
> ```
> ...


Wow, good find, it sure does! 

I'll do that, thanks!


----------



## xtouqh (Nov 1, 2020)

Well, 12.2 is *not* CURRENT, so applying UPDATING entries from the latter doesn't make sense.


----------



## T-Daemon (Nov 1, 2020)

xtouqh said:


> Well, 12.2 is *not* CURRENT, so applying UPDATING entries from the latter doesn't make sense.



Why not? maxwalktheplank states the non-root zpool won't mount at boot, only when running _zpool import -a_ after, and that's exactly what the item in CURRENT UPDATING describes. Isn't it obvious there might be a similar cause for it? For that reason I suggested the freebsd-fs mailing list to ask those how know best. The solution may be something simple, like replacing /etc/rc.d, maybe the upgrade didn't succeed completely, or it may be a bug.


----------



## xtouqh (Nov 1, 2020)

T-Daemon said:


> Isn't it obvious there might be a similar cause for it?


No, that UPDATING item explicitly says that *import* was moved from kernel module to rc script, and that was done as part of switching to openzfs.  None of that applies to 12.2.


----------



## xtouqh (Nov 1, 2020)

T-Daemon said:


> maxwalktheplank states the non-root zpool won't mount at boot, only when running _zpool import -a_ after, and that's exactly what the item in CURRENT UPDATING describes.


BTW, you are misreading the problem, pool is imported for the user, it's only the FS that are not mounted on boot.


----------



## T-Daemon (Nov 2, 2020)

xtouqh said:


> BTW, you are misreading the problem,


I see, indeed I have. 

maxwalktheplack my apologies, my eyes have seen zfs, but my mind made me read zpool. First time I read,  referring to that item, in a case from the freebsd-hackers list, recalling that and seeing your problem made me see a possible cause, so I thought. Sorry for the noise.

Still, the suggestion consulting the freebsd-fs list stands.


----------



## gschadow (Nov 3, 2020)

Have a look here https://forums.freebsd.org/threads/...an-11-2-to-a-12-2-how-is-this-possible.77560/ and here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250816 because it looks to me that there is something seriously wrong with ZFS in 12.2 (and 12.1?). Your issue looks a little different, but the problems I found are so blatant and so basic, that I would think something is gravely wrong with ZFS in 12.2 (and 12.1). Would be interesting to see if you can reproduce the problem with the quick script I gave.


----------



## ShelLuser (Nov 5, 2020)

Late reaction but oh well...

Do you have any ZFS related entries in /boot/loader.conf?  Look out for `zfs_load="YES"`.

Although I would assume that 'starting' ZFS in rc.conf will also automatically load the required modules, but that might not work if you have other security measures in place (think about kern.securelevel) so this is a good way to circumvent this possible problem.


----------



## grahamperrin@ (Apr 18, 2021)

This topic was linked from a Reddit post about a mount not automated following an upgrade to `13.0-RELEASE`. 

Quoting the _solution_: <https://old.reddit.com/comments/mrvv77/-/guzczyp/?context=2>


----------

