Which version of FreeNAS? Any other changes besides dataset creation (e.g. an upgrade)?
Ok,
FreeNas 9.1.1
1 -ZFS volume mirrored 1GB with 4 datasets - auto decrypted and mounted on post init boot-
2 - 3 usb drives - USB 1 Freenas,USB 2 UFS to initiate decryption of usb3 and USB 3 ZFS usb which decrypts the volume. USB 2 & 3, are remotely connected to computer and both have to be in for decryption - this works and has been working without issue, except for a new one with CIF's and datasets.
First to answer Dusans question - the usb's 2 and 3 are remotely attached fixed/hidden/glued, also not available to the network, if you remove it you will destroy it. If you where to steel the nas you most likely will leave the usb cables behind, if not, rip them out, in any case the usb drives are likely to be left behind rendering the system useless. You also need both drives in at boot up to initiate decryption. The weakest link is the UFS usb which has the first password to decrypt the encrypted usb with main passwords and script, but that's why both have to be in.. Moral of the story, If I go away I can just remove the usb cables - system will not decrypt. My use, I start a media player send WOL. All done for you but whilst maintaining physical security of the NAS. Better than having to boot, wait, login and decrypt every time.
With the risk of theft for a home user your suggestion of removing the passphrase renders everthing moot. Why even bother with encryption.
I could do with the code for unmounting a usb after x seconds. That will then re-encrypt the USB's and unmount them, removing the exposure whilst FreeNas is running.
Actual problem:
1- Auto decryption: no datasets networks sees folders
2- Auto decrytion: with 4 datasets network does not see folders unless CIF's is stopped and started. In the FREENAS folder is just the printer icon
3- Manual decryption: network sees folders.
Initially I just had an encrypted ZFS volume - network picked it up. I then started playing with Datasets created 4 - no problems. However, I noticed that I had to stop and restart CIF's to get the network to see the folders.
The script I made up of bits and pieces I found.
Note:
1-I am unfamiliar with Syntax and rules to make it look neat. I've also removed a lot of my comments to remind me.
2-It works.
3-It can't be a sleep timing issue for I've gone up to 40 seconds on all with same results
4-something must be missing in my script or not being started after decryption in this manner.
#!/bin/sh
#This file is to Auto Decrypt And Mount Encrypted ZFS Volumes.
# test if /mnt/usbtest/Utilities/zfsvolumes if not script cancels.
if [ -e /mnt/usbtest/Utilities/zfsvolumes ]; then
echo "File Found..." >&2
else
echo "OOP's! Where is it??" >&2
exit 1
fi
#
##First Volume
#
#Unencrypts disk in primary disk in volume also adds sleep time
geli attach -j /mnt/usbtest/Utilities/zfsvolumes -k /data/geli/cf32ff91-b0a0-448c-a698-aa91eecce1c3.key /dev/gptid/62c4ba17-33ae-11e3-8d79-00248c4855a5
sleep 2
#
#Unencrypts additional disk in a volume
geli attach -j /mnt/usbtest/Utilities/zfsvolumes -k /data/geli/cf32ff91-b0a0-448c-a698-aa91eecce1c3.key /dev/gptid/635046fb-33ae-11e3-8d79-00248c4855a5
sleep 2
#
#Mounts the ZFS Volume pool also adds sleep time for mounting the pool
zpool import -R /mnt Encrypted
sleep 10
#
#Exits the script
exit 1