Jump to content

Mount options for Swap


Recommended Posts


Most documentation, nearly all I saw, says to have your /etc/fstab entry for swap look like this


UUID=somebigstring none swap defaults 0 0

and if you let most installers build your fstab for you it will look like that.


A few places have documentation for swap that says to leave it blank except if you need to alter priority, say if you have swap on multiple disks.


And yet others list mount options for Swap as "sw". With no listing of what flags are included when "sw" is used.


I was wondering about it this week and this is what struck me.

The "defaults" mount option = rw,suid,dev,exec,auto,nouser,async .

Those mount options seem odd for the swap space.


rw = read,write

OK, we need this for Swap.


suid = set user id

Why does this need to be available on Swap?

I don't think it does.


dev = Interpret character or block special devices on the filesystem.

Why does this need to be set on Swap?


exec = permit execution of binaries

We do not need this in Swap.


auto = can be mounted with the -a option

I don't think we need this for Swap.


nouser = forbid ordinary users from mounting the filesystem

OK, we need this for Swap.


async = all I/O done asynchronously

I don't think that is how Swap should work.

It is supposed to be used to get things out of RAM, quickly,



Anyone have opinions about this or links to explanations of what mount options to use and why?

Link to comment
Share on other sites


This is why UUID (Blkid) is better than using a /dev/ option:

The advantage of using the UUID is that it is independent from the actual device number the operating system gives your hard disk. Image you add another hard disk to the system, and for some reason the OS decides that your old disk is now sdb instead of sba. Your boot process would be screwed up if fstab would point to the device name. However, in case of the UUIDs, it would be fine.


Basically drive letters can change but the UUID value will never change

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...