You are not logged in.

#1 2018-11-18 18:46:54

catastropeia
Member
Registered: 2016-12-05
Posts: 10

[SOLVED] Why is my swap space not used?

I just finished installing arch and everything seems to work fine. However, I just realised that my swap space, for which I allocated 16G during the installation process, is not used and I wonder why.

The partition layout of my arch installation (windows dualboot) is

├─sdb5            8:21   0   300G  0 part  
│ └─root        254:0    0   300G  0 crypt 
│   ├─main-root 254:1    0    80G  0 lvm   /
│   ├─main-swap 254:2    0    16G  0 lvm   
│   └─main-home 254:3    0   204G  0 lvm   /home

Running htop shows swap to be of size 0K:

  1  [|||                                                                              2.6%]   5  [||                                                                               1.3%]
  2  [|                                                                                0.7%]   6  [||                                                                               1.3%]
  3  [                                                                                 0.0%]   7  [|                                                                                0.7%]
  4  [|||||||                                                                          7.3%]   8  [                                                                                 0.0%]
  Mem[||||||||||||||||||||                                                      1.90G/15.4G]   Tasks: 44, 312 thr; 1 running
  Swp[                                                                                0K/0K]   Load average: 0.25 0.31 0.32 

I tried

sudo mkswap /dev/mapper/main-swap
sudo swapon /dev/mapper/main-swap

With the result that htop displayed the expected 16G swap space, however after reboot it was back to 0K.

Did I forget something in the installation process? Or is this normal under some circumstances?
Any hint is greatly appreciated.

Last edited by catastropeia (2018-12-02 15:05:46)

Offline

#2 2018-11-18 18:57:42

cloverskull
Member
Registered: 2018-09-30
Posts: 280

Re: [SOLVED] Why is my swap space not used?

Is it in /etc/fstab?

Offline

#3 2018-11-18 19:04:49

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: [SOLVED] Why is my swap space not used?

You have 16G of memory, of which less than 2G is used. Why should swap even come into the picture?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2018-11-18 19:27:00

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Why is my swap space not used?

Why on earth would you want your swap to be used instead of the shedloads of RAM you still have available?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2018-11-18 19:45:46

catastropeia
Member
Registered: 2016-12-05
Posts: 10

Re: [SOLVED] Why is my swap space not used?

Is it in /etc/fstab?

No, it isn't. Can I just run genfstab again?

Last edited by catastropeia (2018-11-19 19:21:23)

Offline

#6 2018-11-18 19:56:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,532
Website

Re: [SOLVED] Why is my swap space not used?

catastropeia wrote:

Can I just run genfstab again?

You can, yes.  But that seems a bit tedious.  All it does is write an fstab file which is just a plain text file: edit it as needed.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2018-11-18 20:20:26

catastropeia
Member
Registered: 2016-12-05
Posts: 10

Re: [SOLVED] Why is my swap space not used?

Thanks - that was it.

Offline

Board footer

Powered by FluxBB