]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/mknod/mknod.8
This commit was generated by cvs2svn to compensate for changes in r138583,
[FreeBSD/FreeBSD.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 29, 2003
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 c | Cm b
41 .Ar major minor
42 .Op Ar owner : Ns Ar group
43 .Sh DESCRIPTION
44 The
45 .Nm
46 utility creates device special files.
47 To make nodes manually, the four required arguments are:
48 .Pp
49 .Bl -tag -width indent
50 .It Ar name
51 Device name, for example
52 .Dq sd
53 for a SCSI disk on an HP300 or a
54 .Dq pty
55 for pseudo-terminals.
56 .It Cm b | Cm c
57 Type of device.
58 If the
59 device is a block type device such as a tape or disk drive which needs
60 both cooked and raw special files,
61 the type is
62 .Cm b .
63 All other devices are character type devices, such as terminal
64 and pseudo devices, and are type
65 .Cm c .
66 .It Ar major
67 The major device number is an integer number which tells the kernel
68 which device driver entry point to use.
69 To learn what
70 major device number to use for a particular device, check
71 .Pa /usr/src/sys/conf/majors .
72 .It Ar minor
73 The minor device number tells the kernel which subunit
74 the node corresponds to on the device; for example,
75 a subunit may be a file system partition
76 or a tty line.
77 .It Ar owner : Ns Ar group
78 The
79 .Ar owner
80 .Ar group
81 operand pair is optional, however, if one is specified, they both must be
82 specified.
83 The
84 .Ar owner
85 may be either a numeric user ID or a user name.
86 If a user name is also a numeric user ID, the operand is used as a
87 user name.
88 The
89 .Ar group
90 may be either a numeric group ID or a group name.
91 Similar to the user name,
92 if a group name is also a numeric group ID, the operand is used as a
93 group name.
94 .El
95 .Pp
96 Major and minor device numbers can be given in any format acceptable to
97 .Xr strtoul 3 ,
98 so that a leading
99 .Ql 0x
100 indicates a hexadecimal number, and a leading
101 .Ql 0
102 will cause the number to be interpreted as octal.
103 .Pp
104 The
105 .Nm
106 utility can be used to recreate deleted device nodes under a
107 .Xr devfs 5
108 mount point by invoking it using dummy arguments.
109 Example:
110 .Pp
111 .Dl "mknod cd0 c 0 0"
112 .Pp
113 where
114 .Dq Li cd0
115 is the name of the deleted device node.
116 .Sh COMPATIBILITY
117 The
118 .Xr chown 8 Ns - Ns
119 like functionality is specific to
120 .Fx .
121 .Sh SEE ALSO
122 .Xr mkfifo 1 ,
123 .Xr mknod 2 ,
124 .Xr chown 8
125 .Sh HISTORY
126 A
127 .Nm
128 utility appeared in
129 .At v6 .