How do I unmount swap?

AnsisMalins

Cadet
Joined
Mar 26, 2018
Messages
8
I got stuck playing around with my disks.
  1. I plugged in a new disk (ada4)
  2. I created a pool from it (Volume2)
  3. I wrote some data to it
  4. I removed the pool I created (Volume2)
  5. I now want to to replace another disk (ada3) in another pool (Volume1) with the new one (ada4), but FreeNAS won't let me do anything with it.
  6. Replace disk dialog fails with
  7. 1555270497009.png
  8. Running swapoff on the command line fails with "Cannot allocate memory"
How do I regain control of this disk?

Bonus question: how do I know that /dev/mirror/swap1.eli is located on /dev/ada4? Which tool will tell me that?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
So that sounds like there isn't enough memory to swap the contents back into memory.

Without more information, it's hard to tell what's going on. Are you tight on memory (16GB or less)?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,079
Bonus question: how do I know that /dev/mirror/swap1.eli is located on /dev/ada4? Which tool will tell me that?
Swap space is made up of gmirror sets. You can run the command gmirror status -ags from the command line to get a list of devices that are in the mirror sets. It should look something like this:

Code:
root@freenas:~ # gmirror status -ags
    swap0  COMPLETE  ada2p1 (ACTIVE)
    swap0  COMPLETE  ada1p1 (ACTIVE)
swap0.sync       N/A  N/A
    swap1  COMPLETE  da0p1 (ACTIVE)
    swap1  COMPLETE  ada0p1 (ACTIVE)
swap1.sync       N/A  N/A
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,079
How do I regain control of this disk?
From the command line: gmirror stop -fv swap1

I can't guarantee that this will not crash your system if you are using swap space.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,079
Top