0

How to change swapon

I have Linux at my school and I must go from 1983 to 3007 with swapon. I did that but if I reboot the system it is not saved. how can I save this?

swap space Add a comment
albiejames
asked Jan 08 2019

Answer

0

I assume you mean edit the size of swap from count=1983 towards 3007.
First, swap location:
To discover your swap location, use the command,

#swapon -s

Turn swap off:
Before we can edit our swap file, we have to turn it off. Logical, cause it is in 'use'. You can check how much swap is used by the command,

#free -m

Command to turn swap off:

#sudo swapoff -a

Edit swap size:
Now you able to edit the size, .

Be carefull with commands like these, I advice you to read the manual before blind copying my command.

#sudo dd if=/dev/zero of=/dev/dm-1 bs=1M count=3007

Initialize swap:
mkswap sets up a Linux swap area on a device or in a file.

#sudo mkswap /dev/dm-1

Final, turn swap on:

#sudo swapon /dev/dm-1
Add a comment
linuxhelp
asked Jan 12 2019
edited Jan 12 2019
Post your Answer