34

I have noticed the following option in the kernel: CONFIG_DEVTMPFS

Device Drivers -> Generic Driver Options -> Maintain devtmpfs to mount at /dev

And I see that it is enabled by default in the Debian distribution kernel 3.2.0-4-amd64

I am trying to understand what difference this option brings. Without this option, /dev is mounted as tmpfs , with this option, it is mounted as devtmpfs. Other than that, I don't see any difference.

The help did not clarify it for me either:

This creates a tmpfs/ramfs filesystem instance early at bootup. In this filesystem, the kernel driver core maintains device nodes with their default names and permissions for all registered devices with an assigned major/minor number.

It provides a fully functional /dev directory, where usually udev runs on top, managing permissions and adding meaningful symlinks.

In very limited environments, it may provide a sufficient functional /dev without any further help. It also allows simple rescue systems, and reliably handles dynamic major/minor numbers.

Could somebody please explain the difference between using CONFIG_DEVTMPFS vs the standard /dev?

Neo_Returns
  • 529
  • 3
  • 14
user1968963
  • 3,973
  • 13
  • 37
  • 56

1 Answers1

34

devtmpfs is a file system with automated device nodes populated by the kernel. This means you don't have to have udev running nor to create a static /dev layout with additional, unneeded and not present device nodes. Instead the kernel populates the appropriate information based on the known devices.

On the other hand the standard /dev handling requires either udev, an additional daemon running or to statically create device nodes on /dev.

Ulrich Dangel
  • 25,079
  • 3
  • 80
  • 80
  • 2
    Does it really mean, I don't need udev? The help says `It provides a fully functional /dev directory, where usually udev runs on top, managing permissions and adding meaningful symlinks`. If kernel populates `/dev`, what is there left to do for `udev` ? – user1968963 Jun 02 '13 at 09:23
  • 4
    In most circumstances you need `udev`. Directly from your quote, udev handles `managing permissions and adding meaningful symlinks` as well as running external scripts, notifying desktop environments etc. – Ulrich Dangel Jun 02 '13 at 09:30
  • So does that mean it's better to use devtmpfs instead of tmpfs for `/dev`? – CMCDragonkai Jun 05 '14 at 09:11
  • 1
    @CMCDragonkai yes, but your distribution should take care of that anyway – Ulrich Dangel Jun 18 '14 at 12:41