So a couple of months ago I installed, on my computer, dual boot so I could have windows and ubuntu at the same time. I had some struggles because my PC is designed with UEFI support (Model: ASUS VivoBook S15). However I made it work, but I only had 6 Mb for my swap partition! Now my PC sometimes freezes for no reason, and I have to reboot. I think the problem is that partition. Does anyone know how I can extend my swap partition?
2 Answers
Use sudo swapoff /dev/sda6
to stop using it for swapping, then you can resize/move/rearrange the swap partition any way you like.
If you resize the swap partition, or completely recreate it in a different location, you might have to run sudo mkswap /dev/sda<whatever>
on it afterwards, unless GParted already does that for you. Then just edit your /etc/fstab
if necessary (since the UUID of the swap partition will change on mkswap
, or the device name may change if you recreate the swap partition elsewhere), and run sudo swapon -a
to activate it again.

- 96,466
-
I would not try to resize it, there is Microsoft stuff in the way, and it is sure to break. – ctrl-alt-delor Oct 27 '19 at 20:10
Do you use Hibernation? Then you must have a swap partition equal in size to your RAM chip size.
If you don't, boot from Windows of a Linux Live USB and delete /dev/sda6 because 4MB is more trouble than it's worth.
Then. boot back into Linux and create a swap file in your root partition, because your system is guaranteed to be unstable without it. How much? See here.

- 3,816
- 4
- 23
- 39
/etc/fstab
. Details here : https://linuxize.com/post/create-a-linux-swap-file/ – schaiba Oct 27 '19 at 12:57