G'day all,
I configured a zpool mirror using the outlined steps. The NFS share is working fine, and I've been able to mount it and use it without any issues. However, I need to key in the encryption password each time I start the server for each disk drive. I tried configuring the autonomous keyfile attachment at boot, but that didn't work. What should I do to get this to work without needing to enter the encryption password during the server boot process?
Much appreciate any help.
I configured a zpool mirror using the outlined steps. The NFS share is working fine, and I've been able to mount it and use it without any issues. However, I need to key in the encryption password each time I start the server for each disk drive. I tried configuring the autonomous keyfile attachment at boot, but that didn't work. What should I do to get this to work without needing to enter the encryption password during the server boot process?
Code:
Added these to /boot/loader.conf to ensure they load at boot time:
echo 'geom_eli_load="YES"' >> /boot/loader.conf
echo 'zfs_load="YES"' >> /boot/loader.conf
dd if=/dev/random of=/root/zfs-keyfile bs=64 count=1
geli init -K /root/zfs-keyfile /dev/ada0 /dev/ada1
geli attach -k /root/zfs-keyfile /dev/ada0 /dev/ada1
zpool create tank mirror /dev/ada0.eli /dev/ada1.eli
zfs create tank/mydata
zfs set compression=lz4 tank/mydata
chmod 777 /tank/mydata/
Configured the NFS Share:
sysrc nfs_server_enable="YES"
sysrc mountd_enable="YES"
sysrc rpcbind_enable="YES"
echo "/tank/mydata -maproot=root aaa.bbb.ccc.ddd/24" >> /etc/exports
Added the following to the /etc/rc.conf to support autonomous key file attachment:
echo 'geli_ada0_flags="-k /etc/zfs-keyfile"' >> /etc/rc.conf
echo 'geli_ada1_flags="-k /etc/zfs-keyfile"' >> /etc/rc.conf
echo 'geli_devices="ada0 ada1"' >> /etc/rc.conf
echo 'zfs_enable="YES"' >> /etc/rc.conf
Much appreciate any help.