You can simply follow the below steps to create a additional swap partition on Linux.
Just create a partition with fdisk
command and change it's partition code for Linux swap partition e.g. 82
.
now use command mkswap drive_name
to create the swap signature, then use swapon drive name
command to activate the swap partition.
For example, to create swap partition type:
mkswap /dev/sdb1
and to activate it
swapon /dev/sdb1
Note : I have mentioned /dev/sdb1
for example purposes, you use the drive as per your scenario.
now mount the created swap partition on /etc/fstab
file.
for testing you can use below commands :-
swapon -s
shows swap usage summary by device
free -m
Display amount of free and used memory in the system
/
, and not temporary files (or log files, or something else)?