Linux Disable Swap: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Linux =Disabling Swap During Installation= =Disabling Swap After Installation= <pre> swapoff -a </pre>")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=


* [[Linux#Configuration|Linux]]
* [[Linux_Memory_Management#Swap_Operations|Linux Memory Management]]


=Disabling Swap During Installation=
=Disabling Swap During Installation=


=Disabling Swap After Installation=
Do not specify a swap device.
 
=Disabling Swap at Runtime=


<pre>
<pre>
swapoff -a
swapoff -a
</pre>
</pre>
The command disables swapping on the specified device (or on all devices if -a is specified) in kernel.
Note that the command does not modify [[/etc/fstab]] so if there are swap devices mentioned there, swap will be re-enabled upon reboot. In order to prevent the kernel to re-enable swapping, remove the swap devices from /etc/fstab.

Latest revision as of 15:35, 29 June 2017

Internal

Disabling Swap During Installation

Do not specify a swap device.

Disabling Swap at Runtime

swapoff -a

The command disables swapping on the specified device (or on all devices if -a is specified) in kernel.

Note that the command does not modify /etc/fstab so if there are swap devices mentioned there, swap will be re-enabled upon reboot. In order to prevent the kernel to re-enable swapping, remove the swap devices from /etc/fstab.