📝 Overview of Network file systems (18 MCQs)
Remote File Access Through Client-Server Architecture
A network file system allows computers to access files stored on remote servers through a communication network. It extends ordinary file-system services across machine boundaries, allowing clients to perform operations such as opening, reading, writing, and closing remote files. Protocols such as NFS and SMB coordinate communication, authentication, file identification, and data transfer between networked operating systems.
Why Distributed Users Need Shared File Services
Organisations often need multiple computers to use common documents and datasets without maintaining independent copies. Network file systems provide centralised storage and support collaboration, backup, and administration. However, network communication introduces latency, disconnection, server failures, and concurrency challenges. Distributed clients may also cache file contents, creating consistency problems when several users modify the same resource.
Client Requests, Server Processing and File Handles
A client application requests a file operation through its local operating system. The network filesystem translates the request into protocol messages and sends them to the server. The server authenticates the request, checks permissions, performs the storage operation, and returns the result. File handles or equivalent identifiers allow later requests to refer to remote objects.
Opening a Remote Document Through NFS
Suppose a workstation accesses /shared/project/report.txt from an NFS server. The client resolves the remote pathname, obtains the required file reference, and requests file contents. The server checks permissions, reads the relevant storage blocks, and returns the data across the network for delivery to the application.
Centralised Sharing and Distributed-System Limitations
Network file systems simplify shared storage administration and provide access across multiple operating systems and locations. Performance depends on network bandwidth, latency, server processing, caching, and storage speed. Network interruption can make files temporarily unavailable even when the server remains operational. Security also depends on authentication, encryption where appropriate, and correct permission management.
Clarifying Remote Access and Local File Operations
'A network file system requires the entire remote file to be copied before reading' is incorrect because requests can retrieve portions. 'Remote files always behave identically to local files' is incorrect because network failures and protocol semantics affect operations. 'Network sharing automatically grants every client write access' is incorrect because servers enforce authentication and permissions.
Exam Focus: Client-Server Requests and Network Protocols
Trace a file request from application to client protocol, network, server, and underlying storage. Identify the responsibilities of NFS and SMB. Explain how remote file handles, authentication, and caching support distributed access. Questions may compare network file systems with NAS and SAN according to file-level access, block-level access, and sharing behaviour.
Key Terms of Network File Systems
- NFS - Network file-system protocol.
- SMB - Network file-sharing protocol.
- Client - Requests remote file services.
- Server - Provides network storage operations.
- File handle - Identifies a remote object.
- Remote access - File operations over a network.
📝 All Overview of Network file systems MCQs
Q1. What is the primary purpose of an index block in indexed allocation?
📖 Explanation: The index block does not contain actual file data; instead, it stores the addresses of each data block that belongs to the file. This allows the system to locate any block quickly. Option A is wrong because data is kept in separate blocks. Option C describes free‑space management, not indexing. Option D is unrelated to allocation. In practice, the index block acts like a table of contents, directing the OS to the correct disk locations.
Q2. When a new file is created, what initial value is assigned to each pointer in its index block?
📖 Explanation: At creation time every entry in the index block is set to a null value, indicating that no data block has been allocated yet. Zero or –1 are numeric placeholders that some systems might use, but the standard convention is a null pointer. The address of the first block cannot be stored until the block is actually allocated. This initialization prevents the OS from mistakenly treating an unassigned entry as a valid location.
Q3. Why does indexed allocation eliminate external fragmentation?
📖 Explanation: Indexed allocation allows each file block to be placed in any free disk block, since the index block records the exact location. Consequently, there is no need for contiguous space, avoiding gaps between files (external fragmentation). Storing data contiguously (A) would cause fragmentation, compression (B) is unrelated, and linked lists (C) describe a different allocation method. Real‑world systems benefit by using any available space efficiently.
Q4. What is the main trade‑off when using indexed allocation compared to linked allocation?
📖 Explanation: Indexed allocation incurs the cost of an entire index block even for tiny files, while linked allocation only adds a single pointer per block. This means higher metadata overhead (the index block) versus lower per‑block overhead (the link pointer). Reduced read/write speed (B) and fragmentation issues (C) are not the primary differences, and file deletion complexity (D) is similar for both schemes.
Q5. How does linking multiple index blocks affect the overhead and scalability of indexed allocation?
📖 Explanation: When a single index block cannot hold enough pointers, additional index blocks are linked together. Each extra block adds its own metadata overhead, increasing total space used, but the mechanism enables the file system to address many more blocks than a solitary index block could. Option A incorrectly suggests lower overhead, B is impossible because metadata is always required, and D offers no advantage. In large‑scale storage, this trade‑off is essential for handling big files.
Q6. In what situation would the overhead of an index block be considered wasteful?
📖 Explanation: If a file contains only one or two blocks, allocating a whole disk block just to hold a few pointers wastes space, because most of the index block remains unused. A large file (A) makes efficient use of the index block. Disk fullness (B) and SSD technology (D) do not change the fact that the index block size is fixed regardless of file size.
Q7. Why might a file system choose a smaller index block size despite the risk of insufficient pointers for large files?
📖 Explanation: A smaller index block reduces the amount of metadata that must be kept in memory, which can be critical on systems with limited RAM. Though this choice may require linking additional index blocks for very large files, the saved memory can improve overall system performance. Options B and D describe effects on data blocks, not metadata, and C is unrelated to allocation strategy.
Q8. A file has 80 blocks, and each index block can hold 100 pointers. Which statement is true?
📖 Explanation: Because the index block can store up to 100 pointers and the file only needs 80, a single index block is sufficient to reference every data block directly. Therefore, the file does not require additional index blocks, and there is no external fragmentation. Option B is unnecessary, C is impossible because every indexed file needs an index block, and D does not apply when all blocks are directly addressed.
Q9. A disk block is 4 KB and each pointer occupies 4 bytes. If one index block fits in a single disk block, how many data blocks can be addressed without linking another index block?
📖 Explanation: The number of pointers that fit in one index block equals the block size divided by pointer size: pointers. However, the question asks for the number of data blocks addressable without linking another index block, which is exactly the pointer count, 1024. The other choices miscalculate the division or use incorrect units. In real systems, this capacity determines the maximum file size before additional index blocks are needed.
Q10. A file needs 150 blocks, and each index block can hold 100 pointers. What is the minimum number of index blocks required?
📖 Explanation: The first index block can reference 100 blocks, leaving 50 blocks unaddressed. A second index block is needed for the remaining 50 pointers, so two index blocks in total are required. One index block (A) is insufficient, while three or four (C, D) would add unnecessary overhead. This calculation mirrors real‑world scenarios where the system must allocate extra index blocks to accommodate files larger than the capacity of a single block.
Q11. A disk block is 8 KB and each pointer is 8 bytes. If an index block occupies one disk block, how many data blocks can be addressed?
📖 Explanation: The number of pointers that fit in one index block equals the block size divided by pointer size: pointers. Thus, the index block can reference up to 1024 data blocks. Options B, C, and D result from incorrect division or using the wrong block size. Knowing this capacity helps system designers estimate the maximum file size before additional index blocks become necessary.
Q12. A file of 5000 blocks uses an index block capacity of 1024 pointers and links additional index blocks as needed. How many index blocks are required, and what is the total overhead in blocks?
📖 Explanation: Dividing 5000 by the 1024‑pointer capacity gives 4.88, meaning five index blocks are needed to hold all pointers. Each index block occupies one disk block, so the overhead equals five blocks. Option A incorrectly adds an extra overhead block, while C and D misstate the number of index blocks needed. This reflects how real file systems must allocate multiple index blocks for very large files.
Q13. When the first block of a file is written, the system obtains a free block and stores its address in the first index entry. If the free‑space manager runs out of blocks, what is the immediate effect?
📖 Explanation: If no free blocks are available, the allocation request cannot be satisfied, causing the file creation operation to fail. The system cannot create a file without at least one data block, so it returns an error. A crash (A) is far more severe than typical allocation failure, and the file cannot be created empty (C) because at least one block is required. Index blocks do not expand automatically (D); they are fixed‑size structures.
Q14. Which operation benefits most from direct access in a file system that uses a single index block per file?
📖 Explanation: Direct access allows the system to jump straight to any block using its pointer in the index block, making random reads very efficient. Sequential reading (A) can be performed without random access, appending (B) only needs the next free block, and deleting (D) does not rely on block positioning. In real applications such as databases, random block reads are common and gain the greatest speed advantage from indexed allocation.
Q15. Given two files, one with 2 blocks and another with 200 blocks, both using indexed allocation with a 1‑block index. Which file suffers more relative overhead due to the index block?
📖 Explanation: The overhead of the index block is a fixed cost independent of file size. For the 2‑block file, the index block represents a large fraction of the total storage (2 data blocks vs. 1 index block). For the 200‑block file, the index block is a tiny fraction of the total. Therefore, the smaller file incurs higher relative overhead. Options C and D ignore the proportional impact.
Q16. In a system where each index block includes a header of 128 bytes, and the disk block size is 4096 bytes, how many pointers can each index block store if each pointer is 4 bytes?
📖 Explanation: Subtract the header size from the total block size: bytes available for pointers. Divide by the pointer size: pointers. Thus, each index block can store 992 pointers. Options B, C, and D result from using the full block size or incorrect subtraction, leading to inaccurate counts. This calculation is essential when designing index structures to ensure enough address space for large files.
Q17. An indexed allocation scheme links additional index blocks when needed. If each index block can hold 50 pointers, and a file requires 120 blocks, how many index blocks are linked, and what is the pointer overhead for the index blocks themselves?
📖 Explanation: 120 blocks divided by 50 pointers per block gives 2.4, so three index blocks are required. The first two index blocks contain a pointer to the next block, creating two linking pointers; the last block does not need a forward pointer. Hence, the overhead is two pointers. Options with fewer index blocks cannot address all data, and three pointers would imply an extra unnecessary link.
Q18. Consider a file system where the index block is stored in memory for faster access, but disk reads are still required for data blocks. If the average seek time is 8 ms and transfer time per block is 0.5 ms, what is the expected time to read a randomly selected block from a file using indexed allocation (ignoring cache hits)?
📖 Explanation: Reading a random block requires moving the disk head to the block's location (seek time) and then transferring the block's data. The total time is the sum: . Options B, C, and D either add extra time or omit the transfer component. This estimate helps system engineers evaluate performance impacts of random I/O operations.