LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Setting up Swap memory (https://www.linuxquestions.org/questions/linux-general-1/setting-up-swap-memory-4175537973/)

sriram91 03-27-2015 01:39 AM

Setting up Swap memory
 
Im trying to set up swap memory in linux( after O.S installation) , however it vanishes once the system is rebooted, Can anyone help me out how to make it permanent.

ttk 03-27-2015 02:20 AM

Did you create a swap partition or a swap file?

And if it's a swap file, where did you put it?

Head_on_a_Stick 03-27-2015 03:01 AM

Code:

# mkswap /dev/sdXY
# swapon /dev/sdXY

If you use systemd as your init system the swap partition will be mounted automatically, otherwise you need to add it to /etc/fstab
Code:

/dev/sdXY              none          swap      defaults              0      0
This presumes a swap partition rather than a swap file.

frankbell 03-27-2015 08:42 PM

What precisely do you mean when you say that "it (I presume you mean the contents of the swap partition) vanishes"?

Note that Linux swaps only when it needs to. Unlike Windows, it does not swap just because it can.


All times are GMT -5. The time now is 02:56 PM.