📝 The Mount Protocol in Network file systems (10 MCQs)
Establishing Access to Exported NFS Directories
The Network File System mount protocol is used in traditional NFS arrangements to obtain a file handle for a directory exported by a remote server. It allows a client to establish a relationship between a local mount point and a remote filesystem location. The mount operation makes the remote directory accessible through the client's pathname hierarchy without copying its contents locally.
Why Remote Filesystems Require Initial Mount Negotiation
A client must identify an exported directory and obtain an identifier that allows subsequent remote operations to refer to it. The mount protocol provides this initial interaction in traditional NFS versions. It separates the task of obtaining a remote filesystem reference from ordinary file operations, which are handled through the NFS protocol itself.
Mount Request, Export Validation and File Handle
The client sends a mount request identifying the desired exported pathname. The server checks its export configuration and access rules. If the request is permitted, the server returns a file handle representing the exported directory. The client uses that handle to establish its mount and perform subsequent operations through the NFS service.
Mounting a Remote Exported Directory
Suppose an NFS server exports /srv/shared and a client wants to access it at /mnt/shared. The client sends the mount request for the exported pathname. After validating the request, the server returns the directory's file handle. The client associates this remote reference with /mnt/shared, making the exported files accessible through that local path.
Remote Accessibility and Protocol-Version Differences
The mount protocol provides a standardised way to obtain access to exported directories in traditional NFS environments. However, authentication, export permissions, server availability, and file-handle validity affect mounting success. NFS versions differ in their mounting and session procedures; the separate MOUNT protocol is characteristic of NFSv2 and NFSv3, while NFSv4 uses a different integrated namespace and filesystem access model.
Distinguishing Mount Protocol from NFS Operations
'The mount protocol transfers every file in the export' is incorrect because it establishes a remote filesystem reference. 'The returned file handle contains complete file contents' is incorrect because it identifies a filesystem object. 'Every NFS version uses the traditional MOUNT procedure' is incorrect because NFSv4 follows a different integrated access model.
Exam Focus: Mount Requests and Remote File Handles
Trace the traditional NFS mount sequence from client request through export validation to file-handle return. Explain how the local mount point provides pathname access to the remote directory. Distinguish the mount protocol from ordinary NFS file operations and recognise the important procedural differences between NFSv2/v3 and NFSv4.
Key Terms of the NFS Mount Protocol
- Mount protocol - Establishes remote export access.
- Export - Server directory offered remotely.
- Mount point - Client directory for attachment.
- File handle - Identifies a remote filesystem object.
- NFS server - Provides remote file services.
- NFSv4 - Uses an integrated access model.
📝 All The Mount Protocol in Network file systems MCQs
Q1. What value is initially stored in each entry of an index block when a new file is created?
📖 Explanation: The correct answer is \null\ because a fresh index block must indicate that no disk blocks have been assigned yet. Option A (0) would suggest a valid block address, which is incorrect. Option B (-1) is sometimes used as a sentinel but the standard convention here is null. Option D (empty string) is not a valid pointer type. In practice, a null entry tells the file system that the corresponding block must be allocated before data can be written, ensuring correct allocation behavior.
Q2. Why does indexed allocation avoid external fragmentation compared to linked allocation?
📖 Explanation: Indexed allocation avoids external fragmentation because each file block can be placed in any free disk block, and the index block simply records those locations. Option A is wrong because the pointers are kept on disk, not necessarily in RAM. Option B describes linked allocation, which still suffers from fragmentation when blocks become scattered. Option D is incorrect because the size of the index block does not directly affect fragmentation. The correct choice explains that the flexibility of choosing any free block prevents gaps from forming.
Q3. How does the overhead of an index block compare to the pointer overhead of linked allocation for a two‑block file?
📖 Explanation: For a file consisting of only two blocks, indexed allocation requires an entire index block even though only two pointers are needed, so its overhead is higher than linked allocation, which adds just one pointer per block. Option A is wrong because the index block adds extra space regardless of the number of pointers. Option C is inaccurate; linked allocation uses fewer bytes for two pointers. Option D is misleading since the overhead difference is fixed for this case, not variable with file size. The higher overhead reflects the cost of reserving a full block for pointers.
Q4. A database stores a log file that initially occupies one block. After heavy activity, the file grows to 150 blocks. Which allocation strategy would minimize wasted space while still permitting direct access?
📖 Explanation: Using multiple index blocks linked together (multi‑level indexing) allows the system to add new index blocks as the file expands, avoiding the waste of a single large index block for a small file while preserving direct access. Option A would waste space because a single index block must hold 150 pointers, many of which may be unused early on. Option B loses the advantage of direct access, requiring sequential traversal. Option D adds unnecessary complexity without solving the waste issue. The correct approach balances space efficiency and random‑access capability.
Q5. If a file system reserves one disk block for an index block that can hold 100 pointers, what is the maximum file size (in blocks) that can be addressed without adding another index block?
📖 Explanation: An index block that holds 100 pointers can directly reference up to 100 data blocks, so the maximum file size addressable is 100 blocks. Option B (99) underestimates the capacity; each pointer can be used. Option C (101) exceeds the pointer count, requiring an additional index block. Option D (200) would need two index blocks. Understanding the pointer capacity of the index block is essential for planning storage limits and ensuring that the file system can allocate enough space for growing files.
Q6. A file system uses indexed allocation. When the third block of a file is written, what steps occur?
📖 Explanation: When the third block is written, the system locates the third entry in the existing index block (which was initially null) and replaces that null with the address of the newly allocated disk block. Option A is unnecessary because the existing index block already has space for the pointer. Option C describes linked allocation, not indexed. Option D is unrelated to writing a new block. The correct step updates the index block, enabling direct access to the new block.
Q7. Which characteristic of indexed allocation most directly contributes to its ability to provide direct access to any block?
📖 Explanation: Direct access is achieved because the index block contains a pointer for each logical block, allowing the system to jump directly to the required disk location. Option A (linked list) forces sequential traversal, eliminating direct access. Option B (contiguous data) would also allow direct access but is not typical for indexed allocation. Option D (fixed‑size chunks) does not explain the pointer mechanism. The separate index block is the key structure that maps logical positions to physical addresses instantly.
Q8. A video editing application stores a 2‑GB video file using indexed allocation with a block size of 4 KB. Approximately how many pointers must the index block contain?
📖 Explanation: The file size divided by the block size gives the number of blocks, and each block requires one pointer in the index block, so the correct calculation is pointers. Option A repeats the calculation but labels it incorrectly as pointers without context; however, it is essentially the same value, making it ambiguous. Option C multiplies instead of dividing, leading to an astronomically large number. Option D uses a far smaller result, miscalculating the division. Understanding the relationship between file size, block size, and pointer count is crucial for estimating index block overhead.
Q9. When an index block becomes full, which mechanism is typically employed to continue supporting larger files?
📖 Explanation: The standard method is to link additional index blocks, forming a chain that can be traversed to find pointers beyond the capacity of the first block. Option A would require moving all pointers, which is costly and error‑prone. Option C (compression) is not practical for pointer storage. Option D (deleting pointers) would lose data. Linking new index blocks preserves existing pointers and extends the file’s addressable range, ensuring scalability without data loss.
Q10. A system administrator notices that many small files are consuming a disproportionate amount of disk space due to indexed allocation. Which change would most effectively reduce this waste?
📖 Explanation: Switching to linked allocation for small files eliminates the need for a full index block when only one or two pointers are required, directly reducing wasted space. Option A (larger block size) would increase internal fragmentation. Option C adds complexity without addressing the specific waste caused by index blocks. Option D (single large index block) would dramatically increase waste. The correct solution matches the allocation method to file size, optimizing space usage.