Saturday, November 26, 2016

Adding a Swap Partition After System Installation

Updating partitions.
We need to edit /etc/fstab and add the new swap partition.

sudo nano /etc/fstab

We need to add a line that looks like

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

The UUID can be got using the command

sudo blkid /dev/sdaX

---------///
We can format this partition with:

sudo mkswap /dev/sdX
replacing the X with your partition number. Mount this partition as swap with

sudo swapon -U UUID

If you want to use your swap for hibernating then you need to update the UUID in
/etc/initramfs-tools/conf.d/resume
with this content RESUME=UUID=xxx.
Don't forget to
sudo update-initramfs -u

-----///