Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

No Swap Partition possible, why? - wish for future release!

Western Digital Drives - The Preferred Drives of FreeNAS and TrueNAS CORE

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
Hello,
I just migrated 2 NAS from XigmaNAS to FreeNAS!

NAS1 (32GB RAM)
System drive: 160 GB HDD @ SATA
FreeNAS Installation DVD created 3 Partitions (Boot, System and SWAP I assume)

NAS2 (32GB RAM)
System drive: 120 GB SSD @ USB 3.0
FreeNAS Installation DVD created 2 Partitions (Boot & System) - an SSD @ USB3 should be fast enough for a SWAP-Partition, there is no SATA Port free

According to the Fact that I can't create any Pools NAS2cannot create a Swap-Partition on a Pool. All Polls existspreviously and are only imported (successful as far as I can see).

Questions:
Why obviously a different Installation on HDD @ SATA and SSD @ USB3?
Why no choosable installation Mode anymore? (previous Versions had selections between SWAP and no No Swap)


A SWAP Partition is highly recommended - even on Systems with more RAM!
 

danb35

Wizened Sage
Joined
Aug 16, 2011
Messages
11,877
(previous Versions had selections between SWAP and no No Swap)
I don't believe the FreeNAS installer has ever offered to create swap--can you cite one to the contrary? Certainly with the old "standard" of USB sticks as installation media, that would have been a disaster.
A SWAP Partition is highly recommended
Yes, that's why FreeNAS creates them on your pool disks.
 

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
I don't believe the FreeNAS installer has ever offered to create swap--can you cite one to the contrary? Certainly with the old "standard" of USB sticks as installation media, that would have been a disaster.
Here we go!
especially https://www.andysblog.de/wp-content/uploads/2010/05/image4.png

Btw: Use of cheapest USB Sticks is always a desaster!!
I have severals NAS running with an Sandisk Extreme Pro (SSD technology) since several years under Nas4Free/XigmaNAS with Swap Partition on them

And again I installed on an SSD, not cheap USB Stick!

Yes, that's why FreeNAS creates them on your pool disks.
NO!!!
On Existing Pools this should never happen or if FreeNAS touches existing Pools this way, use of FreeNAs would be highly dangerous to existing Data on that pools and unpredictable!!!


Remember, that's FreeNAS specific and against the best practise Guidelines for ZFS -Use whole disk, not Partition - and of course a "desaster" for the portability of ZFS Pools between FreeNAS and Operating systems that follows this Guideline (Solaris, XigmaNAS, OpenIndiana, OmniOS etc.)
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
2,695
You're misinterpreting @danb35's comment. By default, after installation, FreeNAS doesn't create a swap partition on the device(s) hosting the boot pool. Under System->Advanced, there's a setting for Swap Size:

1594640295736.png


This is the size of a swap partition FreeNAS will create on empty disks. If a previously used disk is inserted, FreeNAS won't create a swap partition, as it has no way of knowing if there's enough free space to create a partition or not. If there's an existing swap partition on the inserted disk, FreeNAS will use it.

FreeNAS prefers to add swap partitions of the same size into a swap mirror, so failure of a single swap partition won't crash the OS, if that swap partition happened to be in use.
 

danb35

Wizened Sage
Joined
Aug 16, 2011
Messages
11,877
Here we go!
...and you post a link to a 10-year-old blog post for a completely different product. Long in the past, iXSystems bought the name of FreeNAS, and developed FreeNAS 8 as a completely new product--other than the name, it has no connection at all with 0.7 and prior versions. "FreeNAS" 0.7 became NAS4Free, which then became XigmaNAS. The product that's currently called FreeNAS (and soon to be called TrueNAS) has never created swap on the boot device.

As to the rest, take a breath and calm down.

Edit: But if you really want swap on your boot device, you could adapt this method to make it happen:
 
Last edited:

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
You're misinterpreting @danb35's comment. By default, after installation, FreeNAS doesn't create a swap partition on the device(s) hosting the boot pool. Under System->Advanced, there's a setting for Swap Size:

View attachment 40090

This is the size of a swap partition FreeNAS will create on empty disks. If a previously used disk is inserted, FreeNAS won't create a swap partition, as it has no way of knowing if there's enough free space to create a partition or not. If there's an existing swap partition on the inserted disk, FreeNAS will use it.

FreeNAS prefers to add swap partitions of the same size into a swap mirror, so failure of a single swap partition won't crash the OS, if that swap partition happened to be in use.
Why are there 3 Partitions on the HDD @SATA on the first NAS and only 2 on the second NAS with SSD @ USB3.0?
What's the difference between these 2 installations?

I assumed that the 3rd Partion might be SWAP.

Due to the lack of missing SWAP using FreeNAS seems not recommended with existing Pools.
I'm going to observe if freeNAS crashes in the Future and I might revert back to XigmaNAS.
 

Patrick M. Hausen

Dedicated Sage
Joined
Nov 25, 2013
Messages
2,767

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
This is my newer NAS with SSD @ USB3
The Pool was created under an actual XigmaNAS about 2 Months ago - and as I see with Partitions * now I'm in confusion* :cool:

Code:
root@MegaNAS[~]# gpart show
=>         40  31251759024  ada0  GPT  (15T)
           40         8152        - free -  (4.0M)
         8192  31251742720     1  freebsd-zfs  (15T)
  31251750912         8152        - free -  (4.0M)

=>         40  31251759024  ada1  GPT  (15T)
           40         8152        - free -  (4.0M)
         8192  31251742720     1  freebsd-zfs  (15T)
  31251750912         8152        - free -  (4.0M)

=>         40  31251759024  ada2  GPT  (15T)
           40         8152        - free -  (4.0M)
         8192  31251742720     1  freebsd-zfs  (15T)
  31251750912         8152        - free -  (4.0M)

=>         40  31251759024  ada3  GPT  (15T)
           40         8152        - free -  (4.0M)
         8192  31251742720     1  freebsd-zfs  (15T)
  31251750912         8152        - free -  (4.0M)

=>         40  31251759024  da0  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>         40  31251759024  da1  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>         40  31251759024  da2  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>         40  31251759024  da3  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>         40  31251759024  da4  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>         40  31251759024  da5  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>         40  31251759024  da6  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>         40  31251759024  da7  GPT  (15T)
           40         8152       - free -  (4.0M)
         8192  31251742720    1  freebsd-zfs  (15T)
  31251750912         8152       - free -  (4.0M)

=>       40  250069600  da8  GPT  (119G)
         40       1024    1  freebsd-boot  (512K)
       1064  250052608    2  freebsd-zfs  (119G)
  250053672      15968       - free -  (7.8M)



This is my Older NAS
The Pool was newlly created under an actual XigmaNAS about 2 Months ago - and as I see without Partitions * More confusion* :cool:
( The Disks containing the ZFS Pool are not listet with gpart show)

Code:
Digi-xxx[~]# gpart show
=>       40  321672880  ada0  GPT  (153G)
         40       1024     1  freebsd-boot  (512K)
       1064   33554432     3  freebsd-swap  (16G)
   33555496  288096256     2  freebsd-zfs  (137G)
  321651752      21168        - free -  (10M)


Both Boot-Disks were installed on the same PC, using the same Installation DVD (FreeNAS-11.3-U3.2.iso)
 

Patrick M. Hausen

Dedicated Sage
Joined
Nov 25, 2013
Messages
2,767
Two things I think I know:
* there's a rather recent option to create a swap partition on the boot pool drive at install time
* the option seems to be triggered by boot drive size, i.e. under a certain threshold the question is not asked and a boot drive created without swap

FreeNAS has alway strongly urged users to create the swap partitions on the data drives. What I dislike is the ridiculously low default size. What's 2 G per disk for a system with, 64 or even more G of memory?

I don't know what XigmaNAS does in this regard and it looks like you don't have any swap partitions on your data drives at all.
 

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
...and you post a link to a 10-year-old blog post for a completely different product. Long in the past, iXSystems bought the name of FreeNAS, and developed FreeNAS 8 as a completely new product--other than the name, it has no connection at all with 0.7 and prior versions. "FreeNAS" 0.7 became NAS4Free, which then became XigmaNAS. The product that's currently called FreeNAS (and soon to be called TrueNAS) has never created swap on the boot device.
I think your Information ist really not correct!!
Code:
Digi-xxx[~]# gpart show
=>       40  321672880  ada0  GPT  (153G)
         40       1024     1  freebsd-boot  (512K)
       1064   33554432     3  freebsd-swap  (16G)
   33555496  288096256     2  freebsd-zfs  (137G)
  321651752      21168        - free -  (10M)

As to the rest, take a breath and calm down.

Edit: But if you really want swap on your boot device, you could adapt this method to make it happen:
This is unsupported, might be broken on the next Major release and is really much more work than new install and restore of the configuration if the Boot disk fails...
(Remark: This kind of installation from scratch were supported by PCBSD years ago, without "hackin'")
 
Last edited:

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
Two things I think I know:
* there's a rather recent option to create a swap partition on the boot pool drive at install time
* the option seems to be triggered by boot drive size, i.e. under a certain threshold the question is not asked and a boot drive created without swap
Size and / or Interface or whatever .... - that's the cardinal question ...

FreeNAS has alway strongly urged users to create the swap partitions on the data drives. What I dislike is the ridiculously low default size. What's 2 G per disk for a system with, 64 or even more G of memory?
The presence of a swap-partition seems to be the more important fact for system stability , even it is remarkable small against the RAM-Size

I don't know what XigmaNAS does in this regard and it looks like you don't have any swap partitions on your data drives at all.
As already written, these Pools exists already and are filled with Data, though they were only imported
 

danb35

Wizened Sage
Joined
Aug 16, 2011
Messages
11,877
there's a rather recent option to create a swap partition on the boot pool drive at install time
Huh. Just tried installing 12.0-BETA on a 250 GB virtual disk, and sure enough, it gives me this screen:
1594657575701.png

Wonder when that came in. There's not a word about it in the 11.3-U3.2 manual, but the 11.3-U2.1 installer does the same thing. Going way back, 9.10 doesn't.
the option seems to be triggered by boot drive size, i.e. under a certain threshold the question is not asked and a boot drive created without swap
Wonder what that threshold is--though from OP's report, it would appear to be somewhere between 120 and 150 GB. Very interesting. And @DigiQuick, my apologies.
FreeNAS has alway strongly urged users to create the swap partitions on the data drives. What I dislike is the ridiculously low default size. What's 2 G per disk for a system with, 64 or even more G of memory?
I think this is because they really aren't intending the swap to be used at all. You may remember that, for a long time, the party line here was, "if your system is using swap, you're doing it wrong." Even today, you wouldn't expect a properly-spec'd system to use any significant amount of swap. What's long been said to be the reason for the swap partition was to allow a little bit of "fudge factor" with disk replacement, in case the replacement disk wasn't exactly the same size as the others in the vdev. In that case, you could mess with the size of the swap partition to allow the replacement to work.
 

danb35

Wizened Sage
Joined
Aug 16, 2011
Messages
11,877
I think your Information ist noct correct!!
Well, part of it is and part of it isn't. The part about how the 10-year-old blog post you linked to, talking about FreeNAS 0.7.something, is completely irrelevant to anything that's been called FreeNAS for the last several years, was entirely correct. The part about FreeNAS not putting swap on the boot device was indeed incorrect; it seems that was an option added to the installer somewhere around version 11.3 (it wasn't there in 11.1-U6 or 11.2-U8, but is there in 11.3-U2.1). And it also seems iX were pretty quiet about the change.
 

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
Just playin' around
160GB Boot HDD in VMWARE Workstation Player
130GB Boot HDD in VMWARE Workstation Player
120GB Boot HDD in VMWARE Workstation Player
80GB Boot HDD in VMWARE Workstation Player
60GB Boot HDD in VMWARE Workstation Player

image7.jpg


40GB Boot HDD in VMWARE Workstation Player = NO SWAP

In Fact it's not the Size - primery (between 40 and 60 GB)
Changing to IDE instead of SCSI doesn't matter too and I don't see a possibility to emulate an HDD/SSD @ USB:
I Think it is the Interface (USB) that triggers the disability of creating swap on Bootdevice
But USB doesn't unavoidable mean cheap USB-Stick, you can also connect an HDD or SSD via USB2SATA Bridge
 

Attachments

Last edited:

colmconn

Member
Joined
Jul 28, 2015
Messages
174
Huh. Just tried installing 12.0-BETA on a 250 GB virtual disk, and sure enough, it gives me this screen:
View attachment 40098
Wonder when that came in. There's not a word about it in the 11.3-U3.2 manual, but the 11.3-U2.1 installer does the same thing. Going way back, 9.10 doesn't.
The threshold is 60GB disk size (and not USB) and it's been in the installer for about 2ish years it my github-fu is correct. https://github.com/freenas/freenas/...2d38/src/freenas-installer/etc/install.sh#L32 (Click the three dots next to the line number and then View git blame to get a history.)
 

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
There it is: " and none is USB" ( but I could not fing the coressponding Code for this comment)

Code:
: ${MIN_SWAPSAFE_MEDIASIZE:=$((60 * GB))}; readonly MIN_SWAPSAFE_MEDIASIZE

# Check if it is safe to create swap partitions on the given disks.
#
# The result can be forced by setting SWAP_IS_SAFE in the environment to either
# "YES" or "NO".
#
# Sets SWAP_IS_SAFE to "YES" if
#   we are on TrueNAS
#   *or*
#   every disk in $@ is >= ${MIN_SWAPSAFE_MEDIASIZE} and none is USB and user says ok
# Otherwise sets SWAP_IS_SAFE to "NO".
#


And when using TruNAS the user decides alone !

Sets SWAP_IS_SAFE to "YES" if
# we are on TrueNAS


The only current solution seems to be
- Backup the Configuration,
- installing onto a normal Harddisk,
- cloning HDD to USB-SSD
- restore Config

Or leave it as is and hoping that 32GB RAM ist enough for a rockstable NAS without SWAP....

Btw: Now I know, why one Poll consists on Partitions
XigmaNAs has a tick Box 'Create ZFS on a GPT partition'....
 
Last edited:

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,958
The installer option was in the 11.3 RC, I remember being given that option with mirrored 120 GB SSDs.
 

DigiQuick

Junior Member
Joined
Jul 10, 2020
Messages
14
I think you didn't install on Mirrored SSDs @ USB!
@SATA, SAS, PCIe (NVMe) you have the Option, but not @USB.
But unlike as assumed USB does not limit to USB-Flash-Sticks
The more options for Mass Storage @USB are
- HDD
- SSD
- Compact Flash
- SD(XC, HC)
And this Fact is completely not considered by the developer
 

danb35

Wizened Sage
Joined
Aug 16, 2011
Messages
11,877
And this Fact is completely not considered by the developer
I'd suspect that any of these being used is very rare, especially CF (which has been pretty well dead for quite some time now--its use in computers pretty well died with the PATA interface). And SD card is no better than USB stick, and probably even worse.
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,958
I'm sure good SD cards exist and I'm also sure they cost way more than a real SSD would.
 
Top