SOLVED Installation asking to create a 16GiB swap partition

spiceygas

Explorer
Joined
Jul 9, 2020
Messages
63
I'm doing a clean, bare-metal install of FreeNAS on a 64 GB SATA DOM. During the installation process it asks if I want to create a 16 GB swap partition on the boot device.

Questions:
  1. The installation instructions (here) in the official documentation don't show this prompt. (It does mention a swap partition being created, but doesn't show the prompt). Should I put the swap on the boot device?
  2. Documentation (here) indicates that swap space is on the devices in the vdevs(s). If it put it on the boot device is that in lieu of the vdevs? In addition to the vdevs? If in addition, then which one takes priority for getting swapped memory?
Image1811461467972858450.jpg
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Should I put the swap on the boot device?
No.
If it put it on the boot device is that in lieu of the vdevs?
No.
In addition to the vdevs? If in addition, then which one takes priority for getting swapped memory?
Yes.
They are mirrored in pairs, so it's all of them if you have an even number of disks. (up to a maximum of 5 mirrors... I can't find the article where I saw that some years ago, so my memory may be bad or it may have changed, but that shouldn't be important)
In any case, you absolutely don't want to be using swap if you want any kind of reasonable performance, so stop worrying about the swap and start planning for how to make it irrelevant with enough RAM installed for your workload.
 

spiceygas

Explorer
Joined
Jul 9, 2020
Messages
63
Should I put the swap on the boot device?
No.
I appreciate your response. Thank you. I guess my question is if putting swap on the boot device is a bad idea, why did the developers make it a prompt during the install?

Especially given that documentation says that it is only done if the install device is >= 64 GB.
"If all of the selected devices are larger than 64 GiB and none are connected through USB, a 16 GiB swap partition is also created."

And if a boot swap is in addition to vdev swap, then which one gets used first when memory must be swapped? Given that some vdevs are traditional spinning platters, there would be a sizable performance difference.

In any case, you absolutely don't want to be using swap if you want any kind of reasonable performance, so stop worrying about the swap and start planning for how to make it irrelevant with enough RAM installed for your workload.
My build has sufficient RAM (I believe): 128 GB for home use as a media server. And if more ends up being needed then I will get more.

I'm less worried about having "enough" RAM because I'm willing to spend the money to solve that. I'm more concerned about getting the right settings to not cause problems later.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I appreciate your response. Thank you. I guess my question is if putting swap on the boot device is a bad idea, why did the developers make it a prompt during the install?
Because more and more users install on "real" SSDs as the boot device nowadays which most of the time will have plenty of "wasted" space left. So why not put swap there? I have the system dataset on my boot drives for that reason. The smallest M.2 SSDs you can buy new will come as 256 G or similar today.

Yet I would strongly advise against both if you are booting from USB, SD or similar.
 

spiceygas

Explorer
Joined
Jul 9, 2020
Messages
63
Because more and more users install on "real" SSDs as the boot device nowadays which most of the time will have plenty of "wasted" space left. So why not put swap there? I have the system dataset on my boot drives for that reason. The smallest M.2 SSDs you can buy new will come as 256 G or similar today.

Yet I would strongly advise against both if you are booting from USB, SD or similar.
That helps a lot.

If I'm using a 64 GB SATA DOM, is that "big enough" to justify putting the 16 GB swap on it? Or is it small enough that it should be avoided?

And if large enough to put the swap on it, should I then disable swap on vdevs? Is it an either/or, or both?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I would not put swap or the system dataset on a SATA DOM. They are quite sturdy but from what I read you just have one without redundancy, so I'd rather not. Put the system dataset on your data pool and swap on the vdevs.

HTH,
Patrick
 

spiceygas

Explorer
Joined
Jul 9, 2020
Messages
63
I would not put swap or the system dataset on a SATA DOM. They are quite sturdy but from what I read you just have one without redundancy, so I'd rather not. Put the system dataset on your data pool and swap on the vdevs.

HTH,
Patrick
Thank you. Sounds like it's not just size, but also a question of endurance and redundancy.

I appreciate the input & advice from both of you. Cheers.
 
Top