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

Chapter-5- File System_104436

operating system

Uploaded by

Belete Siyum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Chapter-5- File System_104436

operating system

Uploaded by

Belete Siyum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 50

1 Chapter 5:File Systems

Outline
2

Introduction
Fundamental concepts on file
► Data and meta data
► Operations, organization and buffering in file
► Sequential Vs Consequential data
► Content and structure of directories
File system techniques
► Partitioning
► Mounting and unmounting
► Virtual file system
► Memory-mapped files
Special purpose file systems
► Naming, searching and backup strategies
Introduction
3

A File system:
►It is a method used by OS and computer programs to
organize and store data on storage devices such as
HDDs, SSDs, flash drives, and optical discs.
►It provides a structured way to store, retrieve, and
manage files and directories
►Enabling users and programs to access data
efficiently.
Introduction (cont’d)
4

► There are different types of file systems in use today


including:
► Disk-based File System
Network File System

► Distributed File Systems

► Flash File Systems

► Specialized File Systems

► Each file system has its own strengths and weaknesses,


and is optimize for specific use cases.
Types of File Systems: Disk-based File System
5

► Are designed for storage devices like HDDs and SSDs


► They organize and manage data on physical storage
media
Examples
► NTFS (New Technology File System)

► Developed by Microsoft

► It is the default file system for modern Windows

OSs.
► It offers features like file compression, encryption,

and support for large files and volumes.


Types of File Systems: Disk-based File System
6

► Hierarchical File System Plus (HFS+ )


► Used by macOS for organizing files on Macintosh
computers.
► It supports features like metadata indexing, and
extended attributes.
► Fourth Extended File System (ext4 )
► A popular file system for Linux distributions,
► providing features such as extents-based allocation,
and support for large file
► systems and files.
Types of File Systems: Network File System
7

► It allow files to be shared and accessed over a


network by multiple users and computers.
► Facilitate file sharing and collaboration across
distributed environments.
Examples:
► Network File System (NFS )
► Server Message Block (SMB )
► Common Internet File System (CIFS )
Types of File Systems: Distributed File Systems
8

► Distribute file storage and management across multiple


servers or nodes in a network
► Enabling scalability, fault tolerance, and data redundancy
Examples :
► Hadoop Distributed File System (HDFS )
► Used by Apache Hadoop for storing and processing large

datasets across clusters of computers.


► Google File System (GFS)
► Developed by Google for storing and managing large-

scale distributed data across its infrastructure


Types of File Systems: Flash File Systems
9

► are optimized for flash memory storage devices like


USB drives, SD cards, and SSDs.
► They address the unique characteristics and
requirements of flash-based storage media.
Examples:
► Extended File Allocation Table (exFAT )
► Designed by Microsoft as an improved version of FAT
► Handling larger file sizes and storage volumes on flash

drives and memory cards.


Types of File Systems: Flash File Systems
10

► Flash-Friendly File System (F2FS )


► Developed by Samsung for flash-based storage devices
► Offering features like wear-leveling, log-structured design,

and optimized performance.


Types of File Systems: Specialized File
Systems
11

► Are designed for specific purposes or use cases, including


embedded systems, real-time system, Virtualization
Examples :
► Read-Only Memory File System (ROMFS)
► Used in embedded systems and firmware for storing read-

only data, such as system files and firmware images


► Veritas File System (VXFS )
► Developed by Veritas Technologies for high-performance

and scalable storage solutions in enterprise environments.


Fundamental concepts on file
12

► A file is a collection of related data or information


stored on a storage medium, organized in a
hierarchical structure within a file system.
► Files can contain various types of data, including
text, images, audio, video, programs etc.
Data and Meta Data
13

Data
►Data is a set of facts and statistics that can be operated,

referred or analyzed
►It can simply be a piece of information, for example a

list of grocery items, or observations, a story or a


description of a certain scenario
► Data can be in different forms such as text, numbers,

images, audio, or video


►For example, if you create a notepad file, then the

content of that document is data


Data and Meta Data (cont’d)
14

Meta Data
►Metadata is a data about data

►It describes the characteristics of other data such as the

format, structure, source, ownership, and usage.


►It is important for managing and organizing large

amounts of data, as it enables user to search, sort, and


filter the data based on specific criteria.
► For example, if you create a notepad file the name of

the file, storage description, type of file, size of file all


becomes metadata of your file
File operation
15

► File systems provide a set of operations for interacting


with files including:
File Creation:
► Involves allocating space on the storage medium and

assigning a unique name and location within the file


system
► File creation operations typically include specifying file

attributes such as permissions, ownership, and file type


File operation (cont’d)
16

Opening Files:
►It involves identifying the file by its name or path

and obtaining a file handle or descriptor for


subsequent operations
►Allows users and programs to access its contents

for reading, writing, or other operations


Reading from Files:
►Reading from a file involves retrieving data from the file

and transferring it to memory or another destination.


File operation (cont’d)
17

► Read operations can be sequential, reading data from


the beginning to the end of the file, or random,
accessing specific locations within the file.
Writing to Files:
► It involves storing data in the file on the storage

medium.
► Write operations can append data to the end of the file,

overwrite existing data, or insert data at specific


locations within the file.
File operation (cont’d)
18

Closing Files:
►Releases system resources associated with the file

►Closing a file ensures that changes made to the file are

flushed to disk and that the file is properly released for


other operations
Moving and Renaming Files:
►Moving a file involves changing its location within the

file system
►Renaming a file involves changing its name without

change it’s contents and attributes.


File operation (cont’d)
19

Copying Files:
►Creates a duplicate of the original file with the same

contents, attributes, and permissions


►Can be performed within the same file system or

between different file systems


Deleting Files:
►Removes it from the file system and frees up the space it

occupied on the storage medium


►May be permanently removed from the system or moved

to a trash or recycle bin for later recovery.


File operation (cont’d)
20

Changing File Attributes:


►It involves modifying properties such as permissions,

ownership, timestamps, and file type


►Can be performed by users with appropriate privileges or

by system administrators
Searching Files:
►It involves locating files within the file system based on

specific criteria, such as name, type, size, or content.


►Performed manually by users or programmatically by

applications.
File operation (cont’d)
21

File Locking and Synchronization:


►File locking mechanisms prevent concurrent access to

files by multiple processes to avoid data corruption or


inconsistency
►File synchronization operations ensure that changes made

to a file by one process are reflected in other processes


accessing the same file.
Data organization
22

► File systems organize data into files and directories,


providing a structured framework for storing and
managing information
► They maintain a hierarchical structure of directories and
subdirectories
► Hierarchical structure of directories enabling users to
organize and categorize files based on their content,
purpose, or other criteria
Buffering
23

► Buffering refers to the temporary storage of data in the


designated area of memory or storage space.
► Used to smooth out variations in data flow or to hold
data until it can be processed or transmitted.
► Used in many applications including streaming media,
network communication, and data processing.
Sequential Vs Non-sequential data
24

Sequential:
► Records are stored in a specific order
►Often used in application that involve large volume of

data such as inventory or financial systems


Non-sequential:
►Allow records to be accessed any order, based on key or

other indexing techniques


►Used in applications that require fast and flexible access

to data such as search engines or DBMS.


Content and structure of directories
25

► In file system directory also known as folder, which is a


container for file or other directories
► Directories are organized in hierarchical structure
► A directory potentially containing other directories and
files
► The organization of files and directories in file system
is known as directory structure
► Operations can performed in directories, common
operations on directories as follows:
Content and structure of directories
26

► Creating Directories
► Listing directory Contents
► Navigating directories
► Accessing directory Properties
► Modifying directories
► Deleting directories
► Searching directories
► Moving and copying directories
► Access control
Content and structure of directories
27

Creating:
►Users and programs can create new directories within the

file system
►Involves specifying a name for the new directory and its

location within the file system hierarchy.


Listing contents:
►Listed to display the files and subdirectories contained

within them.
►Provides users with information about the files and

subdirectories stored within a directory


Content and structure of directories
28

Navigating:
► Moving between parent and child directories to access

files and subdirectories stored within them


Accessing:
►Allows users to view attributes such as creation date,

modification date, permissions, and ownership


Modifying:
►Modification operations may include renaming, changing

attributes, or moving to different locations within the file


system hierarchy
Content and structure of directories
29

Deleting:
►Frees up storage space and removes them from the file

system hierarchy
Searching
►Helps users find files and directories within the file system

efficiently.
Moving and Copying:
►Moving directories changes their location while preserving

their contents
►Copying directories creates duplicates of the original
directories
Content and structure of directories
30

Access Control:
►Used to regulate who can view, modify, or delete them

►Determine user and group permissions for accessing and

managing directory contents.


File system techniques
31

► There are a number of the file system techniques


include partitioning, mounting and unmounting, virtual
file system, memory-mapped files
Partitioning
► It is the process of dividing storage device into one or

more logical sections, or partitions


► Each partition can be formatted with its own file
system, allowing for different types of data storage and
management with in the same physical device.
File system techniques: partitioning
32

►There are several techniques of partitioning a file system


including:
MBR (Master Boot Record) partitioning
► Traditional method of partitioning a hard drive
► Uses partitioning table stored in the MBR of the disk

► Allows up to 3 or 4 primary partitions and extended

partitions, which can contain multiple logical partitions


GPT (GUID partition table) partitioning
► Newer method of partitioning that uses a partitioning table
stored in GPT header of the disk.
File system techniques: partitioning
33

► Allows much larger number of partitions than MBR


partitioning (i.e. Up to 128 partitions per disk)
Partition Alignment
► Aligning partition to the underlying physical storage

blocks, to improve performance and reduce damaging


on the disk.
► Misaligned partitions can cause performance issues and

reduce the lifespan on the disk.


File system techniques: partitioning
34

Partition for specific purpose


►Sometimes a file system partition may be dedicated to a

specific purpose such as boot partition, a system partition


or data partition
►Each of these partitions may have different requirements

and characteristics and may be formatted with different


file systems
► Logical volume management (LVM)

►Allows for dynamic allocation and management of

storage space without the need for predefined partitions


File system techniques: partitioning
35

► LVM can be used to create logical volumes that span


multiple physical disks or partitions and can be resize
and moved as needed
File system techniques: Mounting and unmounting
36

Mounting
►The process of making a file available for access

►Typically done by attaching a storage device or network

location to a directory with in the file system hierarchy


Unmounting
►The process of detaching a file system from a mount

point in the file system hierarchy, making it unavailable


for access
File system techniques: Mounting and unmounting
37

► For example, when you insert a USB drive to a


computer, you need to mount the file system on the
USB drive to make its content available for access.
When you are done using the USB drive, you need to
unmount the file system before you can safely remove
the drive
► In Unix-base OS such as Linux “mount” and
“unmount” commands are used to mount and unmount
file systems.
► In windows OS, you can mount and unmount file
systems using disk management tool
File system techniques: Virtual file systems (VFS)
38

► VFS is an abstraction layer that allows different file


systems to be accessed using common interface
► It provides interface to applications regardless the
underlying file system or storage device
► This makes it easier for applications to access and
manipulate files, directories
► Commonly used in OS to provide access to different
types of storage devices, such as Hard drive, USB
drive, network file systems, and Cloud storages.
File system techniques: Virtual file systems (VFS)
39

► Can be used to combine multiple file systems in to single


logical file system
Benefits
► Improved compatibility between different file systems and

storage devices
► Simplified file system management

► Increased flexibility for applications.

Examples
► Linux Virtual File Systems (VFS)

► Common Internet File System (CIFS) used in Windows

► Network File System (NFS) used in Unix based systems


File system techniques: Memory Mapped Files
40

► It is a technique used in computer program to access


and manipulate files as if they were portion of the main
memory
► A portion of a file is mapped into address space of a
process, allowing the process to read and write the file
as if it were just another parts of memory
► When a memory-mapped file is created, the OS maps
apportion of the file to the block of memory in the
process’s virtual address space.
► The process can then read and write to this block of
memory, which is automatically synchronized with the
file on disk.
File system techniques: Memory Mapped Files
41

► Any change made to memory-mapped file are


automatically written back to the disk
► Any change made to the file on disk are automatically
reflected in memory mapped region
42

Memory mapped file


Special purpose file systems
43

► Designed for specific purposes or use cases


► Some of the special purpose file systems designed
specific purposes include
► Security

► Backup and recovery

► Compression

► Remote access

► Clustering

► Performance optimization

► Compatibility
Naming, Searching and Access
44

Naming
► Assigning unique name to a file or directory
► Name : used to identify and locate the file or directory

Searching
► Finding file or directory that match a particular search
criteria or query
► File system search capabilities are vary depending on OS

and file system being used;


► However, common search mechanism include searching by

name, file type, file size, and date modified etc.


Naming, Searching and Access
45

Access
► Ability to read, write, execute files and directories
► Managed using file permission

► Specify who can access file or directory

► What action allowed to perform to directories or files.


Backup Strategies
46

► Backup strategy is a plan for regular backing up


important files and directories to prevent data loss in
case of system failure, malware attack, or other
unexpected events.
► There are steps to develop robust backup strategy for a
file system
i. Identify critical files and directories
► Determine which files and directories are essential for
your business or personal use to give priority to backing
up
Backup Strategies
47

ii. Choose backup method


► Decide the backup method will have to use such as
► Full backup
► Incremental backup

► Differential backup etc.

ii. Select backup media


► Choose media or device to store backups such as
► External hard drive
► Cloud based backup services

► Network attached storage (NAS) etc.


Backup Strategies
48

iv. Define backup frequency


►Determine how frequently backup will be performed.
► It is depending on data importance and rate of change of

data
v. Automate backup
► Use automation tools to schedule backups and ensure
backups are performed regularly and consistently
Backup Strategies
49

vi. Test backups


► Test backups regularly:
► To ensure the backup is functional
► To ensure the backup is recoverable incase of disaster

vi. Secure backups


► Ensure backups are stored securely and protected
from unauthorized access, tampering, or theft
50

r 5
p te
h a
f C
d o
E n

You might also like