Sunday, December 10, 2017

How do I add swap after system installation?




I did not create a swap partition during Ubuntu installation. Later, I freed up some space and made a swap partition. Now after each boot up, I am manually opening gparted to right-click the swap partition to turn on the 'swapon' option.



How can I automatically enable the swap partition at boot?



Also, if I had not created the swap partition, what are my other options?



You need to edit /etc/fstab and add the new swap partition.



sudo nano /etc/fstab



You need to add a line that looks like



UUID=735b3be3-779c-4d21-a944-b033225f3ab4 none   swap    sw      0       0


and you get the UUID using the command



sudo blkid /dev/sda3



(substitute /dev/sda3 with the appropriate device name).



Related:




No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...