You should add it to /etc/fstab so it's mounted automatically:
Code:
sudo cp /etc/fstab /etc/fstab-backup
echo "UUID=$(sudo blkid -o value -s UUID /dev/sda3) none swap sw 0 0" | sudo tee --append /etc/fstab
Or you can manually edit it yourself. The above commands
1. backup the /etc/fstab file in case you make a mistake, and
2. append a line that adds your swap.
It will end up looking like this in /etc/fstab:
UUID=xxxx-xxxx-xxxx-xxxx none swap sw 0 0
(where xxx-xxx is the UUID of /dev/sda3)
Breakdown of the command:
"echo" outputs a "" string to standard output (screen)
Inside that string "sudo blkid" extracts the UUID of your swap partition
"|" pipes the output to tee
"tee --append" will append the output to the end of the /etc/fstab file
The blkid command and the tee command require root privileges (hence the use of sudo)
Bookmarks