2

My Swap memory shows SWAP critical 0% free on NMS.

I tried:

 `$ swapon --show`

but nothing showed up. I went on to do:

$ free -m
         total        used        free      shared  buff/cache   available
Mem:      7873        2858        1151        1295        3863        3373
Swap:        0           0           0

Then:

$ swapon -a
swapon: /swapfile: insecure permissions 0644, 0600 suggested. 
swapon: /swapfile: read swap header failed
tshepang
  • 64,472
  • 86
  • 223
  • 290
  • 1
    How did you create this swapfile? You can solve the permissions warning with `sudo chmod 600 /swapfile` – Panki Aug 07 '20 at 07:11
  • Hello and welcome to SE ! **1)** if nothing showed following the cmd `swapon --show`, it means you do not have a swap partition. **2)** this is corroborated by the output of `free -m`. **3)** Apparently you (or some process) created a swapfile, whose permissions are `0644` instead of `0600`. Change permissions with: `sudo chmod 600 /swapfile` or whatever the path to the swapfile is. – Cbhihe Aug 07 '20 at 07:21
  • .. and I see that Panki just beat all of us to the permission change instruction. – Cbhihe Aug 07 '20 at 07:22

1 Answers1

7
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
eleventyone
  • 777
  • 3
  • 14