Describe the physical structure of hard disks.
A stack of platters with a read write head.
State the formula for average latency of a hard disk.
$$\frac12 \times \text{time per rotation}$$
State the formula for average access latency of a hard disk.
$$\text{average seek time}+\text{average latency}$$
State the formula for the average IO time of a hard disk.
$$\text{average latency}+\frac{\text{transfer amount}}{\text{transfer rate}}+\text{controller overhead}$$
State the pros and cons of using SSD over HDD.
Pros: more reliable, no seek time/rotational latency, faster. Cons: read/write wears out cells leading to unreliability, more expensive per MB.
State the problem of disk scheduling.
How to best order reads and writes to achieve policy aim.
State the properties of first come first served disk scheduling.
Fair but inefficient.
Describe shortest seek time first disk scheduling.
Next request in queue is that with the shortest seek time.
State the issue with shortest seek time first disk scheduling.
Allows starvation. Not optimal.
Describe the SCAN algorithm for disk scheduling.
Starts at one end of the disk and moves to the other end, servicing everything on the way.
Describe the circular SCAN algorithm.
Wrapping back to the start when reaching the end.
Describe the physical formatting of a disk.
Divide a disk into sectors the disk controller can read/write. Each sector holds header information, data, and error correction code.
Describe the logical formatting of disks.
Disk is partitioned into one or more logical disks. Blocks are grouped into clusters to increase efficiency.
Compare the difference between disk and file IO.
Disk IO is done in blocks. File IO is done in clusters.
Describe the process of booting from disk.
First block contains bootloader program, which is executed. Bootloader then reads the partition table.
Describe the on-disk structure of a mass storage device.
A boot block followed by one or more partitions.
Define partition (disk).
A partition is a contiguous range of fixed-size blocks, containing a filesystem.
Describe the structure of a partition for a UNIX filesystem.
Superblock contains metadata (e.g., total and free blocks, start of free-block and free-inode list). Inode table. Data blocks.
Define file.
It is the basic abstraction for non-volatile storage, comprises a single contiguous logical address space.
Describe the two components of a simple filesystem.
Directory service maps names to file identifiers and metadata, handles access and existence control. Storage service stores data on disk, including directories.
How is a file identified?
By its system file ID (usually an integer).
State the attributes stored in a file control block.
Type: file or directory. Location: pointer to file location on device. Size. Protection: read/write/execute permissions. Time/date/user identification for usage monitoring.
State the purpose of the open-file table.
To track open files.
What information of a file does the open-file table store?
A cursor: last read/written location per process with the file open. File open count: how many processes have the file open. On-disk location. Access rights.