HDDs, Floppies, & CDROMs.


Unlike other OS's Linux doesn't have, or use physical drive letters, as you will have already noticed (change directory to the root directory & list the contents (cd / [ENTER], ls -l [ENTER])). You don't have your good old c:, d:, even the floppy is gone. Linux uses another method to administer physical drives. These drives exist as devices (hardware components) in the background of a Linux system. Take the simple example of a Linux machine with one IDE HDD, divided into 3 partitions. These 3 partitions are the default setup for a Suse installation. The first partition is the boot partition, the second the swap, & the third the / or root directory. The partitions & the "physical" drive itself are separate devices & are to be found in the /dev directory. The "physical" drive has the label hda (Hard Drive a), & the partitions are labelled 1, 2, & 3, i.e. hda1, hda2, & hda3. The floppy (presuming you have only one) has the device name fd0, & the CD-ROM is called..... wait for it.... yep cdrom :o). Try typing in df -h (Disk Free -h (human readable numbers)) & you will see all the devices (drives) that are "mounted" & how much space is free on those drives. If you take the above example you can only see hda3, the other partitions are hidden. The term "mount" refers to plugging the drive into the directory tree. It took me a while to get my head around this "mounting" concept, but it's very practical, have a look at the following example.

Let's say that you add a second HDD to your system, & there are very good reasons that there should be a second HDD in your Linux machine. As I said before hda2 is our swap partition, this partition is used to store all the data waiting to be processed or being processed, a cache if you like. Having this swap partition on the same HDD as the rest of the system can cause the system to slow down when it comes to a "datajam". Having "swap" on another HDD would speed your machine & make it more stable. A very sensible decision. By the way the second HDD is called hdb, & the same as before partitions 1,2,.....

Another very important point to consider when it comes to a Linux server are the log files in the /var directory. What would happen if you only had one HDD in your machine & the whole of the directory tree is on hda3, & we left the server running & didn't check it from time to time, & a serious problem occurred? It could happen that the log files get soooooo big that they fill up the whole partition & then nothing would work anymore, the server would grind to a halt, even a simple login may not be possible due to the fact that there is no space to carry out the command. It's a very good idea to mount this /var directory onto another partition, better still onto another HDD. I think you can slowly see that a Linux system is very versatile, flexible, & most of all very powerful.



back a page    back to main index    forward a page
copyright 2001 Rob Hawke.
rob@highasakite.net