Jump to content

Does size matter (for swap)?


dude67
 Share

Recommended Posts

What did you think I meant with the topic title. :P

 

I have a laptop with some 4 gigs of RAM. When installing the system, I didn't think I'd need more then 4 gigs of swap, but now I'm thinking that I may have been wise to reserve the full 8 GB worth of swap (double the size of RAM)... I'm having problem with Suspend to RAM as the system now hangs on me when coming to from Suspend to RAM. It stated something about the swap, but I didn't write it down and I cannot find any such note in the syslogs either.

 

Here's my current disk - is it possible to double the size of swap? If I understand correctly, I cannot resize /home partition from the beginning - or is it possible?

 

 Device Boot Start 	End #cyls	#blocks Id System
/dev/sda1 	0+ 1305- 1306- 10485760 27 Unknown
/dev/sda2 * 1305+ 10881- 9576- 76918780	7 HPFS/NTFS
/dev/sda3 	10882 30400 19519 156786367+ 5 Extended
/dev/sda4 	0 	- 	0 	0	0 Empty
/dev/sda5 	10882+ 12428	1547- 12426246 83 Linux | root
/dev/sda6 	12429+ 12937 	509- 4088511 82 Linux swap / Solaris | swap
/dev/sda7 	12938+ 30400 17463- 140271516 83 Linux | /home

Partitions from sda1 to sda3(4) are for Vista.

Link to comment
Share on other sites

 

Here's my current disk - is it possible to double the size of swap? If I understand correctly, I cannot resize /home partition from the beginning - or is it possible?

 

 

It is possible to resize /home and /swap, you should be careful however and make sure your /home partition has enough free space. Good advice is to make a backup of important data in such cases. I've made most fortunate experience with the GPartEd system. Thus you can create your own boot CD or pen drive, boot off this medium and safely change your system. You can find it here:

 

http://gparted.sourceforge.net/

 

Use the .iso file for creating CDs and the .zip file for an USB drive. Unless you know what you're doing you should stick to the stable version. Then boot gparted from your new medium and make changes. It's quite easy!

 

HTH,

 

scoonma

Link to comment
Share on other sites

As scoonma said gparted can do it but drakdisk cannot.

With drakdisk you could shrink /home and then add a second swap partition after it, Linux has no problem using multiple swap partitions.

Hum, but I don't know if it can suspend to multiple swap partitions. :oops:

 

BTW You don't have 4 gigs of swap, you have 4088511 kilos of swap and 4 gigs is 4194304 kilos.

 

The modern rule of thumb is slightly more swap than ram if you want to use suspend to ram, but not double.

 

Ken

Link to comment
Share on other sites

As scoonma said gparted can do it but drakdisk cannot.

With drakdisk you could shrink /home and then add a second swap partition after it, Linux has no problem using multiple swap partitions.

Hum, but I don't know if it can suspend to multiple swap partitions. :oops:

Yep, thanks Ken, I will give gparted a go as I said. I will use it to resize /home - there should not be anything critically important on that new laptop, but I would hate to mess it up as I would have to do all that installation work again...

 

So if I understand correctly, the system _should_ be OK even if I resize the /home partition (I do have a lot of free space there) from the start (with gparted).

 

BTW You don't have 4 gigs of swap, you have 4088511 kilos of swap and 4 gigs is 4194304 kilos.

 

The modern rule of thumb is slightly more swap than ram if you want to use suspend to ram, but not double.

 

Ken

OK, but how much is 'slightly more' - I realize that I have just a bit less than 4 gigs of swap, but I never calculated it when installing the system. I never really do the partitioning precisely - I just use an estimate (with the Mandriva diskdrake slider)... B) Perhaps I should be more careful in the future :)

Link to comment
Share on other sites

OK, the gparted worked fine. I managed to enlarge swap while keeping it on it's place between / and /home partitions. Now I have some 4.9 gigs swap. :thumbs:

 

But that didn't help with the suspend to RAM problem. Now I get the system kinda freezing in the screensaver screen with the login details. I can type my password there, but when I hit Enter, nothing happens. The images keep changing in the screensaver and I can move my mouse around, but other then that, nothing happens. So something is wrong.

 

On my laptop the physical RAM is 3 GB, and my swap is 3.2 GB. Suspend to RAM (the basic, kernel-based one) is working fine- no need for wsusp or tuxonice.

 

What's that "basic, kernel-based one" Suspend to RAM you mentioned scarecrow?

Link to comment
Share on other sites

My problem is recovering from suspend to RAM (sleep). I get the screensaver, but it won't close the screensaver when I key-in my password. And when I hit Ctrl+Alt+F1 I get the logon: but I cannot get in. I don't even get the part where it says "password". The only way to recover from that is to reboot from power-button. Not good. :huh:

 

I was digging a little deeper... It seems that Mandriva 2009.1 uses pm-utils for sleep and hibernation.

 

I don't know what is causing all these problems, but I think this may be the place to start looking:

/usr/lib/pm-utils/sleep.d/

From here I can see list of utils:

 

-rwxr-xr-x 1 root root 2490 2009-04-16 16:43 00auto-quirk*
-rwxr-xr-x 1 root root 274 2009-04-16 16:43 00logging*
-rwxr-xr-x 1 root root 203 2009-04-16 16:43 00powersave*
-rwxr-xr-x 1 root root 737 2009-04-16 16:43 01bootloader*
-rwxr-xr-x 1 root root 157 2009-04-16 16:43 06mysqld*
-rwxr-xr-x 1 root root 159 2008-12-29 18:53 07anacron*
-rwxr-xr-x 1 root root 391 2009-04-16 16:43 10network*
-rwxr-xr-x 1 root root 2780 2009-04-16 16:43 15sound*
-rwxr-xr-x 1 root root 1941 2009-04-16 16:43 30pcmcia*
-rwxr-xr-x 1 root root 4624 2009-04-16 16:43 40xlock*
-rwxr-xr-x 1 root root 664 2009-04-16 16:43 49bluetooth*
-rwxr-xr-x 1 root root 991 2009-04-16 16:43 55NetworkManager*
-rwxr-xr-x 1 root root 335 2009-04-16 16:43 75modules*
-rwxr-xr-x 1 root root 391 2009-04-16 16:43 90chvt*
-rwxr-xr-x 1 root root 455 2009-04-16 16:43 90clock*
-rwxr-xr-x 1 root root 129 2009-04-16 16:43 91laptop-mode*
-rwxr-xr-x 1 root root 984 2009-04-16 16:43 92disk*
-rwxr-xr-x 1 root root 1098 2009-04-16 16:43 94cpufreq*
-rwxr-xr-x 1 root root 297 2009-04-16 16:43 95led*
-rwxr-xr-x 1 root root 2286 2009-04-16 16:43 98smart-kernel-video*
-rwxr-xr-x 1 root root 5361 2009-04-16 16:43 99video*

I'm now thinking that it's either the video (files 98 or 99) or then wlan (for which I don't seem to have a file here).

Maybe it's the file 10netork that has the info:

 

#!/bin/sh

. "${PM_FUNCTIONS}"


suspend_network() {
stopservice netfs
stopservice nfs
stopservice network
return $?
}

resume_network() {
restartservice network
service network-up start
restartservice nfs
restartservice netfs
return $?
}

case "$1" in
	hibernate|suspend)
	suspend_network
	;;
	thaw|resume)
	resume_network
	;;
	*)
	;;
esac


exit $?

 

But I really have no idea what the problem is...

Link to comment
Share on other sites

Not solved.

 

I tried manually some of the quirks mentioned in here: http://web.archive.o...uspend-try.html (thanks David for the link), but at least the few that I tried didn't work.

I tried e.g. this one, with a little different outcome:

pm-suspend --quirk-vbestate-restore --quirk-s3-bios --quirk-s3-mode

The system came to (I managed to unlock the screen), but I think plasma crashed. At least the desktop items didn't work and the icons on the panel disappeared. One weird thing was that when I typed "mcc" in konsole, the system didn't recognize the command.

 

Had to shut it down from the power button as the Ctrl+Alt+Backsp didn't work and Ctrl+Alt+Del gave me black screen with the text saying something about not beeing able to shutdown (or power down).

 

Seems I cannot use Suspend to RAM on this hardware. If anyone has managed to make that work on ACER ASPIRE 7530 (not 7530G), let me know.

Edited by dude67
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...