Chapter 13+14+15 Flashcards

(43 cards)

1
Q

Can you simulate tree directory with flat directory using long names?

A

Yes - encode path in filename using separators like underscores. Example: /home/user/file becomes home_user_file. Less efficient than true tree structure

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

How to allow 4990 of 5000 users access to one file in Unix?

A

Cannot be done efficiently with standard Unix permissions (owner/group/other model). Would need access control lists (ACLs) or special group containing 4990 users

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

What protection scheme works better than Unix for large user groups?

A

Access Control Lists (ACLs) that specify individual users/groups with permissions. Capability-based systems. Role-based access control (RBAC)

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

What does rwxr–r– mean in Unix permissions?

A

Owner: read write execute. Group: read only. Others: read only. Decimal equivalent: 744

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

What does 755 mean in Unix permissions?

A

Owner: rwx (read write execute). Group: r-x (read execute). Others: r-x (read execute). Common for executable files

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

What does rwxr-x— mean in Unix permissions?

A

Owner: read write execute. Group: read execute. Others: no permissions. Decimal equivalent: 750

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

Give examples of sequential file access applications

A

Text processing (reading documents). Log file analysis. Video/audio streaming. Backup and archival operations

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

Give examples of random file access applications

A

Database systems accessing records. Virtual memory page files. Image/graphics editing. Spreadsheet applications

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

Give examples of index file access applications

A

Database index files. File allocation tables. Directory structures. Hash table implementations

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

How can OS exploit knowledge of sequential access?

A

Read-ahead buffering to prefetch next blocks. Larger buffer allocation for sequential streams. Optimize disk scheduling for sequential patterns

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

How does VFS layer support multiple file systems?

A

Provides common interface abstracting file system differences. Translates generic operations to specific file system calls. Allows transparent mounting of different file system types

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

Why have multiple file system types on one system?

A

Different file systems optimized for different uses. Legacy compatibility requirements. Network file systems for remote access. Special purpose file systems (proc tmpfs)

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

Why mount root file system automatically at boot?

A

System needs file system to load other components. Boot process requires access to system files. Root file system contains essential OS components and drivers

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

How many I/O operations for contiguous allocation when adding block at beginning?

A

Need to shift all 100 existing blocks to make room. Requires reading 100 blocks and writing 101 blocks = 201 I/O operations

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

How many I/O operations for linked allocation adding block at beginning?

A

Simply update head pointer and set new block to point to old first block. Only 1 I/O operation needed

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

How many I/O operations for indexed allocation adding block at beginning?

A

Update index block to include new block pointer. Only 1 I/O operation to write updated index block

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

How many I/O operations for contiguous allocation adding block in middle?

A

Must shift half the blocks (50) to make room. Read 50 + write 51 = 101 I/O operations

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

How many I/O operations for linked allocation adding block in middle?

A

Must traverse to middle position then update pointers. Traverse + 2 writes = ~51 I/O operations

19
Q

How many I/O operations for indexed allocation adding block in middle?

A

Simply update index block to include new block pointer. Only 1 I/O operation

20
Q

Why must file allocation bitmap be kept on mass storage?

A

File system must survive system crashes and reboots. Bitmap represents permanent disk allocation state. Memory is volatile and lost on power failure

21
Q

What criteria determine best allocation strategy for a file?

A

File size and growth patterns. Access pattern (sequential vs random). Performance requirements. Storage efficiency needs

22
Q

What are advantages of fixed-size extents?

A

Simple allocation algorithm. Predictable performance. Easy to implement and manage. Reduced metadata overhead

23
Q

What are disadvantages of fixed-size extents?

A

Internal fragmentation if file doesn’t fit exactly. May waste space for small files. Inflexible for varying file sizes

24
Q

What are advantages of variable-size extents?

A

Efficient space utilization. Can match exact file requirements. Reduces internal fragmentation

25
What are disadvantages of variable-size extents?
Complex allocation algorithms. External fragmentation over time. Harder to find suitable free extents
26
How does contiguous allocation perform for sequential access?
Excellent - single seek followed by fast sequential read. Minimizes disk head movement. Best performance for sequential workloads
27
How does contiguous allocation perform for random access?
Poor - may require seek for each access if blocks are far apart. Cannot optimize for random patterns
28
How does linked allocation perform for sequential access?
Good - can follow links sequentially. Some overhead from following pointers. May have seeks between non-contiguous blocks
29
How does linked allocation perform for random access?
Very poor - must traverse links from beginning to reach any block. No direct access to arbitrary blocks
30
How does indexed allocation perform for sequential access?
Good - index provides direct access to each block. Single additional seek to read index. Can optimize read-ahead
31
How does indexed allocation perform for random access?
Excellent - direct access to any block via index. Constant time to locate any block. Ideal for random access patterns
32
How do performance optimizations affect crash consistency?
Caching and delayed writes can lose data on crash. Write reordering may leave file system in inconsistent state. Need journaling or logging for crash recovery
33
How does logical-to-physical mapping work in contiguous allocation?
Start block + logical block number = physical block number. Simple arithmetic calculation. Direct mapping with no indirection
34
How does logical-to-physical mapping work in linked allocation?
Follow chain of pointers from first block. Must traverse links sequentially. No direct calculation possible
35
How does logical-to-physical mapping work in indexed allocation?
Use logical block number as index into block pointer array. Direct lookup in index table. Single level of indirection
36
How many blocks to read going from logical block 10 to 4 in contiguous allocation?
Zero additional blocks - can calculate physical address directly. Direct addressing allows immediate access
37
How many blocks to read going from logical block 10 to 4 in linked allocation?
Must traverse backward or restart from beginning. Typically restart from first block requiring 4 block reads to reach block 4
38
How many blocks to read going from logical block 10 to 4 in indexed allocation?
Zero additional blocks - index allows direct access to any block. Can calculate physical address from index immediately
39
What is maximum file size with inode having 12 direct + single/double/triple indirect?
12 direct blocks × 8KB = 96KB. Single indirect: (8KB/4 bytes) × 8KB = 16MB. Double indirect: 2048 × 16MB = 32GB. Triple indirect: 2048 × 32GB = 64TB. Total ≈ 64TB
40
How do directory entries work in file systems?
Map file names to inode numbers or file control blocks. Contain metadata like permissions and timestamps. Enable hierarchical namespace organization
41
What is difference between hard and soft links?
Hard link: multiple directory entries point to same inode. Soft link: file contains path to another file. Hard links share storage soft links are separate files
42
How does file system journaling work?
Record intended changes in log before making them. Replay log after crash to complete or undo partial operations. Ensures consistency at cost of performance
43
What is difference between metadata and data journaling?
Metadata journaling: only logs file system structure changes. Data journaling: logs both metadata and file content changes. Data journaling slower but more comprehensive