Introduction to Disk-Related Knowledge

Introduction to Disk-Related Knowledge

I put this table together myself. It reflects my own understanding and may not be completely accurate.

| Hard Drive Type | Interface | Operating Mode | Notes |
| --- | --- | --- | --- |
| IDE hard drive | ATA | ATA | In theory, any drive that places the controller on the circuit board and integrates it with the disk itself can be called an IDE hard drive. This is the true meaning of IDE. |
| SATA hard drive | SATA | IDE, AHCI, RAID | On a ThinkPad T400, IDE compatibility mode can be set through Config -> SATA -> Compatibility. |
| SCSI hard drive | SCSI | SCSI | I have seen this in VMware. When installing Red Hat Linux, I once ran into a situation where I had to delete the SCSI hard drive, create a new IDE hard drive, and then install again. |
| SSD hard drive | SATA-2 | Depends on the controller | SSD stands for solid-state drive. Early common consumer SSDs often used the SATA interface. The specific interface and mode should be confirmed from the device specifications and how the system identifies it. |

IDE (ATA/PATA), SATA, SCSI, SAS

In early hard drives, the disk and the controller were separate.

IDE (Integrated Drive Electronics) refers to a hard drive that integrates the hard drive controller with the disk body. In other words, in theory, any drive that places the controller on the circuit board and integrates it with the disk itself can be called an IDE hard drive. This is the true meaning of IDE.

ATA (Advanced Technology Attachment) may have been the first IDE interface standard, so today IDE is often used to refer to ATA. In everyday usage, IDE and ATA can be understood as closely related concepts. PATA (Parallel ATA) is usually used to distinguish traditional parallel ATA from the later SATA.

SATA (Serial ATA) means serial ATA.

SCSI (Small Computer System Interface) means the SCSI interface.

SAS (Serial Attached SCSI) means the serial attached SCSI interface.

Among the interfaces above, ATA/PATA and traditional SCSI transmit data in parallel, so their data cables have more pins. SATA and SAS transmit data serially, so their data cables have fewer pins.

In general, SATA is better than ATA/PATA, and SAS is better than traditional SCSI. Compared with SATA, SCSI offers higher robustness and stability, making it suitable for enterprise-level and server-level applications. Compared with SCSI, SATA has the advantage of being cheaper and more practical.

Solid-State Drive SSD

An SSD (Solid State Disk / Solid State Drive) is a hard drive made from an array of solid-state electronic storage chips. It usually consists of a control unit and storage units. The storage units are responsible for storing data, while the control unit is responsible for reading and writing data.

Early consumer solid-state drives commonly used SATA interfaces, such as SATA-2. Later SSDs may also use different interfaces and protocols, including SATA-3, mSATA, M.2 SATA, and M.2 NVMe. To determine the actual interface and operating mode of an SSD, refer to the device specifications, BIOS/UEFI settings, and how the operating system identifies it.

ATA Transfer Modes: PIO, DMA, Ultra DMA (UDMA)

Early ATA had two modes: PIO and DMA. Later, Ultra DMA mode was introduced.

PIO (Programmed I/O) is a data exchange mode in which the CPU executes I/O port instructions to read and write data. It was one of the earliest transfer methods. Because it requires CPU intervention, it consumes a lot of CPU resources and is very slow. Common modes include PIO mode 0 (3.3 MB/s) through PIO mode 4 (16.6 MB/s).

DMA (Direct Memory Access) is a data exchange mode that accesses data directly from memory without passing through the CPU. Common modes include Single-Word DMA and Multi-Word DMA.

Common UDMA (Ultra DMA) modes include UDMA mode 2 (ATA33), UDMA mode 4 (ATA66), UDMA mode 5 (ATA100), and UDMA mode 6 (ATA133), with theoretical speeds of 33 MB/s, 66 MB/s, 100 MB/s, and 133 MB/s respectively.

In Windows, the transfer mode of a hard drive can be viewed as follows:

Device Manager -> IDE ATA/ATAPI controllers -> Primary/Secondary IDE Channel -> Properties -> Advanced Settings -> Current Transfer Mode

Early hard drives generally ran in UDMA mode 5, with a speed of 100 MB/s. UDMA mode 6 (ATA133) was once proposed by Maxtor, but not all controllers supported it. For example, some Intel controllers at the time mainly supported up to UDMA mode 5. Specific support should be confirmed based on the motherboard chipset, controller driver, and system identification results.

If a hard drive has bad sectors or read problems, after the system's IDE/ATAPI controller driver (Atapi.sys) accumulates 6 timeout or cyclic redundancy check (CRC) errors, the operating system may automatically lower the transfer mode by one level. If timeouts or CRC errors continue afterward, the transfer mode may eventually be reduced to the lowest PIO mode. At that point, hard drive transfer speeds become extremely slow.

Primary/Secondary IDE Channels and Master/Slave Drives

One IDE slot on the motherboard corresponds to one IDE channel in the system Device Manager. If the motherboard has two IDE slots, they are usually labeled IDE1 and IDE2 on the motherboard, where IDE1 is the primary IDE channel and IDE2 is the secondary IDE channel. As IDE was gradually replaced by SATA, later motherboards usually had only one IDE slot, or even no IDE slot at all.

Each IDE slot can connect two IDE devices: one master device and one slave device. They cannot both be master or both be slave. Master/slave status can be set using jumpers on the device. In general, the middle connector of the data cable connects to the slave drive, and the end connector connects to the master drive.

The detection order during startup is usually: primary IDE channel first, then secondary IDE channel; master drive first, then slave drive.

In Windows, IDE channel devices can be viewed or configured in the following location:

Device Manager -> IDE ATA/ATAPI controllers -> Primary/Secondary IDE Channel -> Properties -> Advanced Settings -> Device 0/1

Here, when Device Type is set to Auto Detection, the position is enabled. If you want to disable it, you can set it to None. This prevents the system from checking it during startup and can speed up boot time. However, if a hard drive is connected at that position, it will not be detected because the system is not checking it.

SATA Hard Drive Operating Modes: IDE, AHCI, and RAID

SATA hard drives commonly have three operating modes: IDE, AHCI, and RAID.

IDE mode: maps the SATA hard drive into an IDE-compatible mode. This approach usually does not require installing additional drivers, and many early motherboards set SATA to this mode by default. The SATA controller may also be identified by the system as a primary or secondary IDE channel.

AHCI mode: in this mode, the SATA hard drive works in its native mode and supports NCQ (Native Command Queuing). AHCI requires support from both the motherboard and system drivers. For an older system that has already been installed, directly changing BIOS from IDE to AHCI may cause a blue screen during startup or prevent the system from booting. The corresponding driver should be prepared first, or settings should be adjusted according to the system requirements. After enabling this mode, the power-on self-test may take longer, but NCQ can be used and hot swapping is supported.

RAID mode: used to form an array from multiple hard drives. In this case, an item such as SCSI RAID Controller may appear in Device Manager. Similar controller entries may also appear when using SCSI disks, creating RAID, or installing certain virtual optical drive software.

After AHCI mode is enabled, the performance improvement over the default IDE mode is not necessarily very large. For ordinary usage scenarios, the default IDE mode can still meet basic needs. If NCQ, hot swapping, or more native SATA support for modern systems is needed, AHCI should be considered first, and the system driver should be confirmed as ready before making the change.

S.M.A.R.T.

S.M.A.R.T. stands for Self-Monitoring, Analysis and Reporting Technology. A hard drive that supports S.M.A.R.T. can use monitoring commands on the drive and monitoring software on the host to analyze and compare the operating status, history, and preset safety thresholds of the heads, platters, motor, and circuits. When a value falls outside the safe range, it automatically warns the user.

The Health Status section in HDTune displays the hard drive's S.M.A.R.T. information.

When a SATA hard drive is in AHCI mode, some early diagnostic tools or controller drivers may be unable to read S.M.A.R.T. information. In that situation, use a diagnostic tool that supports AHCI, or confirm whether the motherboard chipset driver, storage controller driver, and hard drive diagnostic software are compatible.

Leave a Reply