GNU/Linux uses a logical method for naming partitions. First, when numbering the partitions, it ignores the file-system type of each partition that you may have. Second, it names the partitions according to the disk on which they are located. This is how the disks are named:
• the primary master and primary slave IDE devices (whether they be hard disks, CD-ROM drives or anything else) are called /dev/hda and /dev/hdb respectively;
• on the secondary interface, the master is called /dev/hdc and the slave is /dev/hdd
• if your computer contains other IDE interfaces (for example, the IDE interface present on some Soundblaster cards), the disks will be called /dev/hde, /dev/hdf, etc. You may also have additional IDE interfaces if you have RAID cards or RAID chips on your motherboard.
• SCSI disks are called /dev/sda, /dev/sdb, etc., in the order of their appearance on the SCSI chain (depending on the increasing IDs). The SCSI CD-ROM drives are called /dev/scd0, /dev/scdl, always in the order of their appearance on the SCSI chain.
The partitions are named after the disk on which they are found, in the following way (in the example, we have used the case of partitions on a primary master IDE disk):
• the primary (or extended) partitions are named /dev/hdal through /dev/hda4 when present;
• logical partitions, if any, are named /dev/hda5, /dev/hda6, etc. in their order of appearance in the table of logical partitions.
So GNU/Linux will name the partitions as follows:
Slave IDE pri raaiy dis (/dev/hdbj Figure 2-1. First Example of Partition Naming under GNU/Linux
Primary slave IDE hard disk (/dev/hdb) Figure 2-2. Second Example of Partition Naming under GNU/Linux
With this knowledge in hand, you should be able to name the various partitions and hard disks when you need to manipulate them. You will also see that GNU/Linux names the partitions even if it does not know how to manage them initially (it ignores the fact that they are not native GNU/Linux partitions).
For current 2.4 kernels, Mandrake Linux uses the Linux DevFS (Device File System) (http://www.atnf.csiro.au/~rgooch/ linux/docs/devfs.html). This system ensures full compatibility with the scheme described above, but this compatibility may disappear in the future. Each device is dynamically added to the system as soon as it becomes available or needed.
For example, the first IDE hard drive now becomes: [[email protected] root]# ls -l /dev/hda lr-xr-xr-x 1 root root 32 Sep 2 17:14 /dev/hda
Was this article helpful?