Device file

A device file is an interface for a device driver that appears in a filesystem as if it were an ordinary file. They allow software to interact with a device driver. The files are in the directory.

Installation
To manage device files, by default, udev is used, which will take care of any installation of said files.

Alternatives to udev:


 * eudev
 * mdev
 * static-dev

Creation
For each device (internal or peripheral devices) there is a device file. During kernel boot time the kernel detects the devices and creates a device file in the virtual devtmpfs filesystem. Afterwards udev takes over the device files and restores them in. From this point on udev is in charge to create new and to delete unavailable device files.

Permissions
Like other files access to device file is restricted by filesystem permissions. The permission to access a device file have to be granted first to an user:
 * Add the user to the group the device file belongs to.
 * Setup ConsoleKit to grant access to some device files (e.g. sound device files) to the user of the active, local session.

Symlinks
udev creates for some device classes additional symlinks. The device file (first CDROM drive) and  (first DVD drive) are just symlinks to the device file  (first optical drive). You can use the symlinks in programs and config files like every other device file. Other examples are for input devices or  for storage devices.

UUIDs and labels
Normally your storage devices are identified by their device file, e.g. . Alternatively you use instead their UUID (Universally Unique Identifier) or label. In comparision to device files UUIDs and labels are persistent and will never change because of asynchronous detection. The UUID is generated automatically during filesystem creation. The label can be specified at filesystem creation or changed afterwards.

Use blkid (part of ) to show all storage devices and their UUIDs and labels: