File-System Implementation, Management, and Optimization Flashcards

1
Q

What is the purpose of the Master Boot Record (MBR)?

A

The MBR is used to boot the computer and contains the partition table, which gives the starting and ending addresses of each partition.

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

What is a boot block in a file system?

A

The boot block is the first block of a partition and is executed by the MBR during the boot process. It loads the operating system contained in that partition.

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

What is the superblock in a file system?

A

contains key parameters about the file system:
- file-system type,
- the number of blocks
- other administrative information.

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

What is the purpose of the root directory in a file system?

A

The root directory contains the top of the file-system tree and serves as the starting point to access all other directories and files.

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

What is contiguous allocation in file storage?

A

is a file allocation scheme where each file is stored as a contiguous run of disk blocks. It offers simplicity and high read performance.

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

What is the disadvantage of contiguous allocation?

A

can lead to disk fragmentation over time, where free blocks are scattered across the disk, making it challenging to allocate space for new files.

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

What is linked-list allocation in file storage?

A

represents each file as a linked list of disk blocks. Each disk block contains a pointer to the next block in the file.

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

What is the advantage of linked-list allocation?

A
  • avoids disk fragmentation, as all disk blocks can be used.
  • allows for variable file sizes
  • simplifies directory entry storage.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a File Allocation Table (FAT)?

A

A File Allocation Table is a table stored in memory that keeps track of the disk-block pointers for files in a linked-list allocation file system

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

How does the i-node scheme work in file storage?

A

The i-node scheme associates each file with an i-node, which lists the attributes and disk addresses of the file’s blocks.

It allows for efficient access to file blocks and requires less memory than the linked-list allocation with a table.

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

What is the main function of the directory system in an operating system?

A

The main function of the directory system is to map the ASCII name of a file onto the information needed to locate the data, such as disk addresses or i-node numbers.

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

Where are file attributes typically stored in a file system?

A

File attributes can be stored either directly in the directory entry or in the i-nodes.

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

How can variable-length file names be implemented efficiently?

A
  • use a structure where each directory entry contains a fixed portion, followed by the actual file name.
  • keep the file names together in a heap at the end of the directory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the advantages and disadvantages of using a hash table in directories for file lookup?

A

speeds up file lookup, but it requires more complex administration.

Hashing the file name allows for faster access to the desired entry, but collisions may occur

requiring the use of linked lists to handle multiple files with the same hash value.

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

What are the two solutions to the problem of sharing files between multiple users?

A
  • storing disk blocks in a data structure associated with the file itself, such as an i-node.
  • The second solution is symbolic linking
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the drawback of the first solution for sharing files?

A

The first solution retains the ownership of the file with the original owner, making it difficult for the system to find and erase all directory entries for the file if it is removed. The original owner continues to be billed for the file until all links to it are removed.

17
Q

What is the disadvantage of symbolic linking?

A

requires extra overhead as the system needs to read the file containing the path and follow it component by component to locate the i-node.

18
Q

How does the log-structured file system (LFS) address the issue of small random writes?

A

LFS structures the entire disk as a log and collects pending writes into segments that are written to the disk as a contiguous segment. This allows for the full bandwidth of the disk to be utilized.

19
Q

What is the purpose of the segment summary in the log-structured file system?

A

The segment summary, located at the start of each segment, provides information about the contents of the segment, including:
- i-nodes,
- directory blocks,
- and data blocks

20
Q

How are i-nodes handled in the log-structured file system?

A

In the log-structured file system, i-nodes are scattered throughout the log instead of being at fixed positions on the disk. To locate an i-node, an i-node map indexed by i-number is maintained. The map points to the corresponding i-node on the disk, and it is also cached in memory for faster access.

21
Q

What are the two general strategies for storing a file on disk?

A
  • are storing the file as a contiguous sequence of bytes
  • splitting the file into fixed-size blocks.
22
Q

What is the significance of block size in file storage?

A

Block size determines how much disk space a file occupies and affects the performance of file access.

23
Q

How do performance and space utilization conflict in the choice of block size?

A

Small block sizes are good for performance but result in lower disk space utilization.

Large block sizes are better for space utilization but can adversely affect performance.

24
Q

What is the purpose of disk quotas in multiuser operating systems?

A

Disk quotas are used to limit the amount of disk space that each user can consume, preventing users from using excessive disk space.

25
Q

What is file-system consistency, and why is it an issue?

A

File-system consistency refers to the state of the file system being correct and coherent.

It is an issue because if the system crashes before all modified blocks are written out, the file system can be left in an inconsistent state.

26
Q

How do utility programs like fsck and sfc help in dealing with inconsistent file systems?

A

Utility programs like fsck (used in UNIX) and sfc (used in Windows) are used to check the file-system consistency. They verify each file system independently and perform checks on blocks and files to identify inconsistencies.

27
Q

How does the file-system checker verify block consistency? (tables)

A

The first table contains counters for each block, tracking how many times each block is present in a file.

The second table records how often each block is present in the free list or the bitmap of free blocks.

28
Q

What actions does the file-system checker take to handle missing blocks or duplicate blocks in the free list?

A

missing blocks –> add them to free list.

duplicate blocks in the free list –> rebuilds the free list.