Operating System: Question Set – 31
What are file system mount options?
Mount options control file system behavior when mounting. Examples include:
- Read-only (ro): Mounts the file system as read-only.
- Noexec: Prevents execution of binaries from the file system.
- Nosuid: Disables
setuidandsetgidbits. - Async: Enables asynchronous writes for performance.
What is a dangling symbolic link?
A target file or directory that is no longer there is indicated by a dangling symbolic link. If accessed, it becomes invalid and could lead to issues.
How does a file system implement hierarchical storage management?
Hierarchical storage management (HSM) automatically moves data between high-cost, high-performance storage (e.g., SSDs) and low-cost, high-capacity storage (e.g., tapes) based on usage patterns and policies.
How does copy-on-write work in snapshots?
In copy-on-write (CoW) snapshots:
- Original data remains unchanged.
- If data is modified, only the changed blocks are written to a new location.
- The snapshot references the original and modified blocks.
This minimizes storage usage and allows quick snapshot creation.
What is the function of the fsck command?
The fsck (File System Consistency Check) command checks and repairs file system inconsistencies. It verifies:
- Superblocks.
- Inode tables.
- Directory structure.
- Data block integrity.
What are common file system limitations?
File system limitations include:
- File Size Limit: Maximum size a single file can have.
- Partition Size Limit: Maximum size of a file system.
- Number of Files: Limited by inode count.
- File Name Length: Restriction on the number of characters in file names.
How do distributed file systems maintain consistency?
Distributed file systems use:
- Replication: Multiple copies of data ensure availability.
- Consensus Protocols: Algorithms like Paxos or Raft manage consistency.
- Locking Mechanisms: Prevent concurrent modifications to shared files.
What are immutable files?
Immutable files cannot be modified, renamed, or deleted once created. This feature is used for:
- Ensuring data integrity.
- Protecting critical configuration files. In Linux, the chattr command can mark files as immutable.
How do modern file systems handle large directories?
Modern file systems use advanced data structures like:
- B-Trees: Efficient for managing large directories.
- Hash Tables: Provide fast lookups.
- Extent-based Metadata: Reduces overhead for large directories.
What is shadow paging in file systems?
Before making changes, shadow paging makes a copy of the file’s pages. The original pages are preserved in the event of an error, guaranteeing file system consistency.
What are the differences between file-based and block-based storage?
| Feature | File-Based Storage | Block-Based Storage |
| Data Management | Manages files and directories | Manages fixed-size blocks |
| Use Case | NAS (Network-Attached Storage) | SAN (Storage Area Network) |
| Protocols | NFS, SMB | iSCSI, Fibre Channel |
What is the difference between metadata journaling and full journaling?
- Metadata Journaling: Only metadata changes are logged. Faster but less reliable for data.
- Full Journaling: Both metadata and actual file data are logged. Safer but slower.