mkswap: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/sbin/mkswap - from package: util-linux-ng

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/sbin/mkswap - from package: util-linux

You may install the required package with command apt-get install {package}
Error in other languages:
mkswap: bevel nie gevind nie
mkswap: comandă negăsită
mkswap: comando não encontrado
mkswap: commande introuvable
mkswap: command not found
mkswap: käsku ei ole
mkswap: không tìm thấy lệnh
mkswap: komanda nerasta
mkswap: Kommando nicht gefunden.
mkswap: kommandot finns inte
mkswap: komut yok
mkswap: nie znaleziono polecenia
mkswap: níor aimsíodh an t-ordú
mkswap: no se encontró la orden
mkswap: no s'ha trobat l'ordre
mkswap: opdracht niet gevonden
mkswap: parancs nem található
mkswap: perintah tidak ditemukan
mkswap: príkaz nenájdený
mkswap: příkaz nenalezen
mkswap: команда не найдена
mkswap: командата не е открита
mkswap: 命令找不到
mkswap: コマンドが見つかりません