1MAKEDEV(8)                 Linux Programmer's Manual                MAKEDEV(8)
2
3
4

NAME

6       MAKEDEV - create devices
7

SYNOPSIS

9       /sbin/MAKEDEV -V
10       /sbin/MAKEDEV  [  -d directory ] [ -D directory ] [ -c configdir ] [ -m
11       maxdevices ] [-a] [-n] [-v] [-i] [-M] [-S] [-u] [-x]  device ...
12

DESCRIPTION

14       MAKEDEV is a program that will create  the  devices  in  /dev  used  to
15       interface with drivers in the kernel.
16
17       Note  that  programs  giving the error ``ENOENT: No such file or direc‐
18       tory''  normally  means  that  the  device  file  is  missing,  whereas
19       ``ENODEV:  No such device'' normally means the kernel does not have the
20       driver configured or loaded.
21

OPTIONS

23       -V     Print out version and exit.
24
25       -a     Always create devices, even if they already exist and  have  the
26              proper permissions and file context.  The default behavior is to
27              only (re-)create device nodes which  appear  to  be  missing  or
28              whose permissions differ from the configured values.
29
30       -m maxdevices
31              Create  no  more  than  the  specified number of devices for any
32              specification in a configuration file.
33
34       -n     Do not actually update the devices, just print the actions  that
35              would be performed.
36
37       -M     Create  symlinks, directories, and sockets belonging to the cur‐
38              rent user, and print out the list of devices which would be cre‐
39              ated in a format which is understood by RPM.
40
41       -S     Do  not actually update the devices, just print the actions that
42              would be performed in a format which can be fed to a shell.
43
44       -d directory
45              Create the devices under directory instead of the default  (usu‐
46              ally /dev).
47
48       -D directory
49              Compute  file  contexts  for device creation as if the directory
50              specified for the -d flag were the specified directory.  This is
51              useful  if  the  -d  flag  is  being used to populate a chrooted
52              device directory.
53
54       -u     Print the ownership and permissions for devices instead of  cre‐
55              ating them.  The information is formatted for use by udev.
56
57       -x     Create exactly the named device.  By default, device names which
58              have the specified device name as the initial portion  of  their
59              name  are also created.  For example, specifying "tty" will also
60              trigger the creation of "tty1", "tty2", and so on.
61
62       -v     Be verbose.  Print out the actions as they are performed.   This
63              is the same output as produced by the -n option.
64
65       -i     Ignore errors parsing configuration files.
66

CUSTOMIZATION

68       Since  there is currently no standardization in what names are used for
69       system users and groups, it is possible that you  may  need  to  modify
70       MAKEDEV's configuration files to reflect your site's settings.
71

DEVICES

73       Certain devices are required for minimal functionality.  These are:
74              mem  -  access  to physical memory; null - null device (infinite
75              sink); port - access to I/O  ports;  zero  -  null  byte  source
76              (infinite  source);  core  -  symlink to /proc/kcore (for kernel
77              debugging); full - always  returns  ENOSPACE  on  write;  ram  -
78              ramdisk; tty - to access the controlling tty of a process.
79
80       Virtual Terminals
81
82       console
83              This creates the devices associated with the console.  These are
84              the virtual terminals ttyx, where x can be  from  0  though  63.
85              The device tty0 is the currently active VT, and is also known as
86              console.  For each VT, there are two devices:  vcsx  and  vcsax,
87              which  can  be  used to generate screen-dumps of the VT (vcsx is
88              just the text, and vcsax includes the attributes).
89
90       Serial Devices
91
92       ttyS{0..63}
93              Serial ports.
94
95       Pseudo Terminals
96
97       pty[p-s]
98              Each possible argument will create a bank of 16 master and slave
99              pairs.   The  current  kernel (1.2) is limited to 64 such pairs.
100              The master pseudo-terminals are pty[p-s][0-9a-f], and the slaves
101              are tty[p-s][0-9a-f].
102
103       Parallel Ports
104
105       lp     Standard  parallel ports.  The devices are created lp0, lp1, and
106              lp2.
107
108       Bus Mice
109
110       busmice
111              The various  bus  mice  devices.   This  creates  the  following
112              devices:  logimouse  (Logitech  bus  mouse), psmouse (PS/2-style
113              mouse), msmouse (Microsoft Inport bus mouse) and  atimouse  (ATI
114              XL bus mouse) and jmouse (J-mouse).
115
116       Joystick Devices
117
118       js     Joystick.  Creates js0 and js1.
119
120       Disk Devices
121
122       fd[0-7]
123              Floppy disk devices.  The device fdx is the device which autode‐
124              tects the format, and the additional devices  are  fixed  format
125              (whose  size  is  indicated in the name).  The other devices are
126              named as fdxLn.  The single letter  L  identifies  the  type  of
127              floppy  disk  (d = 5.25" DD, h = 5.25" HD, D = 3.5" DD, H = 3.5"
128              HD, E = 3.5" ED).  The number n represents the capacity of  that
129              format  in  K.  Thus the standard formats are fdxd360, fdxh1200,
130              fdxD720, fdxH1440, and fdxE2880.
131
132              For more information see Alain Knaff's fdutils package.
133
134              Devices fd0* through fd3* are floppy disks  on  the  first  con‐
135              troller,  and  devices fd4* through fd7* are floppy disks on the
136              second controller.
137
138       hd[a-d]
139              AT hard disks.  The device hdx  provides  access  to  the  whole
140              disk,  with  the  partitions  being hdx[0-20].  The four primary
141              partitions are hdx1 through hdx4, with  the  logical  partitions
142              being numbered from hdx5 though hdx20.  (A primary partition can
143              be made into an extended partition, which  can  hold  4  logical
144              partitions).   By default, only the devices for 4 logical parti‐
145              tions are made.  The others can be made by uncommenting them.
146
147              Drives hda and hdb are the two  on  the  first  controller.   If
148              using  the  new IDE driver (rather than the old HD driver), then
149              hdc and hdd are the two  drives  on  the  secondary  controller.
150              These  devices can also be used to acess IDE CDROMs if using the
151              new IDE driver.
152
153       xd[a-d]
154              XT hard disks.  Partitions are the same as IDE disks.
155
156       sd[a-z], sd[a-c][a-z], sdd[a-x]
157              SCSI hard disks.  The partitions are similar to the  IDE  disks,
158              but  there  is  a  limit  of 11 logical partitions (sdx5 through
159              sdx15).  This is to allow there to be 128 SCSI disks.
160
161       loop   Loopback disk devices.  These allow you to use a regular file as
162              a  block  device.   This means that images of filesystems can be
163              mounted, and used as normal.   This  creates  16  devices  loop0
164              through loop15.
165
166       Tape Devices
167
168       st[0-7]
169              SCSI  tapes.  This creates the rewinding tape device stx and the
170              non-rewinding tape device nstx.
171
172       qic    QIC-80 tapes.  The devices created are rmt8, rmt16, tape-d,  and
173              tape-reset.
174
175       ftape  Floppy  driver  tapes  (QIC-117).  There are 4 methods of access
176              depending on the floppy tape drive.  For each of access  methods
177              0,  1,  2  and  3,  the devices rftx (rewinding) and nrftx (non-
178              rewinding) are created.  For compatability,  devices  ftape  and
179              nftape are symlinks to rft0 and nrft0 respectively.
180
181       CDROM Devices
182
183       scd[0-7]
184              SCSI CD players.
185
186       sonycd Sony CDU-31A CD player.
187
188       mcd    Mitsumi CD player.
189
190       cdu535 Sony CDU-535 CD player.
191
192       lmscd  LMS/Philips CD player.
193
194       sbpcd{,1,2,3}
195              Sound Blaster CD player.  The kernel is capable of supporting 16
196              CDROMs, each of which is accessed as sbpcd[0-9a-f].   These  are
197              assigned  in groups of 4 to each controller.  sbpcd is a symlink
198              to sbpcd0.
199
200       Scanner
201
202       logiscan
203              Logitech ScanMan32 & ScanMan 256.
204
205       m105scan
206              Mustek M105 Handscanner.
207
208       ac4096 A4Tek Color Handscanner.
209
210       Audio
211
212       sound  This creates the audio devices used by the sound driver.   These
213              include mixer, sequencer, dsp, and audio.
214
215       Miscellaneous
216
217       sg     Generic  SCSI  devices.  The devices created are sga through sgh
218              and sg0 through sg7.  These allow arbitary commands to  be  sent
219              to  any SCSI device.  This allows for querying information about
220              the device, or controlling SCSI devices  that  are  not  one  of
221              disk, tape or CDROM (e.g. scanner, CD-R, CD-RW).
222
223       fd     To  allow an arbitary program to be fed input from file descrip‐
224              tor x, use /dev/fd/x  as  the  file  name.   This  also  creates
225              /dev/stdin, /dev/stdout, and /dev/stderr.  (Note, these are just
226              symlinks into /proc/self/fd).
227
228       ibcs2  Devices (and symlinks) needed by the IBCS2 emulation.
229
230       apm    Devices for power management.
231
232       Network Devices
233              Linux used to have  devices  in  /dev  for  controlling  network
234              devices,  but  that  is no longer the case.  To see what network
235              devices are known by the kernel, look in /proc/net/dev.
236
237       Other Devices
238              Note that the list of devices above is not exhaustive.   MAKEDEV
239              can  create more devices nodes.  Its aim is to be able to create
240              everything listed in the devices.txt file distributed with Linux
241              2.4.
242
243

CONFIGURATION

245       MAKEDEV  doesn't actually know anything about devices.  It reads all of
246       the information from files stored in /etc/makedev.d.  MAKEDEV will read
247       any  and  all  files in the subdirectory, skipping over subdirectories,
248       symbolic links, and device nodes, processing lines in  the  files  like
249       so:
250
251       devices
252              [b|c] mode owner group major minor inc count fmt [base]
253              count  devices will be created, with permissions set to mode and
254              owned by owner and group.  The first device will be  named  fmt,
255              and  additional  devices will be created if count is larger than
256              1.  If fmt contains a C-style  formatting  string,  it  will  be
257              filled  with  the sum of base and zero.  Subsequent devices will
258              be filled with the sum of base and n * inc, where n is the order
259              this  device  is being created in.  If the format string did not
260              already include a format specifier, a "%d" will automatically be
261              appended to it to make this work.
262
263       symbolic links
264              l linkname target
265              A  symbolic  link pointing to target named linkname will be cre‐
266              ated.
267
268       aliases
269              a alias value
270              Any commands that create devices for  alias  will  also  include
271              devices that would be crated for value.
272
273       macros
274              =macro expansion
275              Indicates  a  macro  which can be referenced as $macro in subse‐
276              quent configuration statements.
277
278

CONFIGURATION CONFLICTS

280       In the event that the set  of  configuration  files  contains  multiple
281       rules  for  a given device name, MAKEDEV will use all of them.  The end
282       result is typically that the last rule given (either by virtue of being
283       listed  below  all  other  matching rules in the same file, or by being
284       listed in a file which is read after all others which contain alternate
285       rules)  will  apply.   MAKEDEV  reads the set of configuration files in
286       sorted order, so this misfeature can be exploited dependably.
287
288

SEE ALSO

290       Linux   Allocated   Devices,    maintained    by    Torben    Mathiasen
291       <device@lanana.org>.
292

BUGS

294       Let's  hope  not.  If we're lucky, any problems we'll find will be con‐
295       fined to the configuration files, which were written by  examining  the
296       devices.txt   file.   If  your  system  uses  udev,  conflicts  between
297       devices.txt and the in-kernel data which udev uses for  naming  devices
298       may  crop  up.  If you find any bugs, please file them in the bug data‐
299       base at http://bugzilla.redhat.com/ against the "MAKEDEV" component.
300

AUTHOR

302       Nalin Dahyabhai, based largely  on  work  done  by  Nick  Holloway  and
303       Michael K. Johnson.
304
305
306
307Linux                            26 June 2001                       MAKEDEV(8)
Impressum