How should I setup SWAP?

It’s not clear to me how SWAP actually works. I tried to read about it in the docs but I didn’t find definitive info. I fund the swap settings in advanced system settings and there is option to choose in which pool I want my system dataset to be in and also the swap size can be set. I think this is missing from the Scale documentation, swap size is not mentioned there. It is however in Core, where it is said to be a Core only option:

(CORE only) By default, all data disks are created with the amount of swap specified. Changing the value does not affect the amount of swap on existing disks, only disks added after the change. Does not affect log or cache devices as they are created without swap. Setting to 0 disables swap creation completely. STRONGLY DISCOURAGED

I did set it to 0 though – after the system was already operational. During install I left this on default. The system dataset pool originally was my HDD data pool and swap was 2GB.
Now I have no idea what is happening with the swap now.

I have 16GB RAM so I probably need swap. I absolutely don’t ever want it to be on a HDD, I have enough SSD space. The quote above would mean that I’m already screwed because the HDD pool had swap set up during install, right? And even though I set it to 0, it didn’t do much.
But even more confusingly, even though I had originally a 2GB swap set up, which I changed to 0, I also have a (default) 16GB swap partition:

NAME     MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda        8:0    0 465.8G  0 disk  
├─sda1     8:1    0     1M  0 part  
├─sda2     8:2    0   512M  0 part  
├─sda3     8:3    0 449.3G  0 part  
└─sda4     8:4    0    16G  0 part  
  └─sda4 253:0    0    16G  0 crypt [SWAP]
sdb        8:16   0   3.6T  0 disk  
└─sdb1     8:17   0   3.6T  0 part  
sdc        8:32   0   9.1T  0 disk  
└─sdc1     8:33   0   9.1T  0 part  
sdd        8:48   1  18.2T  0 disk  
└─sdd1     8:49   1  18.2T  0 part  
sde        8:64   1 232.9G  0 disk  
└─sde1     8:65   1 232.9G  0 part

So what is happening now with swap? How can I change it, or should I?

The installer allows you to setup a 16 GiB swap partition on the boot device, as long as it is 64 GiB (or greater) in size, and it’s not a USB.


It serves more than just “swap”. By forcing a 2 GiB “buffer” as the first partition on a drive, you safeguard yourself whenever you need to replace a drive in your pool that supposedly has the “same” capacity. Therefor, if a new replacement drive is even a few megabytes smaller in capacity, it can still be used as a replacement.

Except, afaik, none of this matters in scale anymore.

Dragonfish 24.04.2 doesnt use swap, and doesn’t create swap partitions.

The non-swap “buffer” use matters, especially for NVMe and SSD replacements.

Yeah, I agree, but, Scale only makes one partition these days.