1

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
3
  • 1
    How did you create this swapfile? You can solve the permissions warning with sudo chmod 600 /swapfile
    – Panki
    Aug 7 '20 at 7: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 7 '20 at 7:21
  • .. and I see that Panki just beat all of us to the permission change instruction.
    – Cbhihe
    Aug 7 '20 at 7:22
3
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.