Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

swap memory

Help for Current Versions of MX
Post Reply
Message
Author
User avatar
Krissharm
Forum Novice
Forum  Novice
Posts: 92
Joined: Mon Feb 26, 2018 7:53 pm

swap memory

#1 Post by Krissharm » Mon May 14, 2018 1:31 pm

Hi All

I have been continuing to enjoy mx17. And in an effort to 'improve' my setup, I had a play with disabling the swap space. Not that big a deal, I have 12GB of RAM and i dont think the swap has ever been used. So I thought... as a learning idea, I had a go at turning off my swap with the
sudo swap -a
this worked fine, so I then edited fstab like so
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

This however has created a little problem. The laptop now waits a long time to boot. I assume it it looking for a drive that is no longer there.
Can anyone provide any help? Or stop tinkering you fool, kind of advice?

For info

System: Host: x220 Kernel: 4.13.0-1-amd64 x86_64 bits: 64 Desktop: Xfce 4.12.3
Distro: MX-17.1_x64 Horizon December 15, 2017
Machine: Type: Laptop System: LENOVO product: 4291F52 v: ThinkPad X220 serial: N/A
Mobo: LENOVO model: 4291F52 serial: N/A UEFI [Legacy]: LENOVO v: 8DET73WW (1.43 )
date: 10/12/2016
Battery: ID-1: BAT0 charge: 88.6 Wh condition: 90.7/93.2 Wh (97%)
CPU: Topology: Dual Core model: Intel Core i5-2520M bits: 64 type: MT MCP
L2 cache: 3072 KiB
Speed: 2467 MHz min/max: 800/3200 MHz Core speeds (MHz): 1: 2467 2: 798 3: 797 4: 797
Graphics: Card-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915
v: kernel
Display: x11 server: X.Org 1.19.2 driver: modesetting unloaded: fbdev,vesa
resolution: 1366x768~60Hz
OpenGL: renderer: Mesa DRI Intel Sandybridge Mobile v: 3.3 Mesa 13.0.6
Audio: Card-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel
Sound Server: ALSA v: k4.13.0-1-amd64
Network: Card-1: Intel 82579LM Gigabit Network Connection driver: e1000e
IF: eth0 state: down mac: f0:de:f1:9c:21:55
Card-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi
IF: wlan0 state: up mac: 08:11:96:83:d7:84
Drives: HDD Total Size: 471.36 GiB used: 36.62 GiB (7.8%)
ID-1: /dev/sda model: Samsung_SSD_850 size: 232.89 GiB
ID-2: /dev/sdb model: SAMSUNG_SSD_PM84 size: 238.47 GiB
Partition: ID-1: / size: 226.23 GiB used: 36.50 GiB (16.1%) fs: ext4 dev: /dev/sda1
Sensors: System Temperatures: cpu: 42.0 C mobo: N/A
Fan Speeds (RPM): cpu: 1985
Repos: Active apt repos in: /etc/apt/sources.list.d/antix.list
1: deb http://nl.mxrepo.com/antix/stretch stretch main
Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
1: deb http://ftp.uk.debian.org/debian/ stretch-updates main contrib non-free
Active apt repos in: /etc/apt/sources.list.d/debian.list
1: deb http://ftp.uk.debian.org/debian/ stretch main contrib non-free
2: deb http://security.debian.org/ stretch/updates main contrib non-free
Active apt repos in: /etc/apt/sources.list.d/mx.list
1: deb http://nl.mxrepo.com/mx/repo/ stretch main non-free
No active apt repos in: /etc/apt/sources.list.d/various.list
Info: Processes: 231 Uptime: 10m Memory: 11.52 GiB used: 783.4 MiB (6.6%) Shell: init
inxi: 3.0.06
Primary HP Omen 15-ax009na, i5-6300HQ+NVIDIA GTX 950 Running MX17 64 bit.
Secondary Thinkpad x220 12GB ssd msata & ssd sata drive MX17 64 bit
Light child duties Thinkpad R51 MX17/Windows XP 32bit with forcepae and IDE to SATA + Kingston SSD.

User avatar
dolphin_oracle
Forum Veteran
Forum Veteran
Posts: 9296
Joined: Sun Dec 16, 2007 1:17 pm

Re: swap memory

#2 Post by dolphin_oracle » Mon May 14, 2018 1:38 pm

yes, its looking for a resume device for hibernate.

with your swap disabled, try

Code: Select all

sudo update-initramfs -u
then reboot.

If that doesn't work, you may need to edit a file. details are in this post:

viewtopic.php?p=446600#p446600

then run the

Code: Select all

sudo update-initramfs -u
again.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad T530 - MX-17
lenovo s21e & 100s - antiX-17, MX17(live-usb)
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
chrispop99
Forum Guide
Forum Guide
Posts: 2366
Joined: Tue Jan 27, 2009 3:07 pm

Re: swap memory

#3 Post by chrispop99 » Mon May 14, 2018 1:48 pm

It depends what you are trying to achieve, but you could also change the value of 'swappiness'; this will make the OS stop using swap so much.

The default Linux value of 60 is based on server use. If you have 4GB RAM, then 10 is more sensible, and with an SSD I have always set it to 1, which in practical terms means it will never swap.

Chris
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

User avatar
Krissharm
Forum Novice
Forum  Novice
Posts: 92
Joined: Mon Feb 26, 2018 7:53 pm

Re: swap memory

#4 Post by Krissharm » Mon May 14, 2018 2:23 pm

Hi Both
thanks for your quick responses! Hopefully after all this time I have actually made a help post that has enough information for people to know what i'm rattling on about!!
Anyway, not entirely sure what the command does dolphin, but I trusted that you haven't sent me sudo rm /* so I have ran it, and rebooted.

Its still waiting for something, but its much faster, thank you so much for that.

Chris, perhaps your idea would have been the better setting so go for in first place? I have an SSD too an I didn't want excessive writes when the RAM isn't even used. Just reducing it might have been less dramatic. But its done now.

Thanks both so much, this is why linux and especially MX are great, its the people. :toast: :toast:
Primary HP Omen 15-ax009na, i5-6300HQ+NVIDIA GTX 950 Running MX17 64 bit.
Secondary Thinkpad x220 12GB ssd msata & ssd sata drive MX17 64 bit
Light child duties Thinkpad R51 MX17/Windows XP 32bit with forcepae and IDE to SATA + Kingston SSD.

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1453
Joined: Wed Apr 11, 2018 5:09 pm

Re: swap memory

#5 Post by fehlix » Mon May 14, 2018 4:56 pm

Krissharm wrote:
Mon May 14, 2018 2:23 pm
Anyway, not entirely sure what the command does dolphin, ...
Well, the initrd (the initial ramdisk loaded into memory), which D_O helped you with to rebuild,
does include at build-time the knowledge about current swap-partiton.
When you boot, the first stage is with initrd to find the swap-partion,
just in case it will be needed!
As initrd might not know that you have removed it tries hard and finaly timed out!
After freshly rebuilding the initrd, whithout a swap partion it might be happy to boot quickly :happy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1453
Joined: Wed Apr 11, 2018 5:09 pm

Re: swap memory

#6 Post by fehlix » Mon May 14, 2018 5:20 pm

I further thought about doing some good for your ssd might be to replace your unneeded swap-partition as an unallocated space for over-provisioning.
I know that ssd-manufactures sometimes state that they do have already taken into account some space for over-provisioning internally. But if you read carefully the manualls you‘ll find that it is always good to have some over-provisioning space left on the ssd.
This will become more important if you fill up your ssd.
I do always have about 5-8% space left on my ssd‘s.
If you don‘t do that the internal read-write of the ssd to re-shuffle ssd-blocks will become larger compared to your effective amount of written data, which will than reduce the life-time of the ssd.
A further consideration might be to review the currently setup of weekly trim-operations.
I do always change from weekly to daily or even prefer just after boot as I don‘t want to get trim running during normal operations time. :fox:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
djmclaws
Forum Novice
Forum  Novice
Posts: 30
Joined: Sun Nov 15, 2009 6:09 pm

Re: swap memory

#7 Post by djmclaws » Mon May 14, 2018 5:42 pm

You probably already know this......but just in case, you can check your swappiness by:

Code: Select all

cat /proc/sys/vm/swappiness
If you want to reduce it, just edit the "vm.swappiness=60" in your /etc/sysctl.conf file to whatever lower number you like. I always change mine to 10.

Cheers

User avatar
Krissharm
Forum Novice
Forum  Novice
Posts: 92
Joined: Mon Feb 26, 2018 7:53 pm

Re: swap memory

#8 Post by Krissharm » Tue May 15, 2018 10:50 am

fehlix wrote:
Mon May 14, 2018 4:56 pm
Krissharm wrote:
Mon May 14, 2018 2:23 pm
Anyway, not entirely sure what the command does dolphin, ...
Well, the initrd (the initial ramdisk loaded into memory), which D_O helped you with to rebuild,
does include at build-time the knowledge about current swap-partiton.
When you boot, the first stage is with initrd to find the swap-partion,
just in case it will be needed!
As initrd might not know that you have removed it tries hard and finaly timed out!
After freshly rebuilding the initrd, whithout a swap partion it might be happy to boot quickly :happy:
Brilliant - Thank you for the break down. Some times these things are obvious, other times you can melt your brain reading man pages and trying to apply it. That makes a lot of sense.
Primary HP Omen 15-ax009na, i5-6300HQ+NVIDIA GTX 950 Running MX17 64 bit.
Secondary Thinkpad x220 12GB ssd msata & ssd sata drive MX17 64 bit
Light child duties Thinkpad R51 MX17/Windows XP 32bit with forcepae and IDE to SATA + Kingston SSD.

Post Reply

Return to “MX Help”