Linux.com

Swaps file -Is it possible to change?

Link to this post 28 Dec 10

Hi,

I can not put my laptop to Hibernate as the error message is 'not enough swap'

My laptop has 1.2 Gb RAM and the /proc/swap file shows me it has
Filename Type Size Used Priority
/dev/sda6 partition 596988 0 -1

I would like to extend the size of the swap partition.
However I have read that I need to add an extra partition or file.

As the swap file can be edited, the question is:
- Can I change the value in the swap file to RAM*2 without having to add a new swap partition?

Thank you!

Link to this post 28 Dec 10

The output of /proc/swap is only showing what is available, you cannot change it that way. You must delete/make a new swap partition or extend the current partition. It is also possible to create a parsing file in a partition and set it as swap, but that may have a negative effect on the performance.

Link to this post 29 Dec 10

Hi mfillpot,

Thank you for your kind and quick reply.

Link to this post 02 Jan 11

Also, see the "swapon" command.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board