EmbLogic's Blog

/dev directory

The /dev directory contains the special device files for all the devices. The device files are created during installation, and later with the /dev/MAKEDEV script. The /dev/MAKEDEV.local is a script written by the system administrator that creates local-only device files or links (i.e. those that are not part of the standard MAKEDEV, such as device files for some non-standard device driver).All hardware files are present in /dev(Device ) folder. If we observe the /dev folder you can find files/folders related to different hardware’s present in the machine.Below are some hardware files and their uses and explanation.

1. /dev/alarm

This is a hardware file used to keep track of time when system goes hibernation or suspended when it is idle. When your system goes hibernation most of your hardware will be shutdown, HDD rotation is reduced to as low as possible in order to save power. This file is very much useful to keep track of system time, to do calender updates to user etc. You can say in other words that /dev/alarm will have current time status. This file is used in portable devices such as laptops and mobiles mostly.

2. /dev/autofs

This file is used to mount remote directories locally. This is done automatically when user tries to login by mounting remote directory. The mounting is done by using this hardware file. With out this hardware file we can not do automount in a Linux box.

3. /dev/block folder

This folder is legacy location for your block devices. This is still existing to support legacy applications.

4. /dev/cdrom, /dev/dvd, /dev/cdrw, /dev/dvd-rw etc

These files corresponds to Compact-Disk(/dev/cdrom or /dev/cdrw) hardware or to Digital Versatile Disk(/dev/dvd or /dev/dvd-rw) hardware. These files are required to mount your local CDrom and DVD’s so that you can access the content of the file.

5. /dev/char

This is the folder where char files are located in legacy machines. This is still kept to support legacy applications.

6. /dev/console, /dev/tty, /dev/tty1 to /dev/tty63, /dev/ttyS, /dev/ttyS0 to /dev/ttyS31 files and /dev/pts folder

These device files are called as terminals or consoles which are char files used for communication between user and system. /dev/console file is used in Runlevel1 1 and none of these terminals are available for access on runlevel 1. tty(Teletype) is a device file to do remote connection so that we can work remotely The name is derived from typewriters which are default communicating devices in early stages of Computers. The terminals range from tty0 to tty63 and serial port terminals(ttys or ttyS) are from 0 to 31.

7. /dev/loop(/dev/loop0 to /dev/loop7)

A loop device is a Pseudo device useful for mounting Virtual CD(ISO files), HDD etc. The loop devices are useful for mounting already formatted drive and access the data in a folder mounted on different filesystem. Virtual devices are nothing but a hardware file created by kernel/OS so that we can use them as a physical drives. These loop devices are also used by virtual softwares such as KVM, VMWARE to mount CD-ROM’s, HDD(.img files for example) as physical devices in your Virtual machine.

8. /dev/sda, /dev/hda etc

These files corresponding to hard disks and storage devices such as USB hard disks, SATA disks and External HDD’s. For Intel machines you may find /dev/hda, /dev/hdb, /dev/hdc, /dev/hdd corresponds to Primary master, Primary slave, Secondary master and Secondary Slave devices. Partitions with in disks are created as /dev/sda1, sda2 etc and so on.

9. /dev/random and /dev/urandom

Used for generating random chars for Kernel purpose.

10. /dev/null and /dev/zero

Used for generating empty files, observing unwanted outputs etc.

11. /dev/ppp

This file is used to connect your mobile or GPRS/3G enabled devices to connect and communicate. This is pseudo file which communicates with GPRS enabled hardware file to send data.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>