1

I wanted to increase the swap memory from 900Mb to 4Gb and i created a swap file using this guide

i haven't made it permanent yet but wanted to ask that when i typed the following command i got this

$ sudo swapon -s
Filename                Type        Size    Used    Priority
/dev/sda5                               partition   998396  136192  -2
/swapfile                               file        4194300 0   -3

two different swap memories is this ok or should i merge it. If we have to merge, how to merge it?

Thomas Ward
  • 74,764
  • If my answer was helpful, please remember to accept it by clicking the checkmark icon just to the left of my answer. Thanks! – heynnema Nov 04 '19 at 02:44

2 Answers2

0

A solution, The basic steps to take:

  1. Turn off the existing swap space.
  2. Create a new swap partition of the desired size. By merging your to old swap for exemple (any disk management tool)
  3. Reread the partition table.
  4. Configure the partition as swap space.
  5. Add the new partition/etc/fstab.
  6. Turn on swap.
Pascal Fares
  • 749
  • 5
  • 8
  • What do they do if they can't create a new swap partition, because their disk is fully allocated already? – heynnema Nov 01 '19 at 15:31
0

Yes, you can have more than one swap partition or swapfile.

No, you don't need to have two, like your current setup.

No, you don't merge them.

In your case, just disable the /dev/sda5 swap partition, and use the /swapfile that you've created.

Edit your /etc/fstab with sudo -H gedit /etc/fstab.

Find the existing line that looks something like one of the following...

UUID=071f8b0e-8e16-4f4d-90ff-a4ae9cc56e2b  none  swap       sw       0       0

/dev/sda5 none swap sw 0 0

Place a "#" character in front of the line to disable it.

If you don't already have it, add a new line for your /swapfile...

/swapfile   none swap    sw 0 0

Then reboot.

heynnema
  • 70,711