0

I have a ubuntu 16.04 and installed gparted on it and I wonder how I can increase the swap space in my case shown in the below screenshot?enter image description here

Tak
  • 966
  • 3
  • 13
  • 32
  • Does this answer your question? [How to increase swap space?](https://askubuntu.com/questions/178712/how-to-increase-swap-space) – mikewhatever Apr 01 '20 at 19:31
  • @mikewhatever I checked that but as shown in the answer my case is not like any of them as my unallocated space is only 5.63MB https://askubuntu.com/a/389067/304905 – Tak Apr 01 '20 at 19:33
  • Well then, why not create more unallocated space by shrinking one of the partitions? – mikewhatever Apr 01 '20 at 20:20
  • @mikewhatever could you advise me how? – Tak Apr 01 '20 at 20:30
  • There are many good howtos, all you need to do is search. Here is [one](https://askubuntu.com/questions/126153/how-to-resize-partitions/18525#18525). – mikewhatever Apr 01 '20 at 21:13
  • 2
    Does this answer your question? [How to resize partitions?](https://askubuntu.com/questions/126153/how-to-resize-partitions) – user535733 Apr 02 '20 at 00:49

1 Answers1

0

Using swap on SSDs/NVME drives is not recommended, but here's what you can do if you really want more swap space available on your system:

# Replace "n" and /path... accordingly
sudo fallocate -l nG /path/to/swapfile
sudo chmod 0600 /path/to/swapfile
sudo mkswap /path/to/swapfile
sudo swapon /path/to/swapfile
sudo echo '/path/to/swapfile none swap sw 0 0' >> /etc/fstab
BulletBob
  • 1,750
  • 2
  • 7
  • 12