xref: /freebsd/share/man/man4/devfs.4 (revision 95eb4b873b6a8b527c5bd78d7191975dfca38998)
1.\" Copyright (c) 1996
2.\"	Mike Pritchard <mpp@FreeBSD.org>.  All rights reserved.
3.\"
4.\" Copyright (c) 1992, 1993, 1994
5.\"	The Regents of the University of California.  All rights reserved.
6.\" All rights reserved.
7.\"
8.\" This code is derived from software donated to Berkeley by
9.\" Jan-Simon Pendry.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\" 3. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.Dd June 30, 2022
36.Dt DEVFS 4
37.Os
38.Sh NAME
39.Nm devfs
40.Nd device file system
41.Sh SYNOPSIS
42.Bd -literal
43devfs	/dev	devfs rw 0 0
44.Ed
45.Sh DESCRIPTION
46The device file system, or
47.Nm ,
48provides access to kernel's device
49namespace in the global file system namespace.
50The conventional mount point is
51.Pa /dev .
52.Pp
53The file system includes several directories, links, symbolic links
54and devices, some of which can also be written.
55In a chroot'ed
56environment,
57.Xr devfs 8
58can be used to create a new
59.Pa /dev
60mount point.
61.Pp
62The
63.Xr mknod 8
64tool can be used to recover deleted device entries under
65.Nm .
66.Pp
67The
68.Xr fdescfs 4
69filesystem is an alternate means for populating
70.Pa /dev/fd .
71The character devices that both
72.Nm
73and
74.Xr fdescfs 4
75present in
76.Pa /dev/fd
77correspond to the open file descriptors of the process
78accessing the directory.
79.Nm
80only creates files for the standard file descriptors
81.Pa 0 ,
82.Pa 1
83and
84.Pa 2 .
85.Xr fdescfs 4
86creates files for all open descriptors.
87.Pp
88The options are as follows:
89.Bl -tag -width indent
90.It Fl o Ar options
91Use the specified mount
92.Ar options ,
93as described in
94.Xr mount 8 .
95The following devfs file system-specific options are available:
96.Bl -tag -width indent
97.It Cm ruleset Ns No = Ns Ar ruleset
98Set ruleset number
99.Ar ruleset
100as the current ruleset for the mount-point and apply all its rules.
101If the ruleset number
102.Ar ruleset
103does not exist, an empty ruleset with the number
104.Ar ruleset
105is created.
106See
107.Xr devfs 8
108for more information on working with devfs rulesets.
109.El
110.El
111.Sh FILES
112.Bl -tag -width /dev/XXXX -compact
113.It Pa /dev
114The normal
115.Nm
116mount point.
117.El
118.Sh EXAMPLES
119To mount a
120.Nm
121volume located on
122.Pa /mychroot/dev :
123.Pp
124.Dl "mount -t devfs devfs /mychroot/dev"
125.Sh SEE ALSO
126.Xr fdescfs 4 ,
127.Xr devfs 8 ,
128.Xr mount 8 ,
129.Xr make_dev 9
130.Sh HISTORY
131The
132.Nm
133file system first appeared in
134.Fx 2.0 .
135It became the preferred method for accessing devices in
136.Fx 5.0
137and the only method in
138.Fx 6.0 .
139The
140.Nm
141manual page first appeared in
142.Fx 2.2 .
143.Sh AUTHORS
144The
145.Nm
146manual page was written by
147.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
148