Swap Causes System Crash on Drive Failure?

Status
Not open for further replies.

jstillwa

Cadet
Joined
Jan 24, 2013
Messages
1
So this thread (http://forums.freenas.org/showthread.php?6254-Replacing-Hard-Disk-swap-partition-question) seems to indicate that the default use of 2GB, or what have you, swap partition on the system will cause the system to crash in the event of the drive failure. This seems to be the cause for our system, as our system has been crashing/freezing on drive failures and that does not seem the default behavior as reported on the forum. Is it the actual case that the default method of FreeNAS of striping swap across the drives in the system means that if one of those drives fail, the system can't potentially can't access the swap space and dies?
 

tingo

Contributor
Joined
Nov 5, 2011
Messages
137
You can easily test if that hypothesis is true; simply turn off swap for the suspected drive and see if the situation improves.
I don't know if you can do this from the GUI, I always use the command line for such things.
Use the swapinfo command to see what partitions are used, like this:
Code:
tingo@kg-f5$ swapinfo -h
Device          1K-blocks     Used    Avail Capacity
/dev/ada0p1       2097152       0B     2.0G     0%
/dev/ada1p1       2097152       0B     2.0G     0%
/dev/ada2p1       2097152       0B     2.0G     0%
/dev/ada3p1       2097152       0B     2.0G     0%
/dev/ada4p1       2097152       0B     2.0G     0%
/dev/ada5p1       2097152       0B     2.0G     0%
Total            12582912       0B      12G     0%

You can turn off a device with swapoff, like this
Code:
[root@kg-f5] ~# swapoff /dev/ada4p1

and turn it on again with swapon:
Code:
[root@kg-f5] ~# swapon /dev/ada4p1

Note that you need to be root to turn on / off a swap partition.
 
Status
Not open for further replies.
Top