swapinfo

Status
Not open for further replies.

eim

Dabbler
Joined
Dec 12, 2016
Messages
28
hi there, running FreeNAS 11.1-U2 here with some ZFS volumes:

Code:
root@freenas:~ # zfs list
NAME													 USED  AVAIL  REFER  MOUNTPOINT
freenas-boot											5.13G  8.79G	64K  none
freenas-boot/ROOT									   5.11G  8.79G	29K  none
freenas-boot/ROOT/11.0-RELEASE						   161K  8.79G  2.34G  /
freenas-boot/ROOT/11.0-U3								395K  8.79G  2.33G  /
freenas-boot/ROOT/11.1-U2							   5.11G  8.79G   835M  /
freenas-boot/ROOT/9.10.2-U4							  131K  8.79G  2.25G  /
freenas-boot/ROOT/Initial-Install						  1K  8.79G   636M  legacy
freenas-boot/ROOT/default								135K  8.79G  2.25G  legacy
freenas-boot/grub									   6.85M  8.79G  6.85M  legacy
...
tank0/vm/service-01									  123G  1.39T	88K  /mnt/tank0/vm/service-01
tank0/vm/service-01/disk0							   21.1G  1.41T   775M  -
tank0/vm/service-01/disk1								102G  1.49T   783M  -

was just wondering that swapinfo is not showing any swap space, as far as I've read FreeNAS should allocate something like 2G of swap for each ZFS vol or similar.
On an other older FreeNAS I can see exactly this behaviour, any suggestions on this? or maybe any ideas on how to add those 2G swap spaces? Thanks.
 

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338
was just wondering that swapinfo is not showing any swap space, as far as I've read FreeNAS should allocate something like 2G of swap for each ZFS vol or similar.
On an other older FreeNAS I can see exactly this behaviour, any suggestions on this?

Per default 2G of swap space is allocated per disk in FreeNAS.
http://doc.freenas.org/11/intro.html#storage-disks-and-controllers
http://doc.freenas.org/11/system.html#advanced

In recent FreeNAS versions two such swap partitions are combined to form a swap mirror. Example with 6 disks in FreeNAS 11.1-U2:
Code:
~ % swapinfo
Device		  1K-blocks	 Used	Avail Capacity
/dev/mirror/swap0.eli   2097152		0  2097152	 0%
/dev/mirror/swap1.eli   2097152		0  2097152	 0%
/dev/mirror/swap2.eli   2097152		0  2097152	 0%
Total			 6291456		0  6291456	 0%

Do you have a special hardware configuration, i.e. for example only a single disk so that forming a swap mirror is not possible?
Did you create your pool(s) in some special/nonstandard way?
 
Last edited:

eim

Dabbler
Joined
Dec 12, 2016
Messages
28

four disks (ada0-3):

Code:
root@ci:~ # zpool status tank0
  pool: tank0
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
	still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
	the pool may no longer be accessible by software that does not support
	the features. See zpool-features(7) for details.
  scan: scrub repaired 0 in 0 days 00:29:56 with 0 errors on Sun Jul 30 00:29:59 2017
config:

	NAME											STATE	 READ WRITE CKSUM
	tank0										   ONLINE	   0	 0	 0
	  mirror-0									  ONLINE	   0	 0	 0
		gptid/5260cf1f-357b-11e7-850d-00fd45fc03bc  ONLINE	   0	 0	 0
		gptid/53bb4feb-357b-11e7-850d-00fd45fc03bc  ONLINE	   0	 0	 0
	  mirror-1									  ONLINE	   0	 0	 0
		gptid/551706d3-357b-11e7-850d-00fd45fc03bc  ONLINE	   0	 0	 0
		gptid/5669f636-357b-11e7-850d-00fd45fc03bc  ONLINE	   0	 0	 0

errors: No known data errors


Installation was standard, upgraded from 9.10.2-U4.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
was just wondering that swapinfo is not showing any swap space, as far as I've read FreeNAS should allocate something like 2G of swap for each ZFS vol or similar.

No matter how many disks you have, you will only get a certain amount of swap mirrors created. I have 32 drives in my NAS, but this is the output of swapinfo on my system:
Code:
root@Emily-NAS:~ # swapinfo
Device		  1K-blocks	 Used	Avail Capacity
/dev/mirror/swap1.eli   2097152		0  2097152	 0%
/dev/mirror/swap2.eli   2097152		0  2097152	 0%
/dev/mirror/swap3.eli   1048576		0  1048576	 0%
/dev/mirror/swap4.eli   1048576		0  1048576	 0%
/dev/mirror/swap0.eli   1048576		0  1048576	 0%
Total			 7340032		0  7340032	 0%
root@Emily-NAS:~ #
How did you create the pool in this system?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
If you have enough memory, the system will not use swap, but the partition should still be present.
What made you start looking into this?

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 

eim

Dabbler
Joined
Dec 12, 2016
Messages
28
If you have enough memory, the system will not use swap, but the partition should still be present.
What made you start looking into this?

Sent from my SAMSUNG-SGH-I537 using Tapatalk
8G RAM, not much. Found this while running htop in a jail, then swapinfo.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
8G RAM, not much. Found this while running htop in a jail, then swapinfo.
Is it the jail that is reporting no swap or the base OS?

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 

eim

Dabbler
Joined
Dec 12, 2016
Messages
28
Code:
root@freenas:~ # swapinfo -h
Device		  1K-blocks	 Used	Avail Capacity
 

eim

Dabbler
Joined
Dec 12, 2016
Messages
28
Code:
root@freenas:~ # glabel status
									  Name  Status  Components
gptid/2bca9cb6-3577-11e7-9612-00fd45fc03bc	 N/A  da0p1
gptid/550ac86b-357b-11e7-850d-00fd45fc03bc	 N/A  ada0p1
gptid/551706d3-357b-11e7-850d-00fd45fc03bc	 N/A  ada0p2
gptid/565c81a8-357b-11e7-850d-00fd45fc03bc	 N/A  ada1p1
gptid/5669f636-357b-11e7-850d-00fd45fc03bc	 N/A  ada1p2
gptid/52528137-357b-11e7-850d-00fd45fc03bc	 N/A  ada2p1
gptid/5260cf1f-357b-11e7-850d-00fd45fc03bc	 N/A  ada2p2
gptid/53a92c21-357b-11e7-850d-00fd45fc03bc	 N/A  ada3p1
gptid/53bb4feb-357b-11e7-850d-00fd45fc03bc	 N/A  ada3p2
 

eim

Dabbler
Joined
Dec 12, 2016
Messages
28
Code:
root@freenas:~ # gpart show ada0
=>		34  1953525101  ada0  GPT  (932G)
		  34		  94		- free -  (47K)
		 128	 4194304	 1  freebsd-swap  (2.0G)
	 4194432  1949330696	 2  freebsd-zfs  (930G)
  1953525128		   7		- free -  (3.5K)

root@freenas:~ # gpart show ada1
=>		34  1953525101  ada1  GPT  (932G)
		  34		  94		- free -  (47K)
		 128	 4194304	 1  freebsd-swap  (2.0G)
	 4194432  1949330696	 2  freebsd-zfs  (930G)
  1953525128		   7		- free -  (3.5K)

root@freenas:~ # gpart show ada2
=>		34  1953525101  ada2  GPT  (932G)
		  34		  94		- free -  (47K)
		 128	 4194304	 1  freebsd-swap  (2.0G)
	 4194432  1949330696	 2  freebsd-zfs  (930G)
  1953525128		   7		- free -  (3.5K)

root@freenas:~ # gpart show ada3
=>		34  1953525101  ada3  GPT  (932G)
		  34		  94		- free -  (47K)
		 128	 4194304	 1  freebsd-swap  (2.0G)
	 4194432  1949330696	 2  freebsd-zfs  (930G)
  1953525128		   7		- free -  (3.5K)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
Well, at this point I'm well and truly confused. The swap partitions are obviously there (on all four disks), and they're the expected size, but the OS isn't seeing/using the swap. I don't have another idea other than to file a bug report. I'd suggest using the web GUI to do so (it's at the Support button in the classic GUI), and check the box to attach a debug file.
 

eim

Dabbler
Joined
Dec 12, 2016
Messages
28
Well, at this point I'm well and truly confused. The swap partitions are obviously there (on all four disks), and they're the expected size, but the OS isn't seeing/using the swap. I don't have another idea other than to file a bug report. I'd suggest using the web GUI to do so (it's at the Support button in the classic GUI), and check the box to attach a debug file.
do I need to add something to /etc/fstab maybe?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338
do I need to add something to /etc/fstab maybe?

Editing configuration files by hand is not a wise idea in FreeNAS in general as those files are generated from a configuration database. Maybe your configuration database is corrupt. Does either
System -> Update -> Verify Install
or
System -> Boot -> Scrub Boot
reveal some errors?
 

MrToddsFriends

Documentation Browser
Joined
Jan 12, 2015
Messages
1,338
Next question, partly out of curiosity: @eim, what's the output of dmesg | grep GEOM on your system? For comparison:
Code:
~ # dmesg | grep GEOM
GEOM_RAID5: Module loaded, version 1.3.20140711.62 (rev f91e28e40bf7)
GEOM_MIRROR: Device mirror/swap0 launched (2/2).
GEOM_MIRROR: Device mirror/swap1 launched (2/2).
GEOM_MIRROR: Device mirror/swap2 launched (2/2).
GEOM_ELI: Device mirror/swap0.eli created.
GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI:	 Crypto: hardware
GEOM_ELI: Device mirror/swap1.eli created.
GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI:	 Crypto: hardware
GEOM_ELI: Device mirror/swap2.eli created.
GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI:	 Crypto: hardware
 
Status
Not open for further replies.
Top