Secondary ZFS pool

Started by nullpointerninja, February 04, 2019, 02:56:36 AM

Previous topic - Next topic
Hello everyone! Sorry for the basic question but I'm new to OPNsense and tried searching everywhere and couldn't find an answer.

Is it possible to add a second HDD/SSD and create a secondary ZFS pool without OPNsense doing anything to the data in this pool?
I've been playing with OPNsense in VirtualBox and could add an extra HDD (identified as ada1) and could create a new zpool (zpool create tank ada1) but whenever I reboot, the pool is emptied (no files appear when browsing through ssh even though the USED field in the zfs dataset is not reset).

I know there's been lots of people in the past asking how to attach an extra HDD and sharing it via SMB/AFP (I only need SSH) and the answer has always been "it's not recommended", but I'm looking to use this as an extra backup pool in case my primary backup server dies, and I don't want to dedicate a Xeon + 8GB of ECC RAM just for my router/firewall.

Thanks!

OPNsense will not touch your pools. It will do whatever is stated in /etc/fstab and that's it. :)


Cheers,
Franco

Thanks for the quick reply Franco!
Will try to figure out what's happening then. Maybe something going on with VirtualBox. Will try to replicate in real hardware.

Thanks!

Ok, didn't need to test outside VirtualBox :-[
The pool was imported but for some reason exporting and then importing the pool made all files available again.
Maybe this is another stupid question but how can I make sure any pools are imported correctly at boot time and/or schedule a 'zpool export tank' followed by a 'zpool import tank' command on boot?

Thanks!

Since reading my previous post made me realize what a noob I was (less than one minute googling got me the answer), I'm here to help others in the same situation.

Any other zpools are indeed imported when booting, but at least in my case the datasets were not mounted, so I could see the path where it was previously mounted but no files from the dataset itself.
The solution was very (and I mean VERY) simple. Create a script in the /usr/local/etc/rc.syshook.d/start folder with #!/bin/sh
zfs mount tank


where tank is the name of the dataset to mount. After rebooting and seeing the dataset not mounted I remembered to add the execute bit chmod +x file

and then it worked.

Hopefully this helps someone out there!