Skip to content

Disk

HDD

Hard Disk Drive - platters: disks that are stacked on top of each other - spindle: the motor that spins the platters - read/write head: the arm that moves over the platters to read/write data - cylinders: the set of tracks that are on all platters at the same radius - tracks: the circles on the platters that are used to store data - sectors: the smallest unit of data that can be read/written to the disk, typically 512 bytes - block: the smallest unit of data that can be read/written to the disk, typically 4KB - disk controller: the hardware that controls the disk, manages the read/write head, and communicates with the OS alt text

Disk Performance

Disk Lantency = seek + rotation + transfer time - seek time: time it takes to move the read/write head to the correct track - rotation time: time it takes for the correct sector to rotate under the read/write head - transfer time: time it takes to transfer the data from the disk to memory -

Disk Scheduling Policies

  • FIFO: first in, first out, fair, no out of order requests | but nay have long seeks, low throughput
  • SSTF: shortest seek time first, which picks the closest request on disk, minimize seek time (min arm move time) | but may starve some requests (starvation)
  • SCAN: (elevator) move the arm in one direction, servicing requests until it reaches the end of the disk, then reverse direction | but may starve some requests

SSD

Solid State Drive persistent, much faster (100) than HDD because there is no moving parts cost 5-10 compare to HDD flashs suffer from wear-out*, once a page has been erased multiple times, less reliable

NVM

Non-Volatile Memory performance even better than SSD, but more expensive byte addressable, rather than sectors in disk or pages in SSD

Redundent array of independent disks (RAID)

multiple disks that are used to store data, used to improve performance and reliability Parity Disk: store the XOR of the data disks. if one disk fails, the data can be reconstructed from the parity disk and the other disks

RAID 0

  • striping, no redundancy, improve performance alt text

RAID 1

  • mirroring, no striping, no redundancy, improve performance alt text

RAID 4

  • : improves throughput and reliability alt text