LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how can I increase my swap , I can hibernate my computer and thats kinda lame (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-increase-my-swap-i-can-hibernate-my-computer-and-thats-kinda-lame-938483/)

helio 04-06-2012 08:39 AM

how can I increase my swap , I can hibernate my computer and thats kinda lame
 
I just want to know if theres a way for me to increase my swap without having to reinstall Ubuntu .

Antares.Liu 04-06-2012 09:05 AM

Quote:

Originally Posted by helio (Post 4646402)
I just want to know if theres a way for me to increase my swap without having to reinstall Ubuntu .

Yes! First you can use command free to find yhe size of swap using.
then just do the following commands
mkdir swap
cd swap
sudo dd if=/dev/zero of=swapfile bs=1024 count=100000

to create swap file with a size 1024000Byte ( count)
after swap file was created,use sudo mkswap swapfile to convert the file to a swap file.
use sudo swapon swapfile to active the swap file.

TroN-0074 04-06-2012 09:17 AM

Some laptops don't support suspend/hibernating under Linux, this depends on their hardware I guess. But you can You try this.
Quote:

Stop the computer from suspending when the lid is closed
If you don't want the computer to suspend when you close the lid, you can change the settings for that behavior. To set the computer to blank the screen, rather than suspend, when the lid is closed:
Be very careful if you change this setting. Some laptops can overheat if they are left running with the lid closed, especially if they are in a confined place like a backpack.
Open the Terminal application from the Dash.

To change the setting used when running on battery power, type this command and press Enter:
Code:

gsettings set org.gnome.settings-daemon.plugin.power lid-close-battery-action blank
To change the setting used when running on AC power, type this command and press Enter:
Code:

gsettings set org.gnome.settings-daemon.plugin.power lid-close-ac-action blank
There are other settings available besides "blank," such as "nothing," which causes the computer to do nothing.
I copied that from this link https://help.ubuntu.com/11.10/ubuntu...-closelid.html
Good luck to you!

helio 04-06-2012 09:43 AM

Quote:

Originally Posted by Antares.Liu (Post 4646423)
Yes! First you can use command free to find yhe size of swap using.
then just do the following commands
mkdir swap
cd swap
sudo dd if=/dev/zero of=swapfile bs=1024 count=100000

to create swap file with a size 1024000Byte ( count)
after swap file was created,use sudo mkswap swapfile to convert the file to a swap file.
use sudo swapon swapfile to active the swap file.

it was helpfull but I tryed to make a 4 gb swap a make a 400 Mb one the thing is the parametres are in bytes I thought it was int Mb , theres no problem if I repeat the same procedure ??

TroN-0074 04-06-2012 09:58 AM

Increasing your Swap might be a good idea if you dont have sufficient RAM installed in your computer.
But even if you do have a large swap partition or ton of RAM doesn't not ensures your laptop hardware supports hibernation / suspend under Linux due to hardware incompatibilities.

However you can select a different behavior for your PC when you close the lid.

Good luck to you.

helio 04-06-2012 10:00 AM

Quote:

Originally Posted by TroN-0074 (Post 4646468)
Increasing your Swap might be a good idea if you dont have sufficient RAM installed in your computer.
But even if you do have a large swap partition or ton of RAM doesn't not ensures your laptop hardware supports hibernation / suspend under Linux due to hardware incompatibilities.

However you can select a different behavior for your PC when you close the lid.

Good luck to you.

this isn't the problem here , it says that I have not enough swap , and the friend above really help , but I screw doing it cuz I created a file litle and now I don now the comand to undo that

Antares.Liu 04-06-2012 08:01 PM

Quote:

Originally Posted by helio (Post 4646458)
it was helpfull but I tryed to make a 4 gb swap a make a 400 Mb one the thing is the parametres are in bytes I thought it was int Mb , theres no problem if I repeat the same procedure ??

If you "man dd" command, you will find that the number followed count can have a suffix of K,M and G. In you case, you can use "count=4G" or "count=4000M".

Following is what the manual of dd says
BLOCKS and BYTES may be followed by the following multiplicative suffixes: c =1, w =2, b =512, kB
=1000, K =1024, MB =1000*1000, M =1024*1024, xM =M GB =1000*1000*1000, G =1024*1024*1024, and so on
for T, P, E, Z, Y.

syg00 04-06-2012 11:37 PM

That is an awful highlight colour - almost unreadable. Leave it as black, and use [quote] tags instead would be more useful.

To delete the small file, simply
Code:

rm swapfile
Then create it bigger again - it can be any name BTW.


All times are GMT -5. The time now is 10:55 AM.