Relocate Jails to SSD helping HDD sleep?

Status
Not open for further replies.

PnoT

Dabbler
Joined
Apr 12, 2017
Messages
41
I've managed to move the jails to the new location and everything works great except for the .warden datasets are showing up instead of being hidden. Is there a way to fix that?

upload_2017-7-12_12-25-27.png


A new post has been created on this problem instead of tagging onto the end of this one.
 
Last edited:

Erd

Cadet
Joined
May 30, 2016
Messages
5
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:
  1. Turn off all plugins (Plugins->Installed)
  2. Stop all jails (Jails->View Jails)
  3. 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]
  4. Change the Jail Root to /mnt/ssd_pool/jails (Jails->Configuration)
  5. Start jails/plugins
  6. Check that everything works and destroy the original jails dataset (main_pool/jails)

Thanks so much for this, saved me a ton of frustration as I wanted to move my jails off of my data volume and into a separate, mirrored volume (with two SSDs). Worked like a charm and even reduced the total size of the jails folder from ~14.5gb -> ~10gb (which I don't understand, but I'm not complaining)

Like others have mentioned I thought I'd be smart and make the dataset first, but the command complains. Simply deleted the dataset I created.
 
Status
Not open for further replies.
Top