Week #4 - Highyeena/Tech-Journal GitHub Wiki

Storage Methods

  • Contiguous Allocation = determines a file's maximum size and cannot go above its limit; simple
  • Linked-List Allocation = creates a header that points to the first block of data in a list. Can grow incrementally by blocks. unreliable as sequential and random accesses suffer + a missing header causes the loss of the entire file
  • Segment-Based Allocation = uses a table to allocate regions of contiguous blocks. A file header points to the begin and end blocks
  • Indexed Allocation = User declares a max file size and the file system allocates the data into an array with pointers for every file block. Needs additional mechanisms to make sure data is grouped together to increase performance.
  • Multilevel Indexed Allocation = allocation for linux; 12 pointers point to data blocks, while the last 3 pointers point to other pointers and goes from single to triple indirect blocks. triple indirect points to 1024 double indirects that point to 1024 single indirects that point to 1024 pointers for data blocks.

Secondary Storage

Main storage is not able to store all of the programs and data we normally store on computers so we rely on secondary storage to:

  • Store lots of data

  • Store data permanently

  • Disk Structure = Disks come in multi-platter packs (a platter has 2 surfaces)

Platters are divided into tracks (set of tracks = a cylinder) Tracks are divided into sectors

Calculating Access Time

  • Seek Time = Time taken to move the read/write head to required track/cylinder (takes about 5-10ms)
  • Latency Time = Time taken for the disk to spin to the correct sector (average time is 3ms)

Disk Space Management

Free Space List

  • Bit Map/Bit Vector = disk blocks are represented by bits (1 for full, 0 for empty). Inefficient for today's hardware
  • Linked List = free space blocks point to the next free block and the last free block points to NULL
  • Free Sequence List = Points to the first block in a contiguous sequence and records the number of free blocks afterward

Disk Space Allocation Methods

  • Contiguous Allocation = files are stored as contiguous blocks. Access is easy and direct. Finding space, however, becomes inefficient as the computer needs to find a hole big enough for the file to fit in
  • Chained/Linked Allocation = Directory points to the first block of a program and each block points to the next. Access is tricky as you need to follow the blocks to get to a random block. File Space is optimized for no fragmentation. high chance of losing data from a corrupt pointer.
  • Indexed Allocation = An index block is created for a file and it points to all blocks for that file. Solves the problems of the first two methods

Disk Scheduling

Disks perform a bunch of I/O requests and scheduling helps sort them for increased performance

  • First Come First Serve (FCFS) = requests are served in the order of which they come in
  • Shortest Seek Time First (SSTF) = sorts the requests by seek time (distance from head position)
  • Circular Scan (C-Scan) = head moves from one end of the disk to the other end while servicing requests, after it returns to the beginning without servicing requests
  • Circular-Look (C-Look) = Goes as far as the last request and then reverses direction without going to the end of the disk

Readings

Storage Devices

  • Hard drives usually connect to a USB, IEEE 1394 (FireWire), eSATA, or eSATAp port

  • Hard drives contain multiple platters and each platter holds data on both sides (Also have two read/write heads)

  • Data is written with electromagnetism (heads do not touch the platter)

  • Magnetic hard drives contain 2 motors, one for the platter and one for the read/write heads. The RPM of these differ from different hard drives (faster RPM = faster read/write speeds and more expensive

  • Head Crash = the read/write head touches the platter, causing data corruption. It is important to backup data as hard drive failures are inevitable

  • SSDs use flash memory, eliminating the problem with hard drives having moving parts. (This also makes them quieter, faster, lightweight, and long-lasting). Writing takes longer than reading.

  • Write Amplification = the minimum amount of store space affected by a write request. (SSDs need to perform an erase function before writing to memory such as a 128kb block being erased before a 4kb file is stored)

  • Wear Leveling = technique to to erase and write data using all the memory blocks instead of the same ones.

  • SSDs use NAND structure (1 bit = no data, 0 bit = data present). NAND flash memory retains the data even when the device is powered off.

SLC (Single-Level Memory Cell) = 1 bit per memory cell (faster transfer speeds, more expensive) MLC (Multi-Level Memory Cell) = multiple bits per memory cell (slower transfer speeds, cheaper)

SSHD = Combination of a SSD and a Hard Drive (cheaper than SSDs while also having large quantities of storage and a small amount of fast storage)

  • Interface = set of rules that govern how the hard drive operates (Integrated Drive Electronics (IDE) and Enhanced IDE (EIDE) are the most common)

  • Cluster = smallest space that is used for a file (made up of sectors)

  • Sector = place where data is stored on a hard drive platter (made up of 512 bytes)

  • Cylinder = a set of tracks (rings on the hard drive platter) that are at the same position on each platter

Fault Tolerance = ability to function after a system/hardware failure

RAID (Redundant array of independent disks) = reading and writing on multiple hard drives in order to store larger files, improve performance and fault tolerance