1

I have a FreeBSD 11.2-RELEASE install on a SSD and a zpool mirror named tank consisting of 2 hard drives.

There is no problem importing it manually: zpool import -R /mnt tank

then zfs get all tank shows:

[root@x9 ~]# zfs get all tank NAME PROPERTY VALUE SOURCE tank type filesystem - tank creation Wed Oct 3 22:36 2018 - tank used 41.9G - tank available 1.71T - tank referenced 66.2M - tank compressratio 1.00x - tank mounted yes - tank quota none default tank reservation none default tank recordsize 128K default tank mountpoint /mnt/tank default

But the zpool import never survives a reboot.

An helping user suggested that the file /boot/zfs/zpool.cache not being updated could be the culprit, so I deleted it, re-imported the zpool and rebooted.

This didn't solve the problem.

1 Answer 1

1

The -R option to zpool import sets a temporary prefix to all the mountpoints and does not update the cachefile. See the zpool(8) manual page for details.

If you want the datasets of the second pool to be mounted at boot, the system cachefile (at /boot/zfs/zpool.cache) needs to be updated.

If you want to update the cachefile you will need to execute zpool import without the -R option. The manual also mentions specifying the cachefile explicitly (but I have not tested that option).

Assuming that you need to set the mountpoint of the second pool to /mnt/tank, you should perform this step before the final import of the pool.

For example:

zpool import -R /mnt tank
zfs set mountpoint=/mnt/tank tank
zpool export tank
zpool import tank
1
  • I was missing the zfs set mountpoint=/mnt/tank tank part. Thank you very much. The zpool now works as expected.
    – brunobhr
    Oct 13, 2018 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .