I am having problems trying to mount a swap file for use. Every time I use this command to mount (with /var/swap being the file):

$ sudo mount /var/swap

I keep getting this message:

mount: mount point none does not exist

This is the swap entry in my /etc/fstab:

UUID=84c3776d-3f52-4b86-b0c6-4f5c2c776d94  none  swap  sw  0   0

Swap isn't mounted like a filesystem, you need to use swapon:

swapon -a

will use all the swap defined in /etc/fstab.

You can specify a specific file or partition to add instead:

swapon swapfile

will add the swap file swapfile.

  • Thanks for the answer Stephen, I will just add the command to my startup script. – Bring Back DOS Oct 18 '16 at 16:01
  • If swap is listed in your fstab you shouldn't need to add a "swapon" command to get it working. If you just type "swapon" (no options), it should show you your current swap partition(s), if any. – Lee-Man Oct 18 '16 at 16:03
  • Yes, in the same way as other partitions, anything present in /etc/fstab is used at boot; running swapon is only useful if you add swap to /etc/fstab without rebooting. – Stephen Kitt Oct 18 '16 at 16:08
  • Actually I could not get it to mount at boot either. – Bring Back DOS Oct 18 '16 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.