TrueNAS SCALE will create but not use 2GB SWAP on Pool Disks, only 2GB on Bootdisk

dln_

Cadet
Joined
Feb 6, 2023
Messages
3
Hello all!

I'm in the process of evaluating several different NAS operating systems and I'm currently giving TrueNAS SCALE a go.

HP ProLiant Microserver Gen8
Intel Xeon E3-1265Lv2 8-core
16GB ECC Memory

Boot device: 64GB MicroSD Card in the Servers MicroSD slot
Disk for testing: 500GB WD Blue 3.5"

I am aware that using a MicroSD as boot medium is discouraged, but I accept the possible performance impact and looked out to pick a slightly more expensive card geared towards 24/7 use. The SD Card is connected trough a USB 2.0 bridge.
While installing TrueNAS SCALE I was given the option to put a 16GB SWAP partition onto my boot device.

I decided to add the Partition and now my partition configuration looks like this:
Code:
NAME     TYPE    SIZE MOUNTPOINT PARTTYPENAME             VENDOR   MODEL                  TRAN
sda      disk  465.8G                                     ATA      WDC_WD5000AAKX-07U6AA0 sata
├─sda1   part      2G            Linux swap
└─sda2   part  463.8G            Solaris /usr & Apple ZFS
sdb      disk   59.6G                                     HP iLO   Internal_SD-CARD       usb
├─sdb1   part      1M            BIOS boot
├─sdb2   part    512M            EFI System
├─sdb3   part   43.1G            Solaris /usr & Apple ZFS
└─sdb4   part     16G            Linux swap
  └─sdb4 crypt    16G [SWAP]


Notice the 2GB Linux swap partition on sda1. This partition does not appear to be in use by the system. Only the 16GB on the boot device (behind a dm-crypt mapper, is swap encrypted for security?)

Code:
NAME      TYPE      SIZE USED PRIO
/dev/dm-0 partition  16G   0B   -2


Nor does it even contain a valid swap signature.

Code:
swapon: /dev/sda1: read swap header failed


If I do not choose to create a 16GB SWAP on the bootdevice the 2GB SWAP partition on the pool disks is also created but still not used (swapon not outputting anything)

Code:
NAME   TYPE   SIZE MOUNTPOINT PARTTYPENAME             VENDOR  MODEL      TRAN
sda    disk  59.6G                                     HP iLO  Internal_S usb
|-sda1 part     1M            BIOS boot
|-sda2 part   512M            EFI System
`-sda3 part  59.1G            Solaris /usr & Apple ZFS
sdb    disk 465.8G                                     ATA     WDC_WD5000 sata
|-sdb1 part     2G            Linux swap
`-sdb2 part 463.8G            Solaris /usr & Apple ZFS


What's the reason to create an empty SWAP partition on disk like this? Should I do anything about it (run mkswap and add it with swapon)?

Cheers
 

dln_

Cadet
Joined
Feb 6, 2023
Messages
3
Apologies, I made a mistake in the above post. Before posting the second lsblk output after reinstalling with no 16GB SWAP on the boot device, I did not recreate a storage pool on the 500GB. I did that now and sure enough, the 2GB do get used as swap space.

Code:
NAME     TYPE    SIZE MOUNTPOINT PARTTYPENAME             VENDOR  MODEL   TRAN
sda      disk   59.6G                                     HP iLO  Interna usb
|-sda1   part      1M            BIOS boot
|-sda2   part    512M            EFI System
`-sda3   part   59.1G            Solaris /usr & Apple ZFS
sdb      disk  465.8G                                     ATA     WDC_WD5 sata
|-sdb1   part      2G            Linux swap
| `-sdb1 crypt     2G [SWAP]
`-sdb2   part  463.8G            Solaris /usr & Apple ZFS


Code:
NAME      TYPE      SIZE USED PRIO
/dev/dm-0 partition   2G   0B   -2


Still, why does a 2GB swap partition get created and remains unused when there is also a 16GB on the boot disk?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
This is carry-over from CORE, which creates 2GB FreeBSD-swap partitions, and is in place if you ever decide to move your pool disks back to CORE.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Still, why does a 2GB swap partition get created and remains unused
It is, as Samuel says, a carry-over from CORE. It's also there in case of minor variations in disk size, particularly in the case of disk replacement. If you bought a different model of disk with a slightly different (especially smaller) capacity, reducing the size of the swap partition--or removing it entirely--would still let you replace a failed disk.
 

dln_

Cadet
Joined
Feb 6, 2023
Messages
3
This is carry-over from CORE, which creates 2GB FreeBSD-swap partitions, and is in place if you ever decide to move your pool disks back to CORE.
I see, so you could say its for backwards-compatibility.

Would it make sense to make use of it under the Debian Linux based SCALE if you already have 16GB on a boot device?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Would it make sense to make use of it under the Debian Linux based SCALE if you already have 16GB on a boot device?

It's your system. Can't hurt to use it. You may not get much benefit from it, or as a colleague of mine once put it: "The juice ain't worth the squeeze."
 
Top