Section: Linux System Administrator's Manual (8)
Updated: 1 November 2002
makedev - create devices
makedev <directory> [<device_name>]
is a program that will create the device files in /dev used to interface
with drivers in the kernel.
Note that programs giving the error ``ENOENT: No such file or
directory'' usually means that the device file is missing, whereas
``ENODEV: No such device'' usually means the kernel does not have the
driver configured or loaded.
The directory where to create the device files.
Only create device nodes that match <device_name> (wich can be either
a canonical name or a regexp). eg:
makedev /dev 'dvb.*'
will create /dev/dvb/adapter0/*
makedev /dev hda
will create /dev/hda
Since there is currently no standardization in what names are used for
system users and groups, it is possible that you may need to modify
's configuration files to reflect your site's settings.
- Certain devices are required for minimal functionality. These are:
- access to physical memory;
- access to kernel virtual memory;
- null device (infinite sink);
- access to I/O ports;
- null byte source (infinite source);
- symlink to /proc/kcore (for kernel debugging);
- always returns ENOSPACE on write;
- to access the controlling tty of a process.
- Virtual Terminals
This creates the devices associated with the console. These are the virtual
terminals ttyx, where x can be from 0 though 63. The device
tty0 is the currently active VT, and is also known as console.
For each VT, there are two devices: vcsx and vcsax,
which can be used to generate screen-dumps of the VT (vcsx is just the
text, and vcsax includes the attributes).
- Serial Devices
- Pseudo Terminals
Each possible argument will create a bank of 16 master and slave
pairs. The current kernel (1.2) is limited to 64 such pairs.
The master pseudo-terminals are
and the slaves are
- Parallel Ports
Standard parallel ports. The devices are created
- Bus Mice
The various bus mice devices. This creates the following devices:
(Logitech bus mouse),
(Microsoft Inport bus mouse) and
(ATI XL bus mouse) and
- Joystick Devices
- Disk Devices
Floppy disk devices. The device
is the device which autodetects the format, and the additional devices are
fixed format (whose size is indicated in the name).
The other devices are named as
The single letter
identifies the type of floppy disk (d = 5.25" DD, h = 5.25" HD, D = 3.5"
DD, H = 3.5" HD, E = 3.5" ED). The number
represents the capacity of that format in K. Thus the standard formats
For more information see Alain Knaff's fdutils package.
are floppy disks on the first controller, and devices
are floppy disks on the second controller.
AT hard disks. The device
provides access to the whole disk, with the partitions being
The four primary partitions are
with the logical partitions being numbered from
(A primary partition can be made into an extended partition, which can hold
4 logical partitions).
By default, only the devices for 4 logical partitions are made. The
others can be made by uncommenting them.
Drives hda and hdb are the two on the first controller. If using the new
IDE driver (rather than the old HD driver), then hdc and hdd are the two
drives on the secondary controller. These devices can also be used to
acess IDE CDROMs if using the new IDE driver.
- sd[a-z], sd[a-c][a-z], sdd[a-x]
SCSI hard disks. The partitions are similar to the IDE disks, but there
is a limit of 11 logical partitions
This is to allow there to be 128 SCSI disks.
Loopback disk devices. These allow you to use a regular file as a
block device. This means that images of filesystems can be mounted,
and used as normal. This creates 16 devices loop0 through loop15.
- Tape Devices
SCSI tapes. This creates the rewinding tape device
and the non-rewinding tape device
QIC-80 tapes. The devices created are
Floppy driver tapes (QIC-117). There are 4 methods of access depending on
the floppy tape drive. For each of access methods 0, 1, 2 and 3, the
(non-rewinding) are created. For compatability, devices
are symlinks to
- CDROM Devices
SCSI CD-ROM/DVD drives.
For compatibility reason (aka historical ``compatibility'' with RedHat),
we provide a
entry for each
This creates the audio devices used by the sound driver. These include
Generic SCSI devices. The devices created are
These allow arbitary commands to be sent to any SCSI device. This allows for
querying information about the device, or controlling SCSI devices that
are not one of disk, tape or CDROM (e.g. scanner, CD-R, CD-RW).
To allow an arbitary program to be fed input from file descriptor
as the file name. This also creates
(Note, these are just symlinks into /proc/self/fd).
Devices for power management.
- Other Devices
Note that the present list of devices above is not exhaustive.
more devices nodes. Its aim is to be able to create everything listed in the
devices.txt file distributed with Linux 2.4.
doesn't actually know anything about devices. It reads all of the
information from files stored in /etc/makedev.d.
will read any and all files in the subdirectory, processing lines in them like so:
mode owner group major minor inc count fmt [base]
count devices will be created, with permissions set to mode and
owned by owner and group. The first device will be named fmt,
and additional devices will be created if count is larger than 1.
If fmt contains a C-style formatting string, it will be filled with the
sum of base and zero. Subsequent devices will be filled with the sum of
base and n * inc, where n is the order this device is
being created in. If the format string did not already include a format
specifier, a "%d" will automatically be appended to it to make this work.
- symbolic links
A symbolic link pointing to target named linkname will be created.
Any commands that create devices for alias will also include devices that
would be crated for value.
files contains instructions that instrument
to create the device files in /dev.
need to be run by root in order to work smoothly since
won't work for non privilegied users (basically those who don't have EUID==0).
Usually, any problems we'll find will be confined to the configuration files,
which were written by examining the devices.txt file.
Debian first come with a script building the
devices files (the
RedHat enhanced that idea with the
package. This package was made of two parts :
the first one is a set of config files and script that generate config files.
These files usually reside in /etc/makedev.d/.
the second was MAKEDEV, a program written in C that read the
files to create the actual devices files.
Mandrake further enhanced its predecessors in various ways :
the generator scripts build configuration files that are faster to parse
and to handle
there's a new
perl program that create all devices in a very fast way
The exit code returned by
is either 0 (``no error'') or 255.
In that case, an error message will be displayed:
- ``unrecognized macro MACRO at "LINE"''
didn't recognize the macro
on the quoted line
for further informations about macros)
- ``unrecognised line "LINE"''
failled in parsing the line quoted in
; the line did not begin by a character in the
Pascal Rigaux <firstname.lastname@example.org
Thierry Vignaud <email@example.com
The device database is heavily inspirated by Redhat one.