Is it possible to create a directory under /dev?

Kostik Belousov kostikbel at gmail.com
Fri May 23 09:42:24 UTC 2008


On Fri, May 23, 2008 at 09:37:01AM +0300, Andriy Gapon wrote:
> Norberto Meijome <freebsd at meijome.net> wrote:
> >On Thu, 22 May 2008 10:02:08 +0300
> >Andriy Gapon <avg at icyb.net.ua> wrote:
> >
> >>But, by the way, there is a (slightly) more valid reason to want to 
> >>create a directory under /dev, I recently had it. For one non-standard 
> >>third-party application I needed to create a link to existing device in 
> >>a certain subdirectory. I.e.:
> >>/dev/subdirX/device -> /dev/deviceX
> >>And I couldn't do that.
> >>Or maybe link operation for devfs just needs to be taught about creating 
> >>subdirectories on demand. I don't know.
> >
> >you can create links with devfs - man devfs.conf
> >[...]
> >link    This action creates a symbolic link named arg that points to
> >             devname, the name of the device created by devfs(5).
> >[..]
> 
> I do know that.
> Maybe I wasn't clear enough: "/dev/deviceX" was existing device node and 
> I needed to create "/dev/subdirX/device" link, where directory 
> "/dev/subdirX" didn't exist.
> Any help on this?

As an ugly workaround, you may create an directory on ufs filesystem,
populate it with needed symlinks, and then make a symlink /dev/subdirX ->
the directory.

I would prefer not to allow users to create the directories on the devfs.
On the other hand, I like Solaris approach with devfs on /devices and /dev
being populated with short symlinks to ../devices.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20080523/969c41e2/attachment.pgp


More information about the freebsd-stable mailing list