Linux Partition Naming Convention ( IDE Drive Mappings )

Q. I am new to Linux and I not able to understand /dev/hdc (is it C: drive?) under Linux. This is quite confusing for a new Linux user like me. What device naming convention followed by Linux? Can you explain it in layman’s term?

A. Linux does not follows DOS or Windows XP style partition names or drive names. It is true that it is a bit confusing for a new Linux user. Linux use combination of bus and . For example if you are using IDE hard disk or CDROM it is will use HD word. If you are using SCSI interface it will use SD word.

A typical home pc or laptop has 2 or 4 IDE channels as follows:

  • ide0 = primary
  • ide1 = secondary
  • ide2 = tertiary
  • ide3 = quaternary

For example:

  • ide0 = primary master = hda
  • ide1 = primary slave = hdb
  • ide2 = secondary master = hdc
  • ide3 = secondary slave = hdd

and so on…

SCSI devices are listed as devices sda, sdb, sdc, sdd, sde, sdf, and sdg in the /dev directory. Similarly, partitions on these disks can range from 1 to 16 and are also in the /dev directory.

Now each hard drive has 4 primary partitions (limit of PC x86 architecture). First partition is denoted by number 1. For example:

  • First partition : /dev/hda1
  • Second partition : /dev/hda2
  • Third partition : /dev/hda3
  • Fourth partition : /dev/hda4

You can run command fdisk -l to display list of partitions:

WARNING! These examples may result into data loss. Use fdisk command with caution as it manipulate your partition table.

# fdisk -l
Output:

Disk /dev/hda: 20.0 GB, 20060651520 bytes
255 heads, 63 sectors/track, 2438 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1275    10241406   83  W95 FAT32
/dev/hda2            1276        1530     2048287+  82  Linux swap / Solaris

Disk /dev/hdb: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1        2432    19535008+  83  Linux
/dev/hdb2            2433        2554      979965   82  Linux swap / Solaris
/dev/hdb3            2555        6202    29302560   83  Linux
/dev/hdb4            6203        9733    28362757+   5  Extended
/dev/hdb5            6203        9733    28362726   83  Linux

In above output /dev/hda1 is FAT32 partition with Windows XP installed (windows XP/Vista C: ).

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.