Edits and cleanup.
1 parent 9814b44 commit 991be3b014f408e4740cd94088161276154faa71
@tundra tundra authored on 31 Oct 2013
Showing 1 changed file
View
30
Deconstructing_Linux_udev_Rules.rst
 
Original ``Unix`` derivatives had a static tree of devices the system
could support. This was encoded in the ``/dev`` file tree hierarchy.
This was pretty inflexible in the face of devices being added- and
removed- from the system as it ran. For this reason, modern device
removed from the system as it ran. For this reason, modern device
handling in ``Linux`` and most other ``Unix`` derivatives is
*dynamic* - the content of ``/dev`` changes to reflect the actual
state of the system as things get connected or disconnected. (Exactly
how this is done is outside the purpose of this document, but if you
care, investigate the ``Linux /sys`` filesystem works.)
care, investigate how the ``Linux /sys`` filesystem works.)
 
 
Our Example Problem
===================
 
While the example below is "cooked", it is very much rooted in real
world ``udev`` application. We want to do the following things:
world ``udev`` applications. We want to do the following things:
 
- Make sure that a particular disk always shows up under the same
name under ``/dev`` no matter how many disks have been connected
before it. We do that by uniquely identifying a disk and then
creating a symbolic link to it that never changes.
- Identify a specific disk no matter what name it was assigned
name under ``/dev``.
 
- Create a symbolic link to that disk so that - no matter
what it's name under ``/dev/`` might be at the moment -
the symbolic link is always the same.
 
- Change the user and group ownership of that disk to something
other than the default of ``root:disk``.
other than the default (``root:disk``).
 
- Create a corresponding "raw" character device under ``/dev/raw``.
This is something you commonly see on database servers and
it's suffiently useful that's it's worth mentioning here.
- Create a corresponding "raw" character device under ``/dev/raw``
associated with our disk above. This is something commonly
seen on database servers and it's suffiently useful that's it's
worth mentioning here.
 
 
Where Do ``udev`` Rules Live?
=============================
 
Document Revision Information
=============================
 
``$Id: Deconstructing_Linux_udev_Rules.rst,v 1.102 2013/10/31 21:45:08 tundra Exp $``
``$Id: Deconstructing_Linux_udev_Rules.rst,v 1.103 2013/10/31 21:50:07 tundra Exp $``
 
You can find the latest version of this document at:
 
http://www.tundraware.com/TechnicalNotes/Deconstructing-Linux-udev-Rules