I'm relatively new to ZFS and decided to install zfs on a blank hard-drive, as a second drive to my GhostBSD system.
I made canmount=off so as not to conflict with the zroot pool, which also mounts at /.
zpool create -R / -O canmount=off zstorage ada0
zfs create zstorage/stg
I decided I didn't want to create a /zstorage/stg folder at root.
So I changed the mountpoint to 'legacy,' after the fact, so that I could mount it with fstab.
zfs set mountpoint=legacy zstorage/stg
FSTAB:
#SSD Disk
zstorage/stg /stg zfs rw,late 0 0
I noticed that this doesn't work and drops me to single user mode.
Then, I removed it from fstab.
I have a startup script that runs as a MATE startup application.
#!/bin/sh
#zpool storage drive
doas zpool import zstorage &
doas mount -t zfs zstorage/stg /stg &
This does import the zpool called 'zstorage', however the second 'doas' command does not mount the 'zstorage/stg' filesystem. It will mount if I open a terminal and type it in.
So my question is; "how can I get the mount command to work in the startup script?"
And; "Is there a better way to do this? If so, what do you suggest?"
The filesystem is new and has nothing on it yet.