2

I'm wondering about the effects of setting the nodev option for / mount in /etc/fstab.

As I understand it, nodev prevents the interpretation of special nodes, so you can prevent rogue users or attackers mounting and using their own device nodes to wreck havoc on the system.

My first thought was that mounting / with nodev would render /dev completely useless and prevent the system from starting up properly because no devices (including the partitions mounted on /home and /usr) could be used.

So, imagine my surprise when I tested it out on an Ubuntu installation and everything appeared to work as normal. /dev/zero and /dev/null did what they were supposed to. I didn't have other device nodes that I could do anything with, such as sockets, but not that I know what to do with them anyway.


  1. Can anyone explain what happened, and why the installation continued to work?

  2. Does the system implicity ignore stupid things like mounting / with nodev? For that matter, is the handling consistent across different distributions or kernels?

  3. And back to the original question: Are there actually (ill) effects that I did not manage to observe/trigger?

1

If you issue the mount command, (or cat /etc/mtab), you'll see that /dev is its own file system, separate from /:

...
udev on /dev type devtmpfs (rw,mode=0755)
...

On my drive, I don't seem to have any device files on my root file system. I looked for them with:

sudo find / -xdev -type b -o -type c

Mounting this file system with nodev would therefore have no noticeable effect.

  • Thank you for the insight on /dev and the suggestion to find non-standard files. I was able to test the setting on a Red Hat system, and while find did turn up named pipes and sockets on /, the system appeared to start up and work just fine. – aerobot Apr 2 '16 at 17:22
-1

Well, I think you have a wrong view how those things work together. The installation continued to work, because the meaning of the nodev property is to send the message to not threat as a device any new created device on the managed partition.

The /dev directory discovers the devices based on the udev daemon. The rules how it will represent the devices in dev could be find in /lib/udev/rules.d as each file has a postfix with .rules.

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.