Total Pageviews

Translate

September 2, 2015

/dev Importance in linux or rhel7

by 4hathacker  |  in System Administration at  1:21 AM

As you all know linux treating  everything as a File so today we will discuss about devices management in linux based operating system.

Modern linux  is managed by devices and all the distributions are capable of detecting devices running time of os.



Hotplugging  is  achieved in linux distro by using  three most popular components .

1.   udev 
2.   Hal
3.   dbus    

Important: 

Udev:-  create and delete dynamic directory nodes in all linux distribution

              under /dev  directory  when ever you plug or unplug any device.

Dbus:  this is like system bus which is used for interprocess communication

Hal   :  Hal gets information from udev service ,  when devices is connected

             it creates XML representation of  the devices. It then notifies the   current desktop notification application like (nautilus) with the help of Dbus  and nautilus will the open the mount devices for user.

==============
More about Udev:
==============

Udev is the device manager for linux kernel which create and remove devices nodes in  /dev  directory dynamically .  it is the successor of devfs and hotplug  . It  run in user space and user can change devices name using udev rules.

Note: Udev depends on the proc and sys file systems and they must be mounted on /proc and /sys

you can check  from  /etc/fstab  file they must be mounted persistently.
you can find udev rules at /etc/udev/rules.d

===============
More about /dev  
 ===============

1.  /dev/autofs  :-  Normally used in autofs server where 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 distro.

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

these device file are called terminal or console which is generally used in run level 1  , also used for pseudo terminal

3.  /dev/loop  this directory is used for managing  CD/DVM in linux KVM and VMWare os image files.

4.  /dev/randam  and /dev/urandom
    used for generating  random chars for kernel purpose.

5.  /dev/null and /dev/zero

     used for generating empty file and  observing unwanted outputs.

Note:  /dev/zero  is used to create files with no data but it require size (a file filled with Zeros)

dd if=/dev/zero of=/root/abc.txt bs=4096 count=1000

OR 

[root@4hathacker rules.d]# strace  cat  /dev/zero  

6. /dev/ppp 

This file is used to connect your mobile or GPRS/3G enabled devices to connect and communicate with linux based system.

0 comments:

Like Our Facebook Page

Nitin Sharma's DEV Profile
Proudly Designed by 4hathacker.