0% found this document useful (0 votes)
33 views

3 - File System Structure

os

Uploaded by

Ali Ahammad
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

3 - File System Structure

os

Uploaded by

Ali Ahammad
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

File System - Structure

Introduction:
• A computer file is defined as a medium used for saving and managing data in the
computer system. The data stored in the computer system is completely in digital
format, although there can be various types of files that help us to store the data.
• File system implementation in an operating system refers to how the file system
manages the storage and retrieval of data on a physical storage device such as a
hard drive, solid-state drive, or flash drive.
• File system provide an efficient and convenient access to the disk by allowing
data to be stored, located and retrieved easily.
• To improve I/O efficiency, I/O transfers between memory and disk are performed
in units, called blocks. Each block has one or more sectors, whose size varies
between 32 bytes to 4096 bytes.

• File systems are maintained on disks as they are convenient in the following ways:
• A disk can be re-written in-place-- it possible to read /modify/write it back file into the same
place
• A disk can access any block of information ,directly.—we can access either sequentially or
randomly.
Design problems of File system
• To define how the file system must look to the user
• This involves defining a file and its attributes , the operation allowed on a file and the
directory structure to organize the files.
• To create algorithms and data structures to map the logical file system onto the
physical secondary-storages devices.
<<optional>>
The file system implementation includes several components, including:
• File System Structure: The file system structure refers to how the files and directories
are organized and stored on the physical storage device. This includes the layout of file
systems data structures such as the directory structure, file allocation table, and inodes.
• File Allocation: The file allocation mechanism determines how files are allocated on
the storage device. This can include allocation techniques such as contiguous allocation,
linked allocation, indexed allocation, or a combination of these techniques.
• Data Retrieval: The file system implementation determines how the data is read from
and written to the physical storage device. This includes strategies such as buffering and
caching to optimize file I/O performance.
• Security and Permissions: The file system implementation includes features for
managing file security and permissions. This includes access control lists (ACLs), file
permissions, and ownership management.
• Recovery and Fault Tolerance: The file system implementation includes features for
recovering from system failures and maintaining data integrity. This includes techniques
such as journaling and file system snapshots.
Why is it important?
• File system implementation is a critical aspect of an operating system as it directly
impacts the performance, reliability, and security of the system.
• Different operating systems use different file system implementations based on
the specific needs of the system and the intended use cases.
• Some common file systems used in operating systems include NTFS and FAT in
Windows, and ext4 and XFS in Linux
How file system is implemented? //

components

In general file system is


composed of layered design,
i.e. consists of many different
level s as shown in the
diagram.

Each level in the design uses


the features of lower levels to
create new features to be used
by the higher levels
Different levels:
• I/O Control level – consists of Device drivers, that act as an interface(translator) between devices
and OS, they help to transfer data between disk and main memory.
• It’s input contain a high level command and output consists of low-level, hardware specific instructions , which
are used by hardware controller.( It takes block number as input and as output, it gives low-level hardware-
specific instruction.)

• Basic file system – It Issues general commands to the appropriate device driver to read and write
physical blocks on disk. It manages the memory buffers and caches. A block in the buffer can hold the
contents of the disk block and the cache stores frequently used file system metadata.

• File organization Module – It has information about files, (the location of files) and their logical and
physical blocks. Physical blocks do not match with logical numbers of logical blocks numbered from
0 to N. file organization module translates logical block address to physical block address for the
basic file system to transfer .It also has a free space manager that tracks unallocated blocks .

• Logical file system – It manages metadata information about a file i.e includes all details about a file
except the actual contents of the file. It manages the directory structure’s information required for file
organization module. It also maintains file structure -via file control blocks. File control block (FCB)
has information about a file – owner, size, permissions, and location of file contents.
Advantages

• Duplication of code is minimized.


• Each file system can have its own logical file system.

File system implementation in an operating system provides several advantages, including:


• Efficient Data Storage: File system implementation ensures efficient data storage on a
physical storage device. It provides a structured way of organizing files and directories,
which makes it easy to find and access files.
• Data Security: File system implementation includes features for managing file security and
permissions. This ensures that sensitive data is protected from unauthorized access.
• Data Recovery: The file system implementation includes features for recovering from
system failures and maintaining data integrity. This helps to prevent data loss and ensures
that data can be recovered in the event of a system failure.
• Improved Performance: File system implementation includes techniques such as
buffering and caching to optimize file I/O performance. This results in faster
access to data and improved overall system performance.
• Scalability: File system implementation can be designed to be scalable, making it
possible to store and retrieve large amounts of data efficiently.
• Flexibility: Different file system implementations can be designed to meet
specific needs and use cases. This allows developers to choose the best file system
implementation for their specific requirements.
• Cross-Platform Compatibility: Many file system implementations are cross-
platform compatible, which means they can be used on different operating
systems. This makes it easy to transfer files between different systems.
Disadvantages
• If we access many files at the same time then it results in low performance.

You might also like