Does LMDE need a swap partition?

Archived topics about LMDE 1 and LMDE 2
Locked
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Does LMDE need a swap partition?

Post by rdonnelly »

Lately my system has been acting weird on resume. It does not do it every time, but when it does the system is very sluggish, and the HD is running constantly. I checked the system monitor showing all processes including root, and nothing is showing high CPU or Memory usage, so it is all in the HD. What would be a good way to isolate this?

Another thing is, my root partition is 9.6 GB, 6.0 GB is being used, could it be getting too tight to properly resume? Does suspend write any info to the root partition?

I also have no swap partition on this machine.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
richyrich

Re: Does LMDE need a swap partition?

Post by richyrich »

If you do not have any swap partition at all, then I recommend that you turn off the swappiness parameter in the kernel.
Swappiness is a value between 0 and 100 which controls the priority of your system using ram vs. swap. A swappiness value of 0 means avoid swap as much as possible and only use ram.
My Mint 9's default was 60 ! which is way too high !, and since I always have a swap partition, I set mine to 10, what a performance improvement !
To check the settings on your machine, use this terminal command :

Code: Select all

cat /proc/sys/vm/swappiness
Now, a little bit of editing from that open terminal :

Code: Select all

sudo nano /etc/sysctl.conf
Add this line, exit, and then reboot :

Code: Select all

vm.swappiness=0
richy
dawgdoc

Re: Does LMDE need a swap partition?

Post by dawgdoc »

Richyrich, I am asking questions to learn, not to start an argument. Would the swappiness settings apply to resuming from suspend? I understand how it works with a computer with a low or large amount of ram. (I think.)

It seems that rdonnelly was referring to Suspend To Ram (suspend/sleep) as opposed to Suspend To Disk (hibernate). Because I would think it would be impossible to Suspend To Disk or to resume from it without either a swap partition or a swap file, known as a page file in windows. By definition, it sounds like a swap partition is not needed for Suspend to Ram, is my assumption correct? Is it possible to have a situation where there is insufficient Ram to recover from suspend? I am sure this would depend on the processes and programs running when the computer is suspended.

In answer to the title of the thread, I have seen posts where others run Mint w/o a swap partition. It is possible to create a swap file without repartitioning, see this post by DrHu and the one following it.
asymmetros

Re: Does LMDE need a swap partition?

Post by asymmetros »

@ richy:

just a question to help me understand: a swappiness value=0, you said that means "avoid swap as much as possible". But if i have the swap line commented into fstab file, that thing doesnt produce the very same result?
After all, catfish command returns 0 as a result.
Secondly, i rarely use as much more than 500 Mb's ram. If i activate the swap partition (and set swapiness=10), this will helps in any way? (i do not care for hibernation, or suspend)
richyrich

Re: Does LMDE need a swap partition?

Post by richyrich »

edit:
My reasoning; the OP has no swap partition, thus there is no need for the kernel to attempt writing swap on the hd to free up ram memory. On my old IBM A31p laptop with Mint 9 Xfce and 1 gig of ram, I rarely have more than 2 or 3 apps running at the same time. I don't need to use/write to the hd swap to free up ram . . . If ram is needed for whatever reason (my swappiness of 10), it will write to swap as it should. My sleep/hibernate uses my swap partition just as it does with the default 60 setting. It just isn't trying to free up ram to the hard drive all the time. On my desktop where I often am multitasking, my swappiness is set to 50.
richy
dawgdoc

Re: Does LMDE need a swap partition?

Post by dawgdoc »

You did not say what type of laptop you are using, so some of this may be of use.

Code: Select all

important bugs of pm-utils (1.4.1-6 -> ) <unfixed>
 #567253 - [pm-utils] screens stay black after resume from pm-suspend on Compal FL90 (GeForce 8600M GT) from tty or X/nv. kernel
 #580080 - acpi-support: suspend to ram results in black screen and need full restart to restore machine
 #607317 - pm-utils: Lenovo T140 fails to resume after toram or todisk
 #491202 - linux-image-2.6.25-2-686: Dell Latitude D610 laptop doesn't resume with 2.6.25
 #561877 - pm-utils: Resume from suspend stopped working on Sony Vaio laptop
 #574054 - pm-utils: Resume from suspend not working on Sony Vaio VGN-NW21SF
 #529378 - pm-utils: Lenovo T61 fails to suspend
 #574814 - pm-utils: system does not switch back to X11 after resume
I found this using apt-listbugs list pm-utils -s all, but you will need to install the apt-listbugs package to have this terminal command available
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

Thanks, I will try and change the swap to zero like you suggested. Being my PC only does the excessive HD activity and lag on a few occasions and most of the time it don't I assume I do not need a swap file for suspend. It seems like it does it most when I am running a Vbox with Windows 7. When I have that running I am using about 2 of my 4 GB or ram according to system resources. When I pause the Vbox, it seems to be less of a problem. I have had the problem just from a suspend occurring with only Firefox and Thunderbird running?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

dawgdoc wrote:You did not say what type of laptop you are using, so some of this may be of use.

Code: Select all

important bugs of pm-utils (1.4.1-6 -> ) <unfixed>
 #567253 - [pm-utils] screens stay black after resume from pm-suspend on Compal FL90 (GeForce 8600M GT) from tty or X/nv. kernel
 #580080 - acpi-support: suspend to ram results in black screen and need full restart to restore machine
 #607317 - pm-utils: Lenovo T140 fails to resume after toram or todisk
 #491202 - linux-image-2.6.25-2-686: Dell Latitude D610 laptop doesn't resume with 2.6.25
 #561877 - pm-utils: Resume from suspend stopped working on Sony Vaio laptop
 #574054 - pm-utils: Resume from suspend not working on Sony Vaio VGN-NW21SF
 #529378 - pm-utils: Lenovo T61 fails to suspend
 #574814 - pm-utils: system does not switch back to X11 after resume
I found this using apt-listbugs list pm-utils -s all, but you will need to install the apt-listbugs package to have this terminal command available
I am using a Lenovo A700 all in one desktop, many of the components are made from notebook parts to keep the machine slim. It could have the T140 or T61 MB in it? I have ATI graphics. I do not need to reboot if it happens, a simple ctrl + alt + backspace logs me out, and the problem goes away.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
dawgdoc

Re: Does LMDE need a swap partition?

Post by dawgdoc »

rdonnelly wrote:Another thing is, my root partition is 9.6 GB, 6.0 GB is being used, could it be getting too tight to properly resume? Does suspend write any info to the root partition?
I don't guess either of us answered the questions you asked. No, your root partition is not to tight for resume purposes because Suspend (to ram) does not write to the hard drive and Hibernate (Suspend to Disk), which you do not seem to be using, is not going to work unless you had either a /swap partition or a swap file. It does not write to the / root partition. If you think the root partition is filling up for unknown reasons, check to see that you are getting excessive log files. They are in /var/log/

Thanks RichyRich for the two links. It would seem that swappiness does not address Suspend issues only swapping pages when actively using the system.

@ rdonnelly It almost sounds like you may have 2 issues. One is the Resume from Suspend and the second is the hard drive activity issue. If you were strictly in a Linux environment, Richyrich's swappiness solution should help. Since you are seeing it most when using Win7 in a VM, I do not know if swappiness will help. VMs were not addressed in the two pages linked to above. I do not know how VMs address memory. Concerns would be total RAM (4Gb), RAM assigned to the VM, the Linux swappiness, and how the Win7 VM addresses its pagefile. Is the 2Gb or 4Gb you reported the total with VM in use or is it the amount assigned to the VM? I am throwing out thoughts to consider, I can not check into it as I have not started using VMs.
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

I see an upadate the acpi-support-base today, it also says installing acpi-support it will help with the functions of laptops. Being my All in one is a hybrid of laptop and PC parts, I installed it. Hopefully this will fix the problem LMDE users are having with resume?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

I have noticed this resume has become more frequent with updates. Also one time I saw a dialog about a script problem come up after I hit CTRL+ALT+BACKSPACE of course it was too late to read it by then.
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
dawgdoc

Re: Does LMDE need a swap partition?

Post by dawgdoc »

Check the LMDE Breakage thread re: the init scripts issue. I seem to recall something about a package named insserv having a bug causing the system to 'barf' with some scripts.

Having looked at your original post again, another thought occurred to me re: your root partition filling up. Every time you update a package, its deb file is placed in /var/cache/apt/archives. The old deb files are not deleted by default. You could run either the more conservative

Code: Select all

sudo apt-get autoclean
or

Code: Select all

sudo apt-get clean
check man apt-get for the exact differences.
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

dawgdoc wrote:Check the LMDE Breakage thread re: the init scripts issue. I seem to recall something about a package named insserv having a bug causing the system to 'barf' with some scripts.

Having looked at your original post again, another thought occurred to me re: your root partition filling up. Every time you update a package, its deb file is placed in /var/cache/apt/archives. The old deb files are not deleted by default. You could run either the more conservative

Code: Select all

sudo apt-get autoclean
or

Code: Select all

sudo apt-get clean
check man apt-get for the exact differences.
Thanks dawgdoc, I gave it a try and it deleted alot of files, it freed up about 1.2GB on my / partition. Now 4.8GB used, and 4.3GB free. I will see how it suspends now. After a reboot. I also removed the insserv package. I was lucky to catch a glimpse of that complaint about a script not be able to run, hopefully this will help. I notice the update manager is not only updating, but adding new packages all the time as well?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

Well removing insserv was a mistake, lucky I had a 10 day old clone of my / partition. I could not get it insserv to install from command line. That Clonezilla is a life saver, only two minutes to restore the partition image :lol:

So do I have to live with insserv even if it causes problems, or was it all the extra files in / causing my problem?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
dawgdoc

Re: Does LMDE need a swap partition?

Post by dawgdoc »

rdonnelly wrote:So do I have to live with insserv even if it causes problems, or was it all the extra files in / causing my problem?
I guess after restoring you cleaned up with apt-get autoclean. Is the resume problem fixed after loading your restore image?
Does the restored image have the newest insserv package or the one from prior to the package being upgraded?

Trial and error may be what tells you the source of the problem.
Restore. Autoclean. Test system. Update system. Test system.
If a full update starts causing the problem again, then update related groups of packages while testing the system between groups of updates.
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

My system is at the same level it was on 4/3/11, and the fortunes and screen savers work. I will not update it for a while if it is working well. I have not had enough suspend resume cycles to know if the old package files were causing the problem, but I will let you know in a day or two. My innserv is version 1.14.0-2.1 installed 3/26. I tried the kernel upgrade 2.6.38-2 and it screwed up my whole system. I back at 2.6.32-5
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
rdonnelly
Level 5
Level 5
Posts: 528
Joined: Thu Nov 27, 2008 9:38 pm

Re: Does LMDE need a swap partition?

Post by rdonnelly »

dawgdoc wrote: Does the restored image have the newest insserv package or the one from prior to the package being upgraded?
Problem still persists on resume, I think it has always been a problem on my hardware ever since I installed LMDE as I remember? I have some older clones, might give one of them a try?
Using Mint since 2008
*Mint 18.2 KDE
*ASUS 970 PRO GAMING/AURA AM3+ AMD 970 + SB 950 SATA 6Gb/s USB 3.1
*AMD FX-8370 with AMD Wraith cooler Vishera 8-Core 4.0 GHz (4.3 GHz Turbo)
*G.SKILL Ripjaws X Series 16GB DDR3 SDRAM
*nVIDIA GEFORCE GT 610 2GB
ivan_rookie

Re: Does LMDE need a swap partition?

Post by ivan_rookie »

richyrich wrote:If you do not have any swap partition at all, then I recommend that you turn off the swappiness parameter in the kernel.
Swappiness is a value between 0 and 100 which controls the priority of your system using ram vs. swap. A swappiness value of 0 means avoid swap as much as possible and only use ram.
My Mint 9's default was 60 ! which is way too high !, and since I always have a swap partition, I set mine to 10, what a performance improvement !
To check the settings on your machine, use this terminal command :

Code: Select all

cat /proc/sys/vm/swappiness
Now, a little bit of editing from that open terminal :

Code: Select all

sudo nano /etc/sysctl.conf
Add this line, exit, and then reboot :

Code: Select all

vm.swappiness=0
richy
Thanks, man. I never had swap, but after I (just in case) set my swappiness to 0 I think I started to feel a bit of a difference in performance and responsiveness (Mint 10 Gnome). Is this possible?
Locked

Return to “LMDE Archive”