What's devfs?

jronald

Active Member

Reaction score: 10
Messages: 195

After install, I run df,
it shows an extra filesystem as below:
Filesystem 1K-blocks Used ...
...
devfs 1 1
...


It seems a fragment:)? Is it useful?
 
OP
jronald

jronald

Active Member

Reaction score: 10
Messages: 195

I read it, but can't understand it, not enough concept.
I think I need to learn some basic concepts first.
Thanks all the same.
 

ale

Daemon

Reaction score: 169
Messages: 1,059

Briefly, on Unix systems a device (hd, soundcard, etc.) is seen as a special file and you can find them in /dev. This is for example to have a uniform way to do I/O operations.
devfs manages that filesystem for you, dynamically creating the files and assigning permissions.
 

Oko

Daemon

Reaction score: 797
Messages: 1,620

ale said:
devfs manages that filesystem for you, dynamically creating the files and assigning permissions.
That is a FreeBSD specific file and it doesn't exist in OpenBSD and NetBSD.
 

Djn

Well-Known Member

Reaction score: 67
Messages: 392

Given which forum we're on, there's an implicit "unless otherwise stated, advice given might only apply to FreeBSD"-disclaimer in effect. ;)


To stay on topic, devfs isn't the only way to handle device files. The traditional solution is to use actual files in a normal file system, with a special type marking them as devices. This was somewhat annoying, since you risked both having files not corresponding to devices (leading to serious clutter) and devices without corresponding files (which meant you had to create them).
 

mjguzik

Member

Reaction score: 7
Messages: 36

ale said:
devfs manages that filesystem for you, dynamically creating the files and assigning permissions.

Oko said:
That is a FreeBSD specific file and it doesn't exist in OpenBSD and NetBSD.

Maybe I misunderstood you, but:
AFAIR NetBSD nor OpenBSD doesn't have devfs. If by 'FreeBSD specific' file you mean devctl, I must say that it contains information about already created/destroyed nodes (and a bit more). FreeBSD's devd has different role than Linux's udev (devfs was removed from Linux in 2.6.18).

Or maybe you wanted to write 'That is a FreeBSD specific filesystem', then it's ok. ;)
 
Top