# What's devfs?



## jronald (Jan 26, 2009)

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?


----------



## ale (Jan 26, 2009)

Try reading devfs(5)


----------



## jronald (Jan 26, 2009)

Thanks.


----------



## jronald (Jan 26, 2009)

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 (Jan 26, 2009)

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.


----------



## mjguzik (Jan 26, 2009)

I suggest reading /usr/share/doc/papers/devfs.ascii.gz .


----------



## Oko (Jan 27, 2009)

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 (Jan 27, 2009)

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 (Jan 27, 2009)

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.


----------

