Swap = 0 being ignored

Status
Not open for further replies.

Han Sooloo

Dabbler
Joined
Dec 23, 2015
Messages
16
Want to setup swap on the install disk, instead of it being striped across the pool member disks.

From what I gather, I should be able to do the following:

  1. Go to System / Advanced, and set "Swap size on each drive in GiB, affects new disks only. Setting this to 0 disables swap creation completely (STRONGLY DISCOURAGED)." to 0 (zero).
  2. Go to System / Tunables, add "swapfile", set to "/usr/swap0" with "rc.conf" type.
However, step-1 *ALWAYS* fails.

In the UI, it seems like I can set the swap to 0. Every time I boot, the system auto-re-creates a swap file striped across the pool disks.

Essentially, it's ignoring the UI settings.

Is this a know bug?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Every time I boot, the system auto-re-creates a swap file striped across the pool disks.
I'm not familiar with this behavior, but this is not what that setting controls. Ordinarily, when you create or extend a pool, FreeNAS puts a small (by default, 2 GB) partition at the beginning of the drive, and uses the rest of the drive for the pool. The configuration option you refer to controls the size (or existence) of this partition.

Why do you want swap to be on the boot device?
 

solarisguy

Guru
Joined
Apr 4, 2014
Messages
1,125
Want to setup swap on the install disk, instead of it being striped across the pool member disks.

From what I gather, I should be able to do the following:

  1. Go to System / Advanced, and set "Swap size on each drive in GiB, affects new disks only. Setting this to 0 disables swap creation completely (STRONGLY DISCOURAGED)." to 0 (zero).
  2. Go to System / Tunables, add "swapfile", set to "/usr/swap0" with "rc.conf" type.
However, step-1 *ALWAYS* fails.

In the UI, it seems like I can set the swap to 0. Every time I boot, the system auto-re-creates a swap file striped across the pool disks.

Essentially, it's ignoring the UI settings.

Is this a know bug?
No, it is not the bug!

Let me quote from your post:
  • Swap size on each drive in GiB, affects new disks only. Setting this to 0 disables swap creation completely
    So you setting it to 0 does not change existing swap!
  • It is not that the system auto-re-creates a swap file striped across the pool disks
    1. There is no swap file across the pools disks.
    2. There are swap partitions on each disk that was partitioned (moved into a pool) while swap size was non-zero.
    3. You did not remove them so they are still there and used as swap.
    4. You can stop swap, change the partition type from freebsd-swap to something else, preferably to nothing that would ever be interpreted by FreeNAS or FreeBSD (like vmware-reserved).
    5. Then on a reboot the system would see no swap partitions on your data disks.
Am I guessing correctly that you have a quality SSD as your system disk (not the install disk, as that is being used only once) ?

I also did like the idea of having:
  • jails
  • swap
  • .system
on my data disks, so I have a separate pool on separate disks for the above and some other miscellaneous stuff. BTW, I had to increase swap size per disk :D when creating the pool on those extra disks, since I have only two of them...
 
Status
Not open for further replies.
Top