]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sbin/mknod/mknod.8
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sbin / mknod / mknod.8
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)mknod.8     8.2 (Berkeley) 12/11/93
29 .\" $FreeBSD$
30 .\"
31 .Dd December 15, 2004
32 .Dt MKNOD 8
33 .Os
34 .Sh NAME
35 .Nm mknod
36 .Nd build special file
37 .Sh SYNOPSIS
38 .Nm
39 .Ar name
40 .Op Cm b | c
41 .Ar major minor
42 .Op Ar owner : Ns Ar group
43 .Sh DESCRIPTION
44 .Bf -symbolic
45 The
46 .Nm
47 utility is deprecated on modern
48 .Fx
49 systems.
50 .Ef
51 .Pp
52 The
53 .Nm
54 utility creates device special files.
55 To make nodes manually, the four required arguments are:
56 .Pp
57 .Bl -tag -width indent
58 .It Ar name
59 Device name, for example
60 .Dq sd
61 for a SCSI disk on an HP300 or a
62 .Dq pty
63 for pseudo-terminals.
64 .It Cm b | c
65 Type of device.
66 If the
67 device is a block type device such as a tape or disk drive which needs
68 both cooked and raw special files,
69 the type is
70 .Cm b .
71 All other devices are character type devices, such as terminal
72 and pseudo devices, and are type
73 .Cm c .
74 .It Ar major
75 The major device number is an integer number which tells the kernel
76 which device driver entry point to use.
77 To learn what
78 major device number to use for a particular device, check
79 .Pa /usr/src/sys/conf/majors .
80 .It Ar minor
81 The minor device number tells the kernel which subunit
82 the node corresponds to on the device; for example,
83 a subunit may be a file system partition
84 or a tty line.
85 .It Ar owner : Ns Ar group
86 The
87 .Ar owner
88 .Ar group
89 operand pair is optional, however, if one is specified, they both must be
90 specified.
91 The
92 .Ar owner
93 may be either a numeric user ID or a user name.
94 If a user name is also a numeric user ID, the operand is used as a
95 user name.
96 The
97 .Ar group
98 may be either a numeric group ID or a group name.
99 Similar to the user name,
100 if a group name is also a numeric group ID, the operand is used as a
101 group name.
102 .El
103 .Pp
104 Major and minor device numbers can be given in any format acceptable to
105 .Xr strtoul 3 ,
106 so that a leading
107 .Ql 0x
108 indicates a hexadecimal number, and a leading
109 .Ql 0
110 will cause the number to be interpreted as octal.
111 .Pp
112 The
113 .Nm
114 utility can be used to recreate deleted device nodes under a
115 .Xr devfs 5
116 mount point by invoking it using dummy arguments.
117 Example:
118 .Pp
119 .Dl "mknod cd0 c 0 0"
120 .Pp
121 where
122 .Dq Li cd0
123 is the name of the deleted device node.
124 .Sh COMPATIBILITY
125 The
126 .Xr chown 8 Ns - Ns
127 like functionality is specific to
128 .Fx .
129 .Pp
130 As of
131 .Fx 4.0 ,
132 block devices were deprecated in favour of character
133 devices.
134 As of
135 .Fx 5.0 ,
136 device nodes are managed by the device file system
137 .Xr devfs 5 ,
138 making the
139 .Nm
140 utility superfluous.
141 As of
142 .Fx 6.0
143 device nodes may be created in regular file systems but such
144 nodes cannot be used to access devices.
145 .Sh SEE ALSO
146 .Xr mkfifo 1 ,
147 .Xr mknod 2 ,
148 .Xr devfs 5 ,
149 .Xr chown 8
150 .Sh HISTORY
151 A
152 .Nm
153 utility appeared in
154 .At v6 .