Why can't I mount a swap partition?
Check if swap partition is set up correctly
Execute the command sudo fdisk -l
. This will list all your partitions and their partition types. In Ubuntu, a swap partition will be listed similar to below:
/dev/sdb4 7295 8268 7811072 82 Linux swap / Solaris
If you don't see the last 2 values 82
and Linux Swap
, then it is not setup as swap partition.
Setup a swap partition
Ensure that the partition you are going to use (such as /dev/sdb4) is not a real partition with real data before turning it in to swap partition since all your data will be lost.
The following steps will set up a swap partition:
sudo swapoff -a
Replace /dev/sdb4 with the correct partition name if different:
sudo /sbin/mkswap /dev/sdb4
Enable the swap partition you just set up:
sudo swapon -a
For detailed help, refer to https://help.ubuntu.com/community/SwapFaq
Simple: you don't have an sdb4 partition! Your swap appears to be on /dev/mapper/cryptswap1. It looks like you setup cryptswap, so you need to fix your fstab to point to the new swap partition, preferably by UUID, not by device name.