HDDs and SSDs - caitlinmallen/TechWiki GitHub Wiki

Storage Devices – Hard Disks and SSDs

HDD

  • Form Factors
    • 5 in desktop hard drive
      • Spinning platter
    • 5 in traditional laptop hard drive
      • Spinning platter
    • 8 in hard drive
      • In original iPod
      • Phased out due to SSD
  • Consumer HDD
    • SATA
      • Serial
      • Card-edge connector
    • PATA
      • Parallel
      • Precursor to SATA
      • Has pin connector
      • Obsolete
  • IDE
    • Integrated Drive Electronics
    • AKA PATA
  • SCSI
    • Small computer system interface
      • Scuzzy
    • Servers and high-end equipment
    • Built to be robust and less prone to errors
    • Several revisions
      • SCSI 2
        • 50-pin interface
      • SCSI 3
        • 68 pin interface
      • SCSI 3 variant
        • 80 pin variant
  • PATA/IDE Interface
    • 40 position connector, 39 pin interface
    • Ribbon cable
    • IDE Drive jumper options
      • Master
      • Slave
      • Cable select
    • Standard power connector
  • Current Technology
    • SATA
      • Serial Advanced Technology Attachment
    • SAS ' Serial attached SCSI
  • Where does the data reside?
    • Disk Platter
      • Round, flat, magnetic or ceramic disks in a hard drive that holds the actual data
      • Made of two materials
        • Substrate material
        • Magnetic media coating
  • Track
    • Concentric circles where all the information is stored
      • Modern disks contain 10k+ tracks
        • Tracks are .115m or less
      • Each platter within a hard drive will have the same amount of tracks
    • Track numbering starts from 0 and starts from the outside of the platter
  • Definition
    • Cylinder
      • Group of tracks in a hard drive that can be accessed at the same time by the read/write head
        • Typically called a cylinder and not track number
  • Disk Drive Terminology
    • Putting it all together
      • Number of cylinders (track), head (sides), and sectors (CHS) uniquely identify physical geometry of the storage units on a disk
        • CHS also yields disk capacity
          • Capacity = cylinders x heads x sectors x sector size
  • Sectors
    • Physical unit of hard drive data storage
      • A bucket to store parts of a file into
      • Typically 512 bytes and some bytes for internal info
      • 1 sector = 4096 (4K) bytes for new disks
    • Info
      • ID information
        • Sector number and status
      • Synchronization fields
        • Helps controller guide read process
      • ECC
        • Error correcting code and ensures data integrity
    • Modern hard drives will have a pool of reserved sectors to pull from when one fails
      • Spare Sectoring
    • When bad sectors are identified, they cannot be easily seen by any operating system
      • Typically hardware devices such as the PC-3000 are required

SSD

  • Solid state drives
    • Increased in capacity
    • Cheaper now and most devices use SSD
  • File Fragmentation
    • On HDD
    • Overtime with use, files get fragmented
      • No longer stored in a continuous fashion
  • Advantages of SSH
    • No tracks or disks
      • Stored in cells
    • Constant seek time for even random access
    • No file fragmentation
    • No moving parts
      • No mechanical errors
      • Fast startup time
      • No motor noise
    • Light in weight
    • Low power
  • SSD Problem areas
    • Overwriting is complicated and expensive
      • Read-erase-modify-write cycle
    • Cells have a limited lifetime/cycle
      • Wear leveling must be used
    • Data recovery issues
    • Data carving issues
    • Power faults can cause data loss or a bricked device
  • SSD Internals
    • Flash based
      • NAND Flash
    • Controller
  • Data storage
    • Written in blocks and pages
      • Data moves so it maintains a map
      • Mapping to LBA is maintained
      • Blocks are broken down into pages
        • Pages store sections
      • 4069 bytes per sector
  • Erasing and Write Amplification
    • Write is fast
      • Rewrite/overwrite involves additional erasing step
      • Entire blocks (not pages or sections) must be erased
        • Block is smallest erasable unit
  • Optimization Strategies
    • Adding a page
    • Page is holding new data when something is marked as stale
  • Garbage Collection
    • Allocate a new unused block
    • Copy new contents to the block
    • Mark
  • TRIM Command
    • File deletion on a normal HDD
      • File is marked as deleted in the file system's database
      • HDD has no clue which sectors are freed up
    • SSDs need to know this info
      • Modern OS have support for this command
  • Over-provisioning
    • Individual memory cells have limited read/write cycles
      • Few thousand cycles
    • Like hard disks
      • Extra capacity not accessible by normal users
    • Unlike hard disks
      • 10-25% more storage than stated capacity
      • Overprovisioned areas are continuously used