Disk Management

1. Hard Disks

Hard disks use magnetic media to store disks. The physical hardware addresses are composed of the the cylinder, surface and sector address. Modern disks use logical sector addressing where sectors are numbered to . This makes disk management much easier, and helps work around BIOS limitations.

1.1 HDD Formatting

Before a drive can be used, it must be formatted. A low level format contains:

A high level format contains:

1.2 HDD Delays

There are many different delays affecting a HDD:

invert center small screen

We can calculate these with the following equations:

1.3 HDD Scheduling

Disk scheduling wants to minimize the seek / latency times, by ordering pending disk requests with respect to head position. There are many different algorithms to do this:

2. Solid State Drives

SSDs are made up of dies, which are made up of blocks, which are made up of pages. The page size is the smallest unit of data that can be read / written. The block size is the smallest unit of data that can be erased. An SSD has no moving parts and is much faster than a HDD. It has more bandwidth, and smaller latencies. However, it is more expensive and has a limited number of writes. Despite this, SSD is getting cheaper, and is projected to overtake HDDs in the future.

3. RAID

RAID stands for Redudant Array of Inexpensive Disks. CPU performance increases much faster over time compared to disk performance. RAID is a way to increase disk performance by using multiple disks.

A RAID Controller is the hardware that manages the RAID array. It can be a separate card, or integrated into the motherboard. It can be software RAID (managed by the OS) or hardware RAID (managed by a dedicated controller).

3.1 RAID Levels

There are many different RAID levels with different properties relating to performance, redundancy and cost. The most common are:

LevelCategoryRedundancyReadWrite
StripingNoneHighHigh
MirroringMirroredHighLow
ParallelHamming--
ParallelBitwise--
IndependentBlockwise--
IndependentBlockwise DistributedHighLow

RAID levels 2, 3 and 4 are not commonly used since they provide no advantage over RAID 5.

4. Disk Cache

We can use main memory to improve disk access. A buffer is put into main memory for disk sectors. It contains a copy of some sectors from disk, which the OS manages in terms of blocks. Multiple sectors are used for efficiency. Because the buffer has finite space, we need a replacement policy. These include:

Back to Home