[Sderby] What does dev mean (/dev/hda1) ?

Dave Voorhis dave at armchair.mb.ca
Sun Oct 31 17:34:20 GMT 2004


On Fri, 2004-10-29 at 17:32, Russ wrote:

> Just a simple daft question, as a total low level new comer to cmd
> line stuff sort of bloke, what does "/dev" mean and do when in a line
> like this - "mount /dev/hda1/ mnt" ?

/dev is a directory that contains the device drivers for your hardware. 
In UNIX and UNIX-like systems, devices (and everything else!) look just
like files.  This allows the real data files and devices (implemented as
virtual files) to be accessed using the same programmatic mechanisms. 
It is a powerful concept, as it allows files and devices to be used
interchangeably in many applications.

> From looking on the net i found this /dev/null - a virtual device, is
> that what /dev is.

You're close.  /dev/null is a virtual device; /dev is a directory full
of virtual devices.  /dev/hda1 refers to the 'hda1' device, which is a
hard disk partition.  It can be accessed just like a file, but you
normally shouldn't do so (and Linux won't let you unless you're root)
unless you're a programmer who wishes to create utilities like 'mount'. 

For most purposes, it's sufficient to know that /dev/hda1 is another way
of saying "Partition 1 on the first IDE hard drive."  /dev/null is
another way of saying "A file to which I can write and automatically
throw away the data without storing it."  /dev/cdrom is another way of
saying "The default CDROM drive", and so on.

Dave...





More information about the Sderby mailing list