2

I have bought a new laptop. It came with Ubuntu installed. I have upgraded to 20.04.01 LTS.

In my root there is a really large swapfile, and that takes up a lot of space. It's 137.6 GB and it's last altered on the 11th of september (more than a month ago).

I don't think i need this file, i have 64 GB of ram. Is there a way to reduce the size?

output of free command

total        used        free      shared  buff/cache   available
Mem:       65613160     2528548    60546840       98704     2537772    62259952
Swap:     134217724           0   134217724
  • It is unlikely that you have that big a swap file and 120 GB of RAM in a laptop. It looks very weird. But you can remove or reduce your swap file. What does free command output? – Pilot6 Oct 30 at 14:01
  • sorry, i exaggerated if have 64 gb of ram. I have made an edit to the original message with the output of the free command. Can I safely lower the swap file to, say 8 GB? – CaptainAhab Oct 30 at 15:52
  • You don't need a swap file if you have that much RAM. – Pilot6 Oct 30 at 15:53
  • ok. so can i safely delete the swapfile or do I need to de-register it first somewhere? – CaptainAhab Oct 30 at 16:00
  • Remove it from /etc/fstab. – Pilot6 Oct 30 at 16:09
3

You can remove the swap file totally with this amount of RAM.

Run in a terminal:

sudo swapoff -a
sudo rm /swapfile
sudo nano /etc/fstab

and remove the line with the swap file from there.

| improve this answer | |
  • thnx for this, this really helped – CaptainAhab Oct 30 at 16:20

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.