CSCI 22022: File Systems - Part II

CongratulatoryBaltimore avatar
CongratulatoryBaltimore
·
·
Download

Start Quiz

Study Flashcards

40 Questions

What is the disadvantage of storing a file as a linked list of disk blocks?

Less efficient due to different block sizes

What is the advantage of using a File Allocation Table in memory?

Random access is easy

What is the disadvantage of using a File Allocation Table in memory?

Table must be in memory all the time and not suitable for large disks

What is an i-node?

AKA File Control Block, lists the attributes and disk addresses of the file’s blocks

How does an i-node differ from linked-list allocation using a table in memory?

Less memory required and only in memory if the relevant file is open

What is the solution to the limitation of an i-node having a fixed number of disk addresses?

Reserve last disk address to Disk block containing additional disk addresses

What is the purpose of creating a name myfile.txt in the file system?

To point to a new inode which contains the metadata for the file

What is the command to create a file myfile.txt with the contents 'Hello, World!'?

$ echo 'Hello, World!' > myfile.txt

What is the simplest method of file system implementation, where each file is stored as a contiguous run of disk blocks?

Contiguous Allocation

What is the advantage of contiguous allocation in terms of read performance?

High read performances, only seeking the first block is needed

What is the main disadvantage of contiguous allocation?

Disk fragmentation

How does linked-list allocation of disk space work?

Each block is a pointer to the next block in the file

What is the disadvantage of linked-list allocation in terms of random access?

Random access is slow, as n-1 blocks need to be read to find the n-th block

Why is contiguous allocation not suitable for use cases where files are frequently added and deleted?

It leads to disk fragmentation, making it difficult to allocate large contiguous blocks of space

What is the advantage of linked-list allocation in terms of disk space utilization?

Every block can be used, and files can be allocated non-contiguous blocks

What is the main difference between contiguous allocation and linked-list allocation?

Contiguous allocation stores files in contiguous blocks, while linked-list allocation stores files in non-contiguous blocks

How do you create a hard link 'my-hard-link' to the file 'myfile.txt'?

By using the command $ ln myfile.txt my-hard-link

What is the purpose of FAT (File Allocation Table)?

It splits the disk into clusters with unique id numbers and uses a table to track what part of what was stored in each cluster.

What are some limitations of FAT32?

Limited support for access control and file permissions, limited support for long file names, and fragmentation issues.

What is the maximum file size and partition size limitations of FAT32?

The maximum file size is 4 GB and the partition size cannot exceed 8 TB.

What is NTFS, and what are its key characteristics?

NTFS is a journaling file system used in modern Windows operating systems, supporting access control lists (ACLs) and control over file and folder permissions.

What is journaling in the context of NTFS?

Journaling keeps track of changes not yet committed to the file system.

What are ACLs (Access Control Lists) in NTFS?

ACLs are used to control access to files and folders, allowing administrators to assign permissions to individual users or groups.

Why is NTFS preferred over FAT32 in modern Windows operating systems?

NTFS provides improved security, flexibility, and features compared to FAT32.

What is the primary function of journaling in a file system?

To recover file system consistency in the event of a system failure or power loss

What is the maximum disk size supported by ext4?

256 TB

What is the main advantage of XFS over other file systems?

High-performance and scalability

What is the limitation of HFS+?

Performance and scalability

What is the primary feature of APFS?

Enhanced performance and strong encryption

What is the benefit of the layered structure of a file system?

Minimized duplication of code

What is the main difference between ext4 and ext3?

Extents replace the traditional block mapping scheme

What is the purpose of snapshots in APFS?

Data protection

What are the main components of a file system, and how do they interact with each other?

The main components of a file system are Application Programs, Logical File System, File-Organization Module, Basic File System, I/O Control, and Devices. These components interact with each other to manage files, directories, and storage devices, providing a layered architecture for file system management.

What is the primary function of the Logical File System layer in a file system?

The primary function of the Logical File System layer is to manage metadata, such as file names, sizes, and permissions, and to maintain the file structure using file-control blocks (i-nodes).

What is the role of the File-Organization Module in a file system?

The File-Organization Module is responsible for managing files and their logical blocks, and includes a free space manager that tracks unallocated blocks and provides them to the file-organization module when requested.

What is the purpose of the Basic File System layer in a file system?

The Basic File System layer issues generic commands to the appropriate device driver to read and write blocks on the storage device, and manages the memory buffers and caches that hold various file system, directory, and data blocks.

What is the role of the I/O Control layer in a file system?

The I/O Control layer consists of device drivers and interrupt handlers that transfer information between the main memory and the disk system, and manipulate the physical device to read and write data.

What is the difference between a file system and a storage device?

A file system is a layer of software that manages files and data on a storage device, while a storage device is the physical mechanism that stores the data, such as a hard drive or solid-state drive.

What is the purpose of the Application Programs layer in a file system?

The Application Programs layer consists of the day-to-day programs that are run by the user, such as web browsers and text editors, and provides a interface to the file system for the user.

How does the file system manage the allocation of disk space to files?

The file system manages the allocation of disk space to files through the File-Organization Module, which tracks unallocated blocks and provides them to the file-organization module when requested, and the Logical File System layer, which manages metadata and maintains the file structure.

Study Notes

File System Implementation

  • Contiguous Allocation: a method of storing files as a contiguous run of disk blocks.
    • Advantages: simple to implement, high read performance (only one seek is needed to find the first block).
    • Disadvantages: disk fragmentation, unable to use free space if the hole is not big enough.
  • Linked-List Allocation: a method of storing files as a linked list of disk blocks, where each block is a pointer to the next block.
    • Advantages: reading a file sequentially is straightforward.
    • Disadvantages: random access is slow, less efficient due to varying block sizes.

File Allocation Table (FAT)

  • FAT is a method of allocating disk space using a table in memory.
    • Advantages: random access is easy, simple to implement.
    • Disadvantages: table must be in memory all the time, not suitable for large disks.
  • FAT is used in removable and portable devices due to its ease of implementation and compatibility.

i-node

  • i-node (also known as File Control Block) is a data structure that lists the attributes (permissions, sizes, dates, etc.) and disk addresses of a file's blocks.
    • Advantages: less memory required, only needs to be in memory when the relevant file is open.
    • Disadvantages: one i-node has room for a fixed number of disk addresses, solution is to reserve the last disk address to a disk block containing additional disk addresses.
  • Hard Link: a file that points to the same inode as another file, creating a new name for the same file.
  • Soft Link: a file that points to another file, creating a new name for the file, but storing the actual file location.

File Systems

  • FAT (File Allocation Table): split the disk into clusters with unique IDs, use a table to track what was stored in each cluster.
    • Disadvantages: limited support for access control and file permissions, limited support for long file names, fragmentation issue.
  • NTFS (New Technology File System): used in modern Windows operating systems, supports journaling, access control lists, and large storage.
  • ext4 (Fourth Extended File System): used in Linux, supports journaling, no file size or partition size limits, and efficient storage utilization.
  • XFS (X File System): high-performance file system designed for scalability and reliability, supports features like delayed allocation and online re-sizing.
  • HFS+ and APFS: used in macOS, HFS+ is the primary file system before the introduction of APFS, which offers enhanced performance, strong encryption, and support for solid-state storage devices.

File System Layers

  • Application Programs: day-to-day programs that use the file system.
  • Logical File System: manages metadata information, maintains file structure via file-control blocks (i-node in Unix).
  • File-Organization Module: manages file organization, includes free space manager, and provides blocks to the file-organization module when requested.
  • Basic File System: issues generic commands to the device driver to read and write blocks on the storage device.
  • I/O Control: consists of device drivers and interrupt handlers to transfer information between the main memory and the disk system.
  • Devices: the physical storage devices, including motors and controls that store data within the medium.

This quiz covers the implementation of file systems, including i-nodes, hard links, and soft links, as part of the Advanced Operating Systems course.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser