OS10 Flashcards

(44 cards)

1
Q

Describe the physical structure of hard disks.

A

A stack of platters with a read write head.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State the formula for average latency of a hard disk.

A

$$\frac12 \times \text{time per rotation}$$

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State the formula for average access latency of a hard disk.

A

$$\text{average seek time}+\text{average latency}$$

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

State the formula for the average IO time of a hard disk.

A

$$\text{average latency}+\frac{\text{transfer amount}}{\text{transfer rate}}+\text{controller overhead}$$

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

State the pros and cons of using SSD over HDD.

A

Pros: more reliable, no seek time/rotational latency, faster. Cons: read/write wears out cells leading to unreliability, more expensive per MB.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State the problem of disk scheduling.

A

How to best order reads and writes to achieve policy aim.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

State the properties of first come first served disk scheduling.

A

Fair but inefficient.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe shortest seek time first disk scheduling.

A

Next request in queue is that with the shortest seek time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

State the issue with shortest seek time first disk scheduling.

A

Allows starvation. Not optimal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the SCAN algorithm for disk scheduling.

A

Starts at one end of the disk and moves to the other end, servicing everything on the way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe the circular SCAN algorithm.

A

Wrapping back to the start when reaching the end.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe the physical formatting of a disk.

A

Divide a disk into sectors the disk controller can read/write. Each sector holds header information, data, and error correction code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe the logical formatting of disks.

A

Disk is partitioned into one or more logical disks. Blocks are grouped into clusters to increase efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Compare the difference between disk and file IO.

A

Disk IO is done in blocks. File IO is done in clusters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Describe the process of booting from disk.

A

First block contains bootloader program, which is executed. Bootloader then reads the partition table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe the on-disk structure of a mass storage device.

A

A boot block followed by one or more partitions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Define partition (disk).

A

A partition is a contiguous range of fixed-size blocks, containing a filesystem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Describe the structure of a partition for a UNIX filesystem.

A

Superblock contains metadata (e.g., total and free blocks, start of free-block and free-inode list). Inode table. Data blocks.

19
Q

Define file.

A

It is the basic abstraction for non-volatile storage, comprises a single contiguous logical address space.

20
Q

Describe the two components of a simple filesystem.

A

Directory service maps names to file identifiers and metadata, handles access and existence control. Storage service stores data on disk, including directories.

21
Q

How is a file identified?

A

By its system file ID (usually an integer).

22
Q

State the attributes stored in a file control block.

A

Type: file or directory. Location: pointer to file location on device. Size. Protection: read/write/execute permissions. Time/date/user identification for usage monitoring.

23
Q

State the purpose of the open-file table.

A

To track open files.

24
Q

What information of a file does the open-file table store?

A

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.

25
State the purpose of directory operations.
To manage the lifetime of a file.
26
Describe the 4 directory operations.
Create: allocate blocks to the file. Delete: return allocated blocks to free list. Open/close the file. Stat returns file status and metadata.
27
State the purpose of file operations.
To interact with the file.
28
State the 3 file operations.
Write data at cursor. Read data from cursor to memory. Truncate clips length of file at cursor.
29
Describe the two access patterns.
Random access: permits moving cursor without reading or writing. Sequential access: only permits moving cursor to beginning.
30
Describe the operation of opening a file.
The in-memory directory structure reads from disk and resolves file name to a file control block.
31
Describe the operation of reading a file.
The per-process open-file table resolves to the system-wide open file table containing the file control block, which resolves to the actual data blocks on disk.
32
State the requirements for an implementation of directories.
Enable files to be grouped together. Allow different files to have the same name, and one file to have many names. To find files efficiently.
33
Why is a single level directory not a good implementation of directories?
Does not allow different files to have the same name. Does not allow files to be grouped together.
34
Define relative path names.
Name is resolved with respect to the current working directory.
35
What is the current working directory?
Most operations are carried out relative to the CWD.
36
State the difference between tree structured and acyclic-graph structured directories.
DAG structured directories allow files to have two different absolute names (hard links).
37
How does the file system know when to delete a file in DAG structured directories?
Use reference counting.
38
How are cycles prevented in DAG structured directories?
By forbidding links to subdirectories.
39
What is file-system mounting?
File systems must be mounted at a mount-point before access, onto a pre-existing file system.
40
State the steps for deleting a file.
Check if user has sufficient permissions (write access) on the file and directory; if yes, remove entry from directory. Decrement reference count on inode; if zero, free block data and inode.
41
State the recovery steps after a file system crashes.
Check the entire file system with fsck. Check for unreferenced blocks, mark as free. Update incorrect block reference counts.
42
State the factors affecting the filesystem's performance.
Disk allocation and directory algorithms (e.g., if it causes fragmentation). Types of metadata stored. Whether metadata structures are pre-allocated to fixed size or allocated as needed.
43
Describe the ways of improving filesystem performance.
Keeping data and metadata close together (reduces seek latency). Make writes asynchronous and buffered.
44
Describe the two types of buffer caches.
Not unified: memory-mapped IO goes through a page cache. Both memory-mapped and direct read/write IO goes through an additional buffer cache. Unified: a single buffer cache for both memory-mapped and direct read/write IO.