ZFS Force to import -f zpools on boot in dual boot machine

I have Linux and FreeBSD installations on two different disks (Ext4 and UFS) and I keep my data on a separate hard disk (zfs). When I switch from Linux to FreeBSD the pool is not loaded on startup so I have to run:

zpool import -f mypool

as FreeBSD understands that the pool was used in a different system.

Is there a way to force FreeBSD to import the pool on startup like I do with in the command line?

Thanks
 
zfs_enable="YES" is required to boot a disk on startup .. I would have a quick run through the section 19 of the handbook.
there are no other "requirements" as I believe zfs is added to kernel when selected at install time. You shouldnt need to mess with any kld commands... Later on when you get more disks or build more complicated pools you may wish to do some perfomance tuning in say your /boot/loader.conf file for the most part zfs runs out of the box.

One note to consider ...

-f in any zfs/zpool command should be avoided at all costs you are playing with fire and WILL regret it at some point.. using -f to destroy pools, or force imports/exports etc is just begging for pain and suffering..
 
When you switch between linux and freebsd only "-f" works when you didn't do an export in linux.
For me "zfs_enable=yes" was insufficient for slowly detected and spinning up external USB disk.
 
I can only guess, but I suspect the reason your -f works and a regular import does not is becasue the system is getting a "device buisy" message when its trying to import it at startup.

better question.. how are you selecting the disk? ie a boot loader .. or are you say escaping to bios and selecting the boot disk manually?
 
Back
Top