Difference between sda and hda in Linux

Do you understand what is the difference between /dev/hda and /dev/sda in Linux? In order to understand that, you need to understand how the drives are named in Linux operating system.

This is very important to know how Linux names its drive. If you understand the naming convention of drives under Linux, you would easily figure out if the drive is IDE or SCSI.
IDE convention is - /dev/hdx# : Where x stands for drive and # stands for partition number that the distribution is on. The # would be 1 if there is only one partition on the drive.

Drive                          Location

/dev/hda       (ide0)    – Primary Master         - Master drive on the primary IDE bus
/dev/hdb       (ide1)   – Primary Slave            - Slave drive on the primary IDE bus
/dev/hdc       (ide2)   – Secondary Master      - Master drive on the secondary IDE bus
/dev/hdd       (ide3)   – Secondary Slave         - Slave drive on the secondary IDE bus

Note: In x86 PC architecture and IDE, each hard drive can have only 4 primary partitions and the first partition is denoted by 1. Hence, they will look like this –
- hda1 : First Primary Partition
- hda2 : Second Primary Partition
- hda3 : Third Primary Partition
- hda4 : Fourth Primary Partition

SCSI hard drive naming convention - /dev/sdx# :
Where x corresponds to the order in which the device is found at boot time – lowest SCSI ID number would be the first device found by SCSI BIOS. SCSI devices are listed such as sda, sdb, sdc, sde etc. in /dev directory.

x Stands for partition number same as for IDE drive (i.e. partition can range from 1 to 16 in these disks)
fdisk –l can be used to check the list of partitions on a drive. (Use fdisk command with caution as it might cause data loss if used incorrectly)


Popular posts from this blog

Linux System Accounting and Logging Basics

How to Make Money Online - A Beginner's Guide

Hide Files and Folders in Windows using attrib DOS Command