File Systems Overview
- 31Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Define a file in the context of an operating system.
31 questions
- 1
Define a file in the context of an operating system.
Model answer
A file is a contiguous logical address space where data is stored, though physically it may be split across multiple locations.
Explanation
The logical address space is contiguous from the user's perspective, but the operating system may store it non-contiguously on disk.
- 2
List at least five common file attributes found in most operating systems.
Model answer
Common file attributes include name, type, size, location, creation date, modification date, and access permissions.
Explanation
These attributes help the OS manage files; additional attributes may vary by system.
- 3
What is the purpose of the file API provided by the operating system?
Model answer
The file API allows programmers to perform file operations (create, read, write, etc.) without worrying about the underlying storage details.
Explanation
The OS handles low-level details like disk layout, caching, and permissions, simplifying application development.
- 4
Why is it important to close files after opening them?
Model answer
Failing to close files can exhaust system resources because the OS must maintain a table of open files; closing frees those resources.
Explanation
If files are never closed, the open-file table grows indefinitely, eventually causing system failure.
- 5
Explain the difference between exclusive and shared file locks.
Model answer
An exclusive lock prevents other users from modifying the file (read-only access only), while a shared lock allows multiple users to read and write concurrently, often with record-level locking.
Explanation
Exclusive locks are used when one user edits a file; shared locks allow collaborative editing.
- 6
What is record-level locking and why is it used?
Model answer
Record-level locking allows multiple users to access the same file simultaneously but locks only the specific record being modified, preventing conflicts.
Explanation
It is crucial for large databases where many users need concurrent access to different records.
- 7
Describe sequential access and give an example of a storage medium that uses it.
Model answer
Sequential access reads data in order from beginning to end; to reach a specific record, all preceding data must be read. Tape drives use sequential access.
Explanation
Tape drives are still used for cheap bulk storage where random access speed is not critical.
- 8
What is direct access and how does it differ from sequential access?
Model answer
Direct access allows the system to go immediately to any record without reading previous ones, unlike sequential access which requires reading through all prior data.
Explanation
Hard disks and SSDs provide direct access; the OS uses an index to locate files quickly.
- 9
Explain the concept of indexed sequential access and give an example of its use.
Model answer
Indexed sequential access combines an index that points to record locations with sequential reading of the data. It is used in ISAM databases and tape backup systems with indices.
Explanation
The index is read first to find the approximate location, then the data is read sequentially from that point.
- 10
Why are tape drives still used in large-scale storage systems?
Model answer
Tape drives are cheap, can store terabytes of data per cartridge, and are ideal for backups and archival storage where access speed is less critical.
Explanation
They offer low cost per gigabyte and high reliability for long-term storage.
- 11
What is the difference between a simple file and a fixed-length record file?
Model answer
A simple file contains lines of text of variable length, while a fixed-length record file has records with fields of predetermined sizes, making each record the same length.
Explanation
Fixed-length records simplify indexing and random access because each record's offset can be calculated mathematically.
- 12
Describe a binary file and how it differs from a text file.
Model answer
A binary file uses any binary values, not just characters, and its structure is interpreted by the application; a text file stores only printable characters in lines.
Explanation
Binary files include executables, images, and complex data structures; the OS does not interpret the content.
- 13
What is a file extension and is it always required?
Model answer
A file extension is a suffix that indicates the file type (e.g., .txt, .exe), but it is not required; it is a convention used by some systems like Windows.
Explanation
Unix systems often do not rely on extensions; the file type is stored internally or determined by magic numbers.
- 14
Explain the purpose of disk partitioning and give one reason to use multiple partitions.
Model answer
Disk partitioning divides a disk into separate sections; a common reason is to separate the operating system and executables from user data for easier backup.
Explanation
Partitions can also be used for different file systems or users.
- 15
What does formatting a partition do and why might different file systems be chosen?
Model answer
Formatting a partition creates a file system structure on it; different file systems are optimized for different use cases, e.g., large video files vs. many small files.
Explanation
The choice affects performance, maximum file size, and other characteristics.
- 16
Define a volume in the context of file systems.
Model answer
A volume is a formatted partition that has its own file system and is accessible by the OS as a logical storage unit.
Explanation
The term is often used interchangeably with partition but emphasizes the logical view after formatting.
- 17
How can multiple physical disks appear as a single volume?
Model answer
By spanning a partition across multiple disks, the OS treats them as one logical volume, e.g., for storing large video files.
Explanation
This is common in RAID and storage area networks.
- 18
What is a mount point and how does automatic mounting work in modern systems?
Model answer
A mount point is a location in the directory tree where a file system is attached; automatic mounting detects new devices (e.g., USB drives) and makes them accessible without user intervention.
Explanation
The OS assigns a drive letter or a path under /media or /mnt.
- 19
Describe the single-level directory structure and its limitation.
Model answer
A single-level directory has all files in one flat list; it requires unique file names and provides no grouping, leading to naming conflicts.
Explanation
This is why early systems and some users' desktops become cluttered.
- 20
What is a two-level directory structure?
Model answer
A two-level directory gives each user their own subdirectory, allowing duplicate file names across users but still no grouping within a user's files.
Explanation
It improves organization over single-level but remains limited.
- 21
Explain the tree-structured directory and its advantages.
Model answer
A tree-structured directory allows directories to contain files and subdirectories, forming a hierarchy. It provides efficient search, grouping, and unique absolute paths.
Explanation
This is the standard structure used by most modern operating systems.
- 22
What is the difference between an absolute path and a relative path?
Model answer
An absolute path starts from the root and specifies the full path to a file; a relative path is based on the current directory and uses '.' and '..' to navigate.
Explanation
Absolute paths are unique and independent of the current directory; relative paths are shorter and context-dependent.
- 23
What is a graph-structured directory and how does it differ from a tree?
Model answer
A graph-structured directory allows links (pointers) between directories, creating cycles and shared subdirectories; a tree has no cycles and each node has exactly one parent.
Explanation
Graphs enable file sharing but complicate deletion because of multiple references.
- 24
How does a system handle deletion of a file that has multiple links?
Model answer
The system uses back pointers or reference counts: the file is only deleted when all links are removed; otherwise it remains.
Explanation
This prevents dangling pointers and ensures data integrity.
- 25
What is garbage collection in the context of file systems?
Model answer
Garbage collection is a process that scans the directory graph to find and reclaim storage from files that are no longer referenced (dangling links or orphaned data).
Explanation
It is used in systems with complex link structures to clean up unreachable files.
- 26
What is file sharing and how can it be implemented across a network?
Model answer
File sharing allows multiple users to access files on different machines; it can be implemented using distributed file systems like NFS or SMB/CIFS.
Explanation
Protocols such as HTTP, along with DNS and LDAP, enable remote access and user identification.
- 27
Explain the difference between read, write, and execute permissions in Unix/Linux.
Model answer
Read allows viewing file content, write allows modifying the file, and execute allows running the file as a program.
Explanation
These permissions can be set for owner, group, and others using commands like chmod.
- 28
How are Unix/Linux permissions represented numerically?
Model answer
They are represented as three octal digits (e.g., 755); each digit sums read (4), write (2), and execute (1) values for owner, group, and others respectively.
Explanation
For example, 754 means owner has rwx (7), group has r-x (5), others have r-- (4).
- 29
What does the command 'chmod 700 file' do?
Model answer
It sets permissions so that the owner has read, write, and execute (7), while the group and others have no permissions (0).
Explanation
This makes the file private to the owner.
- 30
How do Windows file permissions differ from Unix/Linux in terms of write and modify?
Model answer
Windows separates 'write' (add or create) from 'modify' (change existing content), while Unix/Linux combines both under write permission.
Explanation
Windows also offers more granular permissions like 'full control' and 'read & execute'.
- 31
What is a distributed file system and how does it relate to services like OneDrive?
Model answer
A distributed file system enables remote files to be accessed as if they were local, and OneDrive uses it with HTTP/HTTPS and unique file IDs to provide cloud storage.
Explanation
Users access files via URLs, and the system handles location transparency.

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