Assign unallocated space to swap. I have no swap on disk currently. When I change the unallocated space to a new partition the mount point is not /. so it is not detected in df -h .
-
This makes no sense. If you want to use the space as swap, you need to create a swap partition in it. – fkraiem Nov 12 '17 at 02:30
-
@fkraiem I have seen this type of code to allocate swap memory. sudo fallocate -l 4G /swapfile. Now I have the allocated space in /dev/sda3 and it of size 19.07. How do I assign all of it to the swap. I don't understand the command line. – vishnu Nov 12 '17 at 02:42
2 Answers
I found a solution. Just right-click the partition and format to linux-swap
in GParted. Then right-click again and click "Swapon".
Then you need to edit 2 files.
In
/etc/fstab
, addUUID=4567a897-0845-4fee-816d-9e1cf1954e20 none swap sw 0 0
In
/etc/initramfs-tools/conf.d/resume
, addRESUME=UUID=/etc/initramfs-tools/conf.d/resume
Finally run
update-grub
update-initramfs -u
-
Assuming that the UUID you saw in
sudo blkid
is correct... Your edit of/etc/initramfs-tools/conf.d/resume
is incorrect. It should readRESUME=UUID=4567a897-0845-4fee-816d-9e1cf1954e20
. – heynnema Nov 12 '17 at 14:49
I think you must try LIVE PENDRIVE it's better then using commands. Boot through live Pendrive and then open Gparted it will be there by default, then open it. You will see the Unallocated space. Distinguish it from the rest (it will have separate color). Make swap partition as per your RAM and make sure that you have root(/) partition there(at least 20 Gb for installing heavy software but a minimum of 8 GB is sufficient). If you have some space left then make /home partition too. For selecting swap partition select Logical Partition, Beginning of Space and then from Use As column choose swap from drop down menu. Then OK. If you are installing ubuntu for fresh then make a /boot partition for legacy Bios. If you are dual booting(assuming that you have installed both operating system on same BIOS mode) then leave it as it is. Then done.

- 1