- add a new device
- partition with fdisk $ sudo fdisk /dev/sdb $ n # create a new partition $ p # primary partition $ # use default startor selector $ # use default end selector $ w # write to disk $ ls /dev/sdb* # show the new partition file
- format as swap $ sudo mkswap /dev/sdb1 $ sudo swapon /dev/sdb1
- edit the fstab config file I. copy the UUID from mkswap command output II. add a new line in /etc/fstab for the new swap mount point. III. reboot.
$ dd if=/dev/zero of=/swapfile bs=1024 count=65536 $ mkswap /swapfile $ swapon /swapfile $ add new mount point to your fstab like '/swapfile swap swap defaults 0 0'