ZFS Non-boot zpool won't import on boot

It seems that this problem wasn't solved after all. After booting the FreeBSD VM a couple more times, it reverting to failing to import the zpool ("pool0") on boot.

To provide more context, it's a FreeBSD VM running under QEMU/KVM on a Fedora Linux hypervisor host. OpenZFS is also installed on the hypervisor and can see pool0 on the four physical disks that are being passed through to the FreeBSD VM. pool0 has been imported on the hypervisor before, but was properly exported before attempting to import it inside the VM.

To recap, pool0 can be manually imported just fine in the FreeBSD VM with either zpool import pool0 or service zpool start, it just won't do it automatically at boot, even though zfs_load="YES" in /boot/loader.conf and zfs_enable="YES" in /etc/rc.conf.

I've tried adding echo statements to both /etc/rc.d/zfs and /etc/rc.d/zpool inside their name_start() functions and have set rc_debug="YES" in /etc/rc.conf, but I see no evidence that either rc script is being run at boot time. The only mention of "zfs" in the rc debug messages is Feb 14 14:19:55 filer2 root[2463]: /etc/rc.d/mountd: DEBUG: checkyesno: zfs_enable is set to YES., but it's the /etc/rc.d/mountd script outputting that.

This is perplexing.
 
I've tried adding echo statements to both /etc/rc.d/zfs and /etc/rc.d/zpool inside their name_start() functions and have set rc_debug="YES" in /etc/rc.conf, but I see no evidence that either rc script is being run at boot time.
Where did you look? In the system console ttyv0 or dmesg(8)? If dmesg(8), -a option is needed.

Tested: rc_debug="NO", after "<name>_start"

/etc/rc.d/zpool
echo "===> /etc/rc.d/zpool executed <==="

/etc/rc.d/zfs
echo "===> /etc/rc.d/zfs executed <==="
Code:
 # dmesg -a | grep rc.d
===> /etc/rc.d/zpool executed <===
===> /etc/rc.d/zfs executed <===
 
If dmesg(8), -a option is needed.
Thank you! This was new to me. I see much more output from the rc debug when I use this, and it does actually confirm that /etc/rc.d/zfs and /etc/rc.d/zpool are being run at boot, and shows an error for the latter:

Code:
/etc/rc: DEBUG: checkyesno: zfs_enable is set to YES.
/etc/rc: DEBUG: load_kld: zfs kernel module already loaded.
/etc/rc: DEBUG: run_rc_command: doit:  zpool_start
!!!!!!!!!!!!!!!!! zpool_start  (the echo statement I added)
cannot import 'pool0': no such pool or dataset
        Destroy and re-create the pool from
        a backup source.
cachefile import failed, retrying
...
no pools available to import

Looking further down, I can see that the da0..da3 devices are being detected by the kernel after the zpool rc script has run.

So I've tried adding kern.cam.boot_delay="10000" and kern.cam.scsi_delay="10000" to /boot/loader.conf, but I see no obvious 10 second pause during boot, and the problem persists where the da0..3 devices only show up after rc scripts have finished running.
 
Back
Top