1

Ubuntu 16.04 I created a swap file using:

sudo mkdir -v /var/cache/swap
cd /var/cache/swap
sudo dd if=/dev/zero of=swapfile bs=1K count=4M
sudo chmod 600 swapfile


sudo mkswap swapfile
sudo swapon swapfile
echo "/var/cache/swap/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab

After rebooting, i tested using

sudo swapoff swapfile
sudo swapon -va

Everything at this point seems to be fine. But after I ran ecrypt following the instruction here on the home folder, trying

sudo swapoff swapfile
swapoff: swapfile: swapoff failed: No such file or directory

Also, when I do:

sudo swapon -va
swapon: cannot open /dev/mapper/cryptswap1: No such file or directory

At this point, I'm attempting to just remove this swapfile that I just created. I tried to stop it by going straight to /var/cache/swap and try swapoff:

/var/cache/swap$ sudo swapoff swapfile
swapoff: swapfile: swapoff failed: Invalid argument

Why the invalid argument? I just want to know if it's safe to just manually remove the manually-created swap directory without swapoff, and then make an encrypted swapfile. Thanks.

PopHpl
  • 11

0 Answers0