Chapter 13+14+15 Flashcards
(43 cards)
Can you simulate tree directory with flat directory using long names?
Yes - encode path in filename using separators like underscores. Example: /home/user/file becomes home_user_file. Less efficient than true tree structure
How to allow 4990 of 5000 users access to one file in Unix?
Cannot be done efficiently with standard Unix permissions (owner/group/other model). Would need access control lists (ACLs) or special group containing 4990 users
What protection scheme works better than Unix for large user groups?
Access Control Lists (ACLs) that specify individual users/groups with permissions. Capability-based systems. Role-based access control (RBAC)
What does rwxr–r– mean in Unix permissions?
Owner: read write execute. Group: read only. Others: read only. Decimal equivalent: 744
What does 755 mean in Unix permissions?
Owner: rwx (read write execute). Group: r-x (read execute). Others: r-x (read execute). Common for executable files
What does rwxr-x— mean in Unix permissions?
Owner: read write execute. Group: read execute. Others: no permissions. Decimal equivalent: 750
Give examples of sequential file access applications
Text processing (reading documents). Log file analysis. Video/audio streaming. Backup and archival operations
Give examples of random file access applications
Database systems accessing records. Virtual memory page files. Image/graphics editing. Spreadsheet applications
Give examples of index file access applications
Database index files. File allocation tables. Directory structures. Hash table implementations
How can OS exploit knowledge of sequential access?
Read-ahead buffering to prefetch next blocks. Larger buffer allocation for sequential streams. Optimize disk scheduling for sequential patterns
How does VFS layer support multiple file systems?
Provides common interface abstracting file system differences. Translates generic operations to specific file system calls. Allows transparent mounting of different file system types
Why have multiple file system types on one system?
Different file systems optimized for different uses. Legacy compatibility requirements. Network file systems for remote access. Special purpose file systems (proc tmpfs)
Why mount root file system automatically at boot?
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 many I/O operations for contiguous allocation when adding block at beginning?
Need to shift all 100 existing blocks to make room. Requires reading 100 blocks and writing 101 blocks = 201 I/O operations
How many I/O operations for linked allocation adding block at beginning?
Simply update head pointer and set new block to point to old first block. Only 1 I/O operation needed
How many I/O operations for indexed allocation adding block at beginning?
Update index block to include new block pointer. Only 1 I/O operation to write updated index block
How many I/O operations for contiguous allocation adding block in middle?
Must shift half the blocks (50) to make room. Read 50 + write 51 = 101 I/O operations
How many I/O operations for linked allocation adding block in middle?
Must traverse to middle position then update pointers. Traverse + 2 writes = ~51 I/O operations
How many I/O operations for indexed allocation adding block in middle?
Simply update index block to include new block pointer. Only 1 I/O operation
Why must file allocation bitmap be kept on mass storage?
File system must survive system crashes and reboots. Bitmap represents permanent disk allocation state. Memory is volatile and lost on power failure
What criteria determine best allocation strategy for a file?
File size and growth patterns. Access pattern (sequential vs random). Performance requirements. Storage efficiency needs
What are advantages of fixed-size extents?
Simple allocation algorithm. Predictable performance. Easy to implement and manage. Reduced metadata overhead
What are disadvantages of fixed-size extents?
Internal fragmentation if file doesn’t fit exactly. May waste space for small files. Inflexible for varying file sizes
What are advantages of variable-size extents?
Efficient space utilization. Can match exact file requirements. Reduces internal fragmentation