DEVFS(4)

πŸ“¦ version 15.1, in freebsd 15.1, nixpkgs unstable

πŸ’… DEVFS(4) β€” device file system

ok so this is devfs(4), straight outta the Kernel Interfaces Manual (that's section 4, bestie, kernel land 🧚). It's the device file system, and honestly? iconic.


✨ NAME ✨

devfs β€” the device file system πŸ’–


🌸 SYNOPSIS 🌸

devfs   /dev    devfs rw 0 0

like, that's the whole vibe. look at it. so simple. so slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: the device file system, aka devfs, gives you access to the kernel's device namespace, right inside the global file system namespace. the conventional mount point is /dev β€” that's the main character location, periodt.

the file system includes several directories, links, symbolic links and devices, some of which can also be written. yes, written πŸ‘€ β€” some of them are writable.

in a chroot'ed environment, devfs(8) can be used to create a new /dev mount point. cute, right?

and if you ever fumble and delete a device entry? no stress β€” the mknod(8) tool can be used to recover deleted device entries under devfs. we love a recovery arc 🫢

now, plot twist: the fdescfs(4) filesystem is an alternate means for populating /dev/fd. the character devices that both devfs and fdescfs(4) present in /dev/fd correspond to the open file descriptors of the process accessing the directory. here's the difference though, and it matters:

  • devfs only creates files for the standard file descriptors 0, 1 and 2.
  • fdescfs(4) creates files for all open descriptors. overachiever πŸ’€

the options are as follows:

  • -o options β€” use the specified mount options, as described in mount(8). and listen, there are some devfs file system-specific options available too:
    • ruleset=ruleset β€” set ruleset number ruleset as the current ruleset for the mount-point and apply all its rules. if the ruleset number ruleset does not exist, an empty ruleset with the number ruleset is created. see devfs(8) for more information on working with devfs rulesets. very demure, very mindful ✨

πŸŽ€ FILES πŸŽ€

  • /dev β€” the normal devfs mount point. the it-girl directory πŸ’…

πŸ”₯ EXAMPLES πŸ”₯

to mount a devfs volume located on /mychroot/dev:

mount -t devfs devfs /mychroot/dev

go off king πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

fdescfs(4), devfs(8), mount(8), make_dev(9)

read them. they're all besties. iykyk 🌈


⭐ HISTORY ⭐

the devfs file system first appeared in FreeBSD 2.0. it became the preferred method for accessing devices in FreeBSD 5.0 and the only method in FreeBSD 6.0 (glow up of the century, no cap πŸ‘‘). the devfs manual page first appeared in FreeBSD 2.2.


🌸 AUTHORS 🌸

the devfs manual page was written by Mike Pritchard <mpp@FreeBSD.org>. legend behaviour, fr fr πŸ’–


ngl bestie that's the whole page β€” every flag, every path, every version, all of it πŸ“

this icon of a page is from the Debian edition, dated June 30, 2022, and lives at DEVFS(4). mwah, go mount something πŸ’‹βœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • nixpkgs unstable: source
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms