Actually, nothing nasty happens. The jails won't start of course, but FreeNAS will continue running without problems.
In reality, the config DB contains only single reference to the jails location and you can change it via GUI. The reason why you can't just
cp it over is that the jails (
warden) uses ZFS features to use disk space effectively (that's the reason you can't use UFS with FreeNAS jails). One plugin jail consumes about 700MB of disk space. With 5 plugins/jails you would waste 4*700MB=2.8GB of disk space by basically identical files. Instead of creating copies,
warden does a snapshot of the plugin template dataset and then creates individual plugin jails as ZFS clones of the template snapshot. If you
cp this to a new location you will lose the snapshot/clone links. Therefore you need to use ZFS replication to relocate the jails. Another small complication is that
warden explicitly sets the template dataset mountpoint.
Enough theory, this is the "Relocate jails how-to" :) :
Assumptions:
- The pool you are transferring the jails from is main_pool
- The destination pool is ssd_pool
- The jail root (Jails->Configuration) is /mnt/main_pool/jails
- The new jail root will be /mnt/ssd_pool/jails
Steps:
- Turn off all plugins (Plugins->Installed)
- Stop all jails (Jails->View Jails)
- Run these commands via CLI:[PANEL]zfs snapshot -r main_pool/jails@relocate
zfs send -R main_pool/jails@relocate | zfs receive -v ssd_pool/jails
zfs get -rH -o name -s received mountpoint ssd_pool/jails | xargs -I {} sh -c "zfs set mountpoint=/{} {}; zfs mount {};"[/PANEL]
- Change the Jail Root to /mnt/ssd_pool/jails (Jails->Configuration)
- Start jails/plugins
- Check that everything works and destroy the original jails dataset (main_pool/jails)