File System Implementation
- 55Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the primary purpose of a file system?
What is the primary purpose of a file system?
55 questions
- 1
What is the primary purpose of a file system?
- A
To replace device drivers with application programs
- B
To organize stored data and provide users with accessible files
- C
To increase the physical rotation speed of a disk
- D
To eliminate the need for memory during file access
Correct answer
BTo organize stored data and provide users with accessible files
Explanation
A file system organizes data on a storage device and provides users and applications with a logical way to access that data.
- A
- 2
Why are storage blocks commonly sized as powers of two?
- A
Powers of two prevent files from ever becoming fragmented
- B
Powers of two ensure that every file occupies exactly one physical sector
- C
Powers of two allow users to access hardware without device drivers
- D
Powers of two allow sizes used by different layers and devices to fit together efficiently
Correct answer
DPowers of two allow sizes used by different layers and devices to fit together efficiently
Explanation
Storage sizes are often powers of two so that sectors, blocks, and other units can fit into one another without awkward mismatches.
- A
- 3
What is the relationship between sectors and logical blocks?
- A
A logical block may be composed of multiple physical sectors
- B
A physical sector contains the entire file system structure
- C
A logical block exists only in main memory and never on storage
- D
A physical sector must always contain multiple logical blocks
Correct answer
AA logical block may be composed of multiple physical sectors
Explanation
A logical block can consist of several sectors. Therefore, retrieving one logical block may require multiple device-access commands.
- A
- 4
What information does a file control block primarily store?
- A
Only the physical temperature of the storage device
- B
Only the name of the operating system currently running
- C
Instructions for compiling application source code
- D
Metadata describing a file and information needed to locate it
Correct answer
DMetadata describing a file and information needed to locate it
Explanation
A file control block stores information about a file, such as its name, size, creation date, and location-related details.
- A
- 5
What is the role of a device driver in file access?
- A
It converts every file into a contiguous sequence of memory addresses
- B
It decides which users are allowed to create directory names
- C
It permanently stores all file metadata in the processor
- D
It performs the hardware-specific operations needed to access the storage device
Correct answer
DIt performs the hardware-specific operations needed to access the storage device
Explanation
Device drivers carry out the physical, device-specific operations, such as accessing a particular cylinder, track, and sector.
- A
- 6
Why does a general-purpose operating system use multiple layers for storage access?
- A
The layers make physical device access unnecessary
- B
The layers hide device differences while presenting a consistent interface to users and applications
- C
The layers prevent operating systems from supporting more than one file system
- D
The layers ensure that every storage device uses identical hardware
Correct answer
BThe layers hide device differences while presenting a consistent interface to users and applications
Explanation
Layering allows users and applications to access files in a consistent way even when devices have different hardware and device drivers.
- A
- 7
What is a major benefit of adding a new device, such as a USB drive, to a layered file-system design?
- A
The entire operating system must use a different directory structure
- B
All existing files must be copied to the new device
- C
Every application must be rewritten to understand the new hardware
- D
Only the device-specific driver needs to handle the new hardware differences
Correct answer
DOnly the device-specific driver needs to handle the new hardware differences
Explanation
The device driver handles the USB device's hardware-specific behavior, while higher layers can continue to operate in the same general way.
- A
- 8
Why does a storage controller commonly include a buffer?
- A
It converts all logical file names into executable programs
- B
It allows the disk to store files without using any physical sectors
- C
It temporarily holds data so the device and computer do not need to be synchronized exactly
- D
It permanently replaces the storage device's file allocation structure
Correct answer
CIt temporarily holds data so the device and computer do not need to be synchronized exactly
Explanation
A buffer holds data read from the device until the computer is ready to receive it, avoiding the need to halt the entire system while waiting for disk operations.
- A
- 9
Why must file-system structures such as directory information and file control blocks be stored on the storage device?
- A
They are stored on the device solely to increase processor speed
- B
They are stored on the device because memory cannot hold any metadata
- C
They must be available only while the computer is running
- D
They must survive power-off so the system can reconstruct its organization later
Correct answer
DThey must survive power-off so the system can reconstruct its organization later
Explanation
Persistent storage is required because directory structures and file control blocks must still exist after the computer is turned off.
- A
- 10
What is the purpose of a boot control block?
- A
It contains information that helps start an operating system from a storage device
- B
It stores every free block as a separate processor register
- C
It determines the color label assigned to each file
- D
It records the order in which users opened files
Correct answer
AIt contains information that helps start an operating system from a storage device
Explanation
A boot control block contains information needed to start an operating system from the relevant storage device.
- A
- 11
Which information is typically needed to describe a storage volume?
- A
The keyboard layout and screen resolution of every user
- B
The source code of every application stored on it
- C
Its block count, boundaries, and amount of used and free space
- D
The rotation speed of every processor in the system
Correct answer
CIts block count, boundaries, and amount of used and free space
Explanation
A volume needs information about its size, beginning and end, and which space is used or free.
- A
- 12
Why is a directory structure needed instead of treating all files as one undifferentiated pool?
- A
It guarantees that every file occupies contiguous blocks
- B
It prevents files from requiring metadata
- C
It organizes files so they can be located and managed more easily
- D
It allows users to bypass the operating system
Correct answer
CIt organizes files so they can be located and managed more easily
Explanation
Directories provide structure for organizing files and help the system locate the data associated with a named file.
- A
- 13
Why are directory structures and file control blocks often copied into memory?
- A
Keeping them in memory ensures that files remain permanently contiguous
- B
Keeping them in memory avoids repeatedly reading the disk to locate files
- C
Keeping them in memory changes physical sectors into logical files
- D
Keeping them in memory eliminates the need to save metadata on disk
Correct answer
BKeeping them in memory avoids repeatedly reading the disk to locate files
Explanation
When directory and file metadata are in memory, the system can locate file data without first performing another disk access.
- A
- 14
What problem would occur if a system had to read the directory from disk every time it accessed a file?
- A
File access could require an additional disk operation before the data operation
- B
Files would automatically become larger than their allocated blocks
- C
The storage device would no longer need a file system
- D
The operating system would lose all knowledge of file names
Correct answer
AFile access could require an additional disk operation before the data operation
Explanation
The system would first access the directory to find the file's location and then access the file data, effectively adding another storage operation.
- A
- 15
What does mounting mean in a file-system context?
- A
Converting a physical disk into a single unformatted sector
- B
Connecting a partition or volume to a location in the system's file-system namespace
- C
Copying every file from a device into processor registers
- D
Deleting the directory structure before removing a device
Correct answer
BConnecting a partition or volume to a location in the system's file-system namespace
Explanation
Mounting connects a partition or storage volume to a location where the operating system can access it through its file-system structure.
- A
- 16
Why can removing a storage device without notifying the operating system cause data loss?
- A
Modified metadata or data may still be in memory and not yet written to the device
- B
The physical sectors will immediately become permanently unreadable
- C
The operating system will erase every file that was previously read
- D
The device will automatically change all file names when disconnected
Correct answer
AModified metadata or data may still be in memory and not yet written to the device
Explanation
Changes to data, directories, file control blocks, or pointers may remain in memory. Removing the device before writing them back can leave the stored structures inconsistent.
- A
- 17
What is the purpose of a file-system consistency check during system startup?
- A
It verifies that directory entries, pointers, and stored data structures agree with one another
- B
It compresses every file before the operating system loads
- C
It changes all files into one contiguous allocation
- D
It determines which applications the user prefers
Correct answer
AIt verifies that directory entries, pointers, and stored data structures agree with one another
Explanation
A consistency check verifies that files and directories point to valid, appropriate locations and that the file system is internally coherent.
- A
- 18
What is a root partition generally used for?
- A
It is used only for removable USB devices
- B
It contains only temporary buffers for device controllers
- C
It is the main partition that commonly contains the operating system
- D
It stores exclusively deleted files awaiting recovery
Correct answer
CIt is the main partition that commonly contains the operating system
Explanation
Most systems have a root partition that serves as the main partition and commonly stores the operating system.
- A
- 19
How does a linear-list directory implementation locate a file?
- A
It searches only the first and last directory entries
- B
It examines directory entries sequentially until it finds the desired name
- C
It calculates a unique location directly from the file's contents
- D
It follows pointers stored only in the file's final data block
Correct answer
BIt examines directory entries sequentially until it finds the desired name
Explanation
A linear-list directory stores entries in sequence, so the system searches through them one by one.
- A
- 20
Why does searching a linear directory list take, on average, about half the list length?
- A
Each directory entry is searched twice to verify its contents
- B
The list is divided into two equal directories before every search
- C
The system always examines exactly half of the entries before stopping
- D
A randomly located entry is expected to appear around the middle of the list
Correct answer
DA randomly located entry is expected to appear around the middle of the list
Explanation
If the target is equally likely to occur anywhere in the list, the average search examines approximately half of the entries.
- A
- 21
What is the main advantage of a linear-list directory?
- A
It automatically prevents directory fragmentation
- B
It eliminates the need to store file names
- C
It is simple to implement even though searching can be slow
- D
It guarantees constant-time lookup for every file
Correct answer
CIt is simple to implement even though searching can be slow
Explanation
Linear lists are straightforward to implement, but their sequential searches become inefficient as the directory grows.
- A
- 22
How does a hash table improve directory lookup?
- A
It uses a function to map a file name or key to a likely storage location
- B
It stores all directory entries in alphabetical order and scans them sequentially
- C
It places every file in physically adjacent blocks
- D
It copies the entire directory into every data block
Correct answer
AIt uses a function to map a file name or key to a likely storage location
Explanation
A hash function maps a key, such as a file name, to a location, allowing the system to locate an entry more directly than with a linear search.
- A
- 23
What property is expected from a hash function used for directory lookup?
- A
The hash value must depend on the current disk head position
- B
Different inputs must always produce the same hash value
- C
The same input should consistently produce the same hash value
- D
The function must return the complete file contents
Correct answer
CThe same input should consistently produce the same hash value
Explanation
A hash function should consistently map the same input to the same value, allowing the system to locate the same directory entry reliably.
- A
- 24
What is a hash collision?
- A
A situation in which a file occupies two contiguous extents
- B
A situation in which different inputs produce the same hash value
- C
A situation in which a disk buffer contains an entire file
- D
A situation in which a directory contains no free entries
Correct answer
BA situation in which different inputs produce the same hash value
Explanation
A collision occurs when two different inputs map to the same hash value, which requires additional handling by the hash-table implementation.
- A
- 25
What is the defining feature of contiguous file allocation?
- A
A file's blocks are selected randomly without any location information
- B
A file occupies consecutive blocks on the storage device
- C
All files share one block regardless of their sizes
- D
Each file block contains a pointer to a different file
Correct answer
BA file occupies consecutive blocks on the storage device
Explanation
With contiguous allocation, the blocks belonging to a file are located one after another on the storage device.
- A
- 26
Why does contiguous allocation usually provide good sequential performance?
- A
The system can read neighboring file blocks in sequence with little head movement
- B
The system never needs to know the file's starting location
- C
The file is automatically copied into main memory before use
- D
The allocation method eliminates all metadata accesses
Correct answer
AThe system can read neighboring file blocks in sequence with little head movement
Explanation
Because the blocks are adjacent, sequential access requires relatively little movement between blocks, which improves performance.
- A
- 27
What is a major disadvantage of contiguous allocation for files that change size?
- A
A fixed-size file always requires an index block for every sector
- B
A growing file may need to be moved if adjacent blocks are already occupied
- C
A file cannot be deleted without formatting the entire device
- D
A growing file can never be read sequentially
Correct answer
BA growing file may need to be moved if adjacent blocks are already occupied
Explanation
If a file grows into space occupied by another file, it may need to be relocated to a sufficiently large free region.
- A
- 28
How can contiguous allocation contribute to external fragmentation?
- A
Every file automatically creates an additional copy of its metadata
- B
The disk head is forced to visit every block during every access
- C
Free space can become divided into holes that are individually too small for a new file
- D
The system stores all free blocks inside the file contents
Correct answer
CFree space can become divided into holes that are individually too small for a new file
Explanation
Contiguous allocation requires large consecutive regions. Over time, free space may be split into smaller holes that cannot accommodate larger files.
- A
- 29
What is compaction in the context of contiguous allocation?
- A
Rearranging allocated files to combine separated free regions into a larger contiguous region
- B
Copying the free-space map into the boot control block
- C
Converting a directory into a hash table
- D
Adding a pointer to the end of every file block
Correct answer
ARearranging allocated files to combine separated free regions into a larger contiguous region
Explanation
Compaction moves files so that scattered free spaces are combined into larger contiguous areas.
- A
- 30
What is an extent?
- A
A single pointer that identifies the root partition
- B
A bitmap bit representing an unused sector
- C
A directory entry containing only a file name
- D
A contiguous group of blocks allocated to a file as one unit
Correct answer
DA contiguous group of blocks allocated to a file as one unit
Explanation
An extent is a contiguous set of blocks allocated together. A file can receive additional extents as it grows.
- A
- 31
Why can extent-based allocation waste space?
- A
The system duplicates every extent in the directory structure
- B
The system cannot use any block outside the first extent
- C
The system must reserve every block on the disk for each file
- D
The system may reserve an extent larger than the file currently needs
Correct answer
DThe system may reserve an extent larger than the file currently needs
Explanation
If an extent is allocated in advance and the file uses only part of it, the unused reserved blocks represent wasted space.
- A
- 32
What is the main advantage of allocating file blocks individually and linking them?
- A
The method ensures that every disk access reads the entire file
- B
Every file is guaranteed to remain physically contiguous
- C
A file can grow by receiving additional blocks without requiring one large contiguous region
- D
The method removes the need to track free blocks
Correct answer
CA file can grow by receiving additional blocks without requiring one large contiguous region
Explanation
Linked allocation allows a file to use free blocks wherever they are available, so it can grow incrementally.
- A
- 33
What is the main performance disadvantage of linked allocation?
- A
The blocks of one file may be scattered, causing frequent disk-head movement
- B
The first block of every file must be stored in the root partition
- C
The file system must reserve unused blocks after every allocated block
- D
The system cannot determine the file's length
Correct answer
AThe blocks of one file may be scattered, causing frequent disk-head movement
Explanation
Linked blocks may be physically far apart, requiring the storage device to move between locations during access.
- A
- 34
Why can a damaged pointer be especially serious in a linked allocation system?
- A
The damaged pointer affects only unrelated directory names
- B
The system can always reconstruct the next block from the file size alone
- C
The system may lose the location of all subsequent blocks in the file
- D
The system will automatically convert the file into contiguous allocation
Correct answer
CThe system may lose the location of all subsequent blocks in the file
Explanation
Each block identifies the next block, so a broken link can prevent the system from following the chain to later parts of the file.
- A
- 35
How does a file allocation table improve the management of linked allocation?
- A
It replaces the need for a starting block
- B
It stores only the file's creation date and user permissions
- C
It guarantees that all blocks in the chain are physically adjacent
- D
It records the chain of blocks associated with a file using a table of block links
Correct answer
DIt records the chain of blocks associated with a file using a table of block links
Explanation
A file allocation table records which block follows each block, allowing the system to track a file's linked allocation chain.
- A
- 36
What limitation does a basic linked allocation scheme have when it stores only a starting block?
- A
It prevents the system from deleting files
- B
It may not detect that the complete file is missing or incomplete
- C
It forces every file to use contiguous blocks
- D
It cannot store files that occupy more than one block
Correct answer
BIt may not detect that the complete file is missing or incomplete
Explanation
If only the starting block is recorded, the system may follow a chain that ends prematurely without knowing whether all expected file blocks are present.
- A
- 37
What is the purpose of storing an end-block indicator or expected end location for a file?
- A
It makes every block in the file contiguous
- B
It records how much processor memory is available
- C
It identifies the next file in the directory alphabetically
- D
It provides a way to verify that the block chain reaches the expected end of the file
Correct answer
DIt provides a way to verify that the block chain reaches the expected end of the file
Explanation
An expected end marker or end location allows the system to compare the actual chain with the file's recorded endpoint.
- A
- 38
How does indexed allocation reduce the number of disk accesses needed for a linked file?
- A
An index block lists the locations of many file blocks so they can be requested more directly
- B
The index block copies all file data into one contiguous region
- C
The index block forces the disk head to read blocks one at a time
- D
The index block eliminates the need to store file blocks on disk
Correct answer
AAn index block lists the locations of many file blocks so they can be requested more directly
Explanation
An index block contains references to multiple data blocks, allowing the system to locate and request them without following every pointer through the data blocks.
- A
- 39
What is a trade-off of using an index block?
- A
It makes all file blocks physically contiguous
- B
It adds metadata overhead and may use space that does not contain file data
- C
It removes the need for a directory structure
- D
It prevents files from growing beyond one data block
Correct answer
BIt adds metadata overhead and may use space that does not contain file data
Explanation
Index blocks require storage space and an additional structure, although this overhead may be worthwhile because access can be faster.
- A
- 40
What is single indirect allocation?
- A
A pointer refers to an index block that refers to another index block
- B
A pointer refers to an index block, which refers directly to data blocks
- C
A pointer refers directly to data blocks without using an index
- D
A file is stored entirely in one contiguous extent
Correct answer
BA pointer refers to an index block, which refers directly to data blocks
Explanation
In single indirect allocation, the file structure points to one index block, whose entries point to the file's data blocks.
- A
- 41
What is double indirect allocation?
- A
A file is stored in two equal-sized contiguous extents
- B
Two directories contain identical copies of every file
- C
A pointer refers to an index block whose entries refer to additional index blocks
- D
A pointer refers directly to two adjacent data blocks
Correct answer
CA pointer refers to an index block whose entries refer to additional index blocks
Explanation
Double indirect allocation adds another indexing level: the first index points to other index blocks, which then point to data blocks.
- A
- 42
Why might a file system combine direct, single indirect, double indirect, and triple indirect references?
- A
The combination guarantees that every file remains contiguous
- B
Different levels provide efficient access for files of different sizes
- C
The combination prevents all storage devices from using buffers
- D
Different levels are required because every file has exactly three blocks
Correct answer
BDifferent levels provide efficient access for files of different sizes
Explanation
Direct references are efficient for small files, while additional indirect levels allow much larger files to be addressed.
- A
- 43
Why is an extra CPU instruction often preferable to an extra disk access?
- A
CPU instructions eliminate the need for file allocation
- B
Disk accesses never provide useful data to the operating system
- C
CPU instructions permanently store data without using memory
- D
CPU instructions are generally much faster than accessing secondary storage
Correct answer
DCPU instructions are generally much faster than accessing secondary storage
Explanation
Secondary-storage access is much slower than executing an additional processor instruction, so systems often trade computation for fewer disk operations.
- A
- 44
What does a bitmap-based free-space structure represent?
- A
It uses one pointer per directory to indicate the root partition
- B
It uses one complete file per bit to indicate directory membership
- C
It uses one byte per processor instruction to indicate file size
- D
It uses one bit per block to indicate whether that block is available
Correct answer
DIt uses one bit per block to indicate whether that block is available
Explanation
A bitmap assigns one bit to each block. In the described convention, a value of 1 indicates a usable free block and 0 indicates a block that cannot be used.
- A
- 45
What is a disadvantage of a bitmap for a very large storage device?
- A
A bitmap can identify only the first free block
- B
A bitmap cannot represent blocks that are already allocated
- C
The bitmap itself can require substantial memory or storage space
- D
A bitmap requires every file to be stored contiguously
Correct answer
CThe bitmap itself can require substantial memory or storage space
Explanation
Because the bitmap uses one bit for every block, a very large device can require a significant amount of space to store or process the bitmap.
- A
- 46
How does a linked free-space list track available blocks?
- A
It stores a starting free block and links that block to other free blocks
- B
It records only allocated blocks and ignores all unused space
- C
It stores every free block as a complete copy of the directory
- D
It places all free blocks into one permanently contiguous region
Correct answer
AIt stores a starting free block and links that block to other free blocks
Explanation
A linked free-space list begins with a known free block and follows links to locate additional free blocks.
- A
- 47
What additional information can grouped free-space management provide beyond a simple free-block list?
- A
It can guarantee that no future file will become fragmented
- B
It can eliminate all storage-device access during allocation
- C
It can identify the contents of every file without reading metadata
- D
It can record the start and size of each contiguous group of free blocks
Correct answer
DIt can record the start and size of each contiguous group of free blocks
Explanation
Grouping records both where a free run begins and how many contiguous blocks it contains, helping the system choose an appropriately sized region.
- A
- 48
Why are metaslabs useful on extremely large storage systems?
- A
They replace all file control blocks with processor instructions
- B
They make directory searches independent of file names
- C
They force every file to occupy the same number of blocks
- D
They divide free-space information into smaller regions instead of requiring one structure for the entire device
Correct answer
DThey divide free-space information into smaller regions instead of requiring one structure for the entire device
Explanation
Dividing the storage space into multiple regions makes free-space management more practical than maintaining one enormous map for the entire system.
- A
- 49
How can read-ahead improve file-system performance?
- A
It delays every read until the entire device is empty
- B
It converts all indirect pointers into direct pointers
- C
It retrieves nearby blocks before they are explicitly requested
- D
It reduces the size of every storage block
Correct answer
CIt retrieves nearby blocks before they are explicitly requested
Explanation
If sequential access is likely, the system can fetch neighboring blocks in advance so later requests can be satisfied from a buffer or cache.
- A
- 50
What is the purpose of a cache in storage access?
- A
It keeps recently or predictively accessed data available for faster reuse
- B
It ensures that every request must go directly to the physical disk
- C
It stores only unused blocks and discards all recently used data
- D
It makes device drivers unnecessary
Correct answer
AIt keeps recently or predictively accessed data available for faster reuse
Explanation
A cache stores data that may be needed again, allowing future accesses to avoid slower device operations.
- A
- 51
What is write-behind or delayed writing intended to accomplish?
- A
It writes every changed byte immediately before any other operation
- B
It prevents modified data from ever being written to storage
- C
It postpones writes so several changes can be grouped into more efficient operations
- D
It converts all writes into directory searches
Correct answer
CIt postpones writes so several changes can be grouped into more efficient operations
Explanation
Delayed writing can allow multiple writes to be combined and performed together, reducing overhead and improving efficiency.
- A
- 52
What is a major risk of delayed writing when a removable device is disconnected improperly?
- A
Changes still in memory may not reach the device, causing lost data or inconsistent metadata
- B
The device will automatically become a root partition
- C
The file system will gain additional free blocks
- D
All cached data will be converted into contiguous files
Correct answer
AChanges still in memory may not reach the device, causing lost data or inconsistent metadata
Explanation
If pending writes are not flushed before removal, file data, directory structures, or pointers may remain outdated on the device.
- A
- 53
Why might a file system prefetch several neighboring blocks after one block is requested?
- A
Sequential access makes it likely that nearby blocks will be needed soon
- B
The storage device cannot read a single block by itself
- C
Neighboring blocks always belong to the same file
- D
Prefetching prevents all forms of fragmentation
Correct answer
ASequential access makes it likely that nearby blocks will be needed soon
Explanation
For sequential workloads, nearby blocks are likely to be requested next, so prefetching them can reduce future access delays.
- A
- 54
Which allocation strategy is most naturally suited to data that rarely changes size and benefits from fast sequential access?
- A
Random linked allocation
- B
Unindexed free-space chaining
- C
A directory-only allocation scheme
- D
Contiguous allocation
Correct answer
DContiguous allocation
Explanation
Contiguous allocation provides fast sequential access and is particularly suitable for relatively unchanging data, such as operating-system files.
- A
- 55
Why might an operating system place relatively stable system files in a separate partition or file system?
- A
Separate partitions eliminate the need for device drivers
- B
A simple, fast allocation method can be used without needing to accommodate frequent file growth
- C
Partitioning guarantees that all user data will remain contiguous
- D
System files cannot be stored alongside user files under any file system
Correct answer
BA simple, fast allocation method can be used without needing to accommodate frequent file growth
Explanation
Stable system files are less likely to grow or shrink, so a fast contiguous scheme may work well for them, while user data can use a more flexible system.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.