Relocate Jails to SSD helping HDD sleep?

Status
Not open for further replies.

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
But they are backwards-compatible and should work fine as USB 2.0 devices.
 

rm-r

Contributor
Joined
Jan 7, 2013
Messages
166
yes sorry - i thought that after i posted too - they will just fall back to usb 2 speeds - makes a difference if transferring large amounts of data time wise
 

Bmck26

Dabbler
Joined
Dec 9, 2013
Messages
48
usb 3 is currently disabled by default

Yeah, I tried to enable them via the Tunable "xhci_load" but it appears that my chip set isn't supported b/c the drives never registered. I then tried a USB 2.0 slot but I didn't have any look with it. I kept getting a multipath/disk1 error. I don't know what that was all about. I tested both the drives before I tried them so I know they work fine. Good speed over USB 3.0, 150 mb/s read using ATTO when I benchmarked them on my desktop.
 

mka

Contributor
Joined
Sep 26, 2013
Messages
107
I've created a second pool on the SSD and used Dusan's template to relocate my jails to the new destination. This worked like a charm! :)

But somehow my drives won't sleep, even after 10hours of nothingness happend and no sleep. I can hear them and see them on the watt-meter. I've disabled all periodic accesses from the Plex Plugin, no periodic snapshots were scheduled at the time. I even stopped the jails but no sleep.

I remembered using the fresh install of FreeNAS my drives were going to sleep. But after I've started with the jails the sleepless time started. Can I find out what access is keeping the drives up and running?
Thanks :)
 

mka

Contributor
Joined
Sep 26, 2013
Messages
107
Is it maybe possible to show all open FreeBSD file handles and grep them to possible locations on the main storage tank?
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
I've created a second pool on the SSD and used Dusan's template to relocate my jails to the new destination. This worked like a charm! :)

But somehow my drives won't sleep, even after 10hours of nothingness happend and no sleep. I can hear them and see them on the watt-meter. I've disabled all periodic accesses from the Plex Plugin, no periodic snapshots were scheduled at the time. I even stopped the jails but no sleep.

I remembered using the fresh install of FreeNAS my drives were going to sleep. But after I've started with the jails the sleepless time started. Can I find out what access is keeping the drives up and running?
Thanks :)

Did you make sure to disable syslog on the pool (using 9.2.1.3 here) also I don't know if providing .system in the pool will allow for sleep.. I imagine it would if you are not using Samba anywhere when you want the drives to sleep..
 

mka

Contributor
Joined
Sep 26, 2013
Messages
107
What do you mean disabling syslog? The Jails are running on my SSD and FreeNAS should only log to Ramdisk, shouldn't it? I don't see any logs on my main Pool anyhow. And why would Samba prevent the drives from sleeping without any active connection accessing the drives?

I did configure the spindown time of my harddrives to 5min - just for testing - and disabled everything I could think of. All Jails stopped, disabled CIFS/NFS Sharing, disabled even S.M.A.R.T. service and did shutdown all devices which could access by Samba/NFS. But even after hours the drives won't spindown. Any further ideas would be really helpful.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah.. FreeNAS by default uses the .system(I think that's it.. not running 9.2.1.x) and it makes updates every few minutes. There is no current fix except to move the .system to another pool that won't prevent the hard drives from sleeping.
 

mka

Contributor
Joined
Sep 26, 2013
Messages
107
Awesome! That did the trick... I moved the syslog option to the SSD pool and my main pool suddenly starts sleeping again.

And the moment this worked I ordered another SSD to add mirroring to my current Jail/Syslog/System pool (120GB have become quite cheap) ... together with another set of 16GB ECC RAM. :)
 
Joined
Apr 26, 2014
Messages
1
Hi everyone,
I tried to do the same (moving the jails and .system datasets) to an ssd but I unfortunatelly have not seen this thread until after I destroyed my old jails root dataset.
I have created a new dataset on the ssd pool and when I try to install a plugin or create a new jail through the gui the following error appears:

Code:
cannot mount '/plugins_partition/jails/.warden-template-pluginjail': failed to create mountpoint filesystem successfully created, but not mounted ERROR: Failed creating ZFS base dataset cannot open 'plugins_partition/jails/.warden-template-pluginjail': dataset does not exist ERROR: Failed to create ZFS base dataset


if I understand correctly the error message the .warden-template-pluginjail should be on a separate dataset but its not. It is created as a normal folder on the parent datase (plugins_partition).
Is there a script that is executed once at the very first time a jail is created that creates the .warden-template-pluginjail ?


Code:
[root@homenas] /data# zfs list
NAME                              USED  AVAIL  REFER  MOUNTPOINT
plugins_partition                2.31M  7.81G  160K  /mnt/plugins_partition
plugins_partition/.system          960K  7.81G  168K  /mnt/plugins_partition/.system
plugins_partition/.system/cores    144K  7.81G  144K  /mnt/plugins_partition/.system/cores
plugins_partition/.system/samba4  336K  7.81G  336K  /mnt/plugins_partition/.system/samba4
plugins_partition/.system/syslog  312K  7.81G  312K  /mnt/plugins_partition/.system/syslog
plugins_partition/jails            168K  7.81G  168K  /mnt/plugins_partition/jails
red_disks                        1.41T  3.78T  256K  /mnt/red_disks
red_disks/Backups                  139G  3.78T  139G  /mnt/red_disks/Backups
red_disks/Movies                  576G  3.78T  576G  /mnt/red_disks/Movies
red_disks/Music                    722G  3.78T  722G  /mnt/red_disks/Music
red_disks/media                  3.98G  3.78T  3.98G  /mnt/red_disks/media


any ideas are welcome
 

erodz1892

Dabbler
Joined
Mar 25, 2014
Messages
21
Was just looking at this thread last night, had the same problem I really wanted the HDD to sleep and from what I understand is that the HDD will not sleep unless the Jails are in other location ie SSD I don't know how to check that the HDD is sleeping or spinning down I did the proper set up in the disk to spin down in 30 minutes. Here is what I ended up with,
 

Attachments

  • Untitled.png
    Untitled.png
    325.6 KB · Views: 304

BottomsUp

Dabbler
Joined
Jun 28, 2014
Messages
23
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)

Hi

I did this and my jails start from the new SSD but my plugin manager says I have no plugins. Do you know how I fix that?

Thx
 

erodz1892

Dabbler
Joined
Mar 25, 2014
Messages
21
Hi

I did this and my jails start from the new SSD but my plugin manager says I have no plugins. Do you know how I fix that?

Thx
Sounds like you are going to need the old backup and fresh install Freenas. It took me a few tries till I got this right I created the SSD dataset first created the SYS file there and the jails as well then I created the mass data set for plex etc on another HDD drive now I added another 1TB drive for pictures backup with BTsync and works good.
 

BottomsUp

Dabbler
Joined
Jun 28, 2014
Messages
23
Sry I don't understand what I need to do with the backup? Are you saying I did the steps wrong and I should start over to try again ?
 

xxsj

Dabbler
Joined
Aug 2, 2014
Messages
26
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)

I've used this so many times since I first started on FreeNAS. Thank you so much for sharing it!
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
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)

There are so many really smart people out there. Thank you so much for posting the above. Just did that and it worked awesome. Only step I screwed up was I pre-created the dataset on the SSD because I did not know that the zfs send/receive command would create it for me. It barked for a second, I deleted the dataset and then in worked perfectly.

Now, before I go and delete the old jail dataset, I would like to know for sure the jails are being run from the SSD. Is there a way to do this? Or is it enough that my jail configuration page points to the new dataset?

Also, I think I can, but I just want to know if I can delete the snapshots in the new jail location, just for housekeeping purposes.

Again, thank you for the how-to!!

Cheers,
 
Last edited:

airflow

Contributor
Joined
May 29, 2014
Messages
111
Is it possible to run Jails from USB drives? I have the same problem as mka except I don't have any spare SATA ports left to use for SSD jails.

My server never powers down which I assume is b/c I have plex and transmission plugins running and plex is constantly refreshing the library. I'm the only person who uses the server so there's no point in it using more power than necessary from the time I go to bed to when I get home from work in the evenings around 6pm. It's cobbled together from left over parts so its not the most energy efficient build to begin with but I don't care how much it uses when it's being utilized. I get good transfer rates on LAN (110 MB/s peak on CFS share) so I'm please with the performance. I just want it to go to sleep when I'm not at home.

I had the same idea (jails on SSD) and problem (no SATA-port free for SSD), which is why I'm currently researching about supported PCIe-SSDs (see this thread)
 

Pasquale61

Explorer
Joined
Oct 8, 2014
Messages
62
Also, I think I can, but I just want to know if I can delete the snapshots in the new jail location, just for housekeeping purposes.

I just went through the same process you did to move my system dataset and jails to SSD and it seems to be working great. I'm at the same point where I "think" I can delete all the snapshots that were created during this process, but since I'm new to all of this, I'm not 100% sure. Did you try this yet, or did you find an answer to your question?
 

kraab

Dabbler
Joined
Jan 31, 2015
Messages
14
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)

Many thanks to you Dusan!!! This worked magic on the latest stable of 9.3, moved all my jails. This would not have been possible without these commands since I have virtualbox, openvpn and 12 other plugins installed and fully configured.

Moved my dataset to SSD as well to aid in letting my RE2 array nap..
 

Bish

Cadet
Joined
Aug 1, 2014
Messages
8
(lots of clever stuff)
Just throwing some more love at this post - I've also used these steps several times, since my box is a mishmash hobby thing that's grown and evolved in the many months since I first took the plunge. Jails have been relocated back and forth all over the place, and each time I've typed in the magic incantations, held my breath and been genuinely stunned to see everything has worked perfectly. Sooner or later I'm going to do something dumb and have to rebuild from scratch, but in the meantime, this post has postponed that dullness many times! Thanks, Dusan.
 
Status
Not open for further replies.
Top