File System
Implementation
File System Structure
File System Implementation
Directory Implementation
Allocation Methods
Free-Space Management
Efficiency and Performance
Recovery
Log-Structured File Systems
NFS
Operating System Concepts
Operating System Concepts
File-System Structure
File structure
Logical storage unit
Collection of related information
File system resides on secondary storage (disks).
File system organized into layers.
File control block – storage structure consisting of
information about a file.
Operating System Concepts
Layered File System
Operating System Concepts
A Typical File Control Block
Operating System Concepts
In-Memory File System Structures
open
Read/write
Operating System Concepts
Virtual File Systems
Virtual File Systems (VFS) provide an object-
oriented way of implementing file systems.
VFS allows the same system call interface (the API)
to be used for different types of file systems.
The API is to the VFS interface, rather than any
specific type of file system.
Operating System Concepts
User program & Kernel, VSF
interface
Note: This picture is excerpted from Write a Linux Hardware Device Driver, Andrew O’Shauqhnessy, Unix world
Operating System Concepts
Schematic View of Virtual File System
Operating System Concepts
Directory Implementation
Linear list of file names with pointer to the data
blocks.
simple to program
time-consuming to execute
Hash Table – linear list with hash data structure.
decreases directory search time
collisions – situations where two file names hash to the
same location
fixed size
An improved implementation is a hash table with a
linked list (entry)
Collision free
Can grow
Operating System Concepts
Allocation Methods
An allocation method refers to how disk blocks are
allocated for files:
Contiguous allocation
Linked allocation
Indexed allocation
Operating System Concepts
Contiguous Allocation
Each file occupies a set of contiguous blocks
on the disk.
Simple – only starting location (block #) and
length (number of blocks) are required.
Random access.
Wasteful of space (dynamic storage-
allocation problem).
Files cannot grow.
Operating System Concepts
Contiguous Allocation of Disk
Space
Operating System Concepts
Linked Allocation
Each file is a linked list of disk blocks: blocks
may be scattered anywhere on the disk.
pointer
block =
Operating System Concepts
Linked Allocation
Operating System Concepts
Linked Allocation (Cont.)
Simple – need only starting address
Free-space management system – no waste of
space
No random access
Space waste for pointer (e.g. 4byte of 512 B)
Reliability
Operating System Concepts
File-Allocation Table
Improved linked method: File-allocation table (FAT) – disk-
space allocation used by MS-DOS and OS/2.
Operating System Concepts
Indexed Allocation
Brings all pointers together into the index
block.
Logical view.
index table
Operating System Concepts
Example of Indexed Allocation
Operating System Concepts
Indexed Allocation (Cont.)
Need index table
Random access
Dynamic access without external
fragmentation, but have overhead of index
block.
Operating System Concepts
Indexed Allocation – Mapping
(Cont.)

outer-index
index table file
Operating System Concepts
Combined Scheme: UNIX (4K bytes per block)
Operating System Concepts
Free-Space Management
• Bit vector (n blocks)
…
0 1 2 n-1
bit[i] =

0  block[i] free
1  block[i] occupied
Operating System Concepts
Free-Space Management (Cont.)
Bit map requires extra space. Example:
 block size = 212
bytes (4 K)
 disk size = 230
bytes (1 gigabyte)
 n = 230
/212
= 218
bits (or 32K bytes)
Easy to get contiguous files
Linked list (free list)
Cannot get contiguous space easily
No waste of space
Grouping
Large free blocks can be quickly found
Counting
Operating System Concepts
Free-Space Management (Cont.)
Need to protect:
Pointer to free list
Bit map
Must be kept on disk
Copy in memory and disk may differ.
Operating System Concepts
Linked Free Space List on Disk
Operating System Concepts
Efficiency and Performance
Efficiency dependent on:
disk allocation and directory algorithms
types of data kept in file’s directory entry
Performance
disk cache – separate section of main memory for
frequently used blocks
free-behind and read-ahead – techniques to optimize
sequential access
improve PC performance by dedicating section of
memory as virtual disk, or RAM disk.
Operating System Concepts
Recovery
Consistency checking – compares data in directory
structure with data blocks on disk, and tries to fix
inconsistencies.
Use system programs to back up data from disk to
another storage device (floppy disk, magnetic
tape).
Recover lost file or disk by restoring data from
backup.
Operating System Concepts
Log Structured File Systems
Log structured (or journaling) file systems record
each update to the file system as a transaction.
All transactions are written to a log. A transaction
is considered committed once it is written to the
log. However, the file system may not yet be
updated.
The transactions in the log are asynchronously
written to the file system. When the file system is
modified, the transaction is removed from the log.
Operating System Concepts
The Sun Network File System
(NFS)
An implementation and a specification of a
software system for accessing remote files across
LANs (or WANs).
The implementation is part of the Solaris and
SunOS operating systems running on Sun
workstations using an unreliable datagram protocol
(UDP/IP protocol and Ethernet.
Interconnected workstations viewed as a set of
independent machines with independent file
systems, which allows sharing among these file
systems in a transparent manner.
Operating System Concepts
NFS (Cont.)
NFS is designed to operate in a heterogeneous
environment of different machines, operating
systems, and network architectures; the NFS
specifications independent of these media.
This independence is achieved through the use of
RPC primitives built on top of an External Data
Representation (XDR) protocol used between two
implementation-independent interfaces.
The NFS specification distinguishes between the
services provided by a mount mechanism and the
actual remote-file-access services.
Operating System Concepts
Three Major Layers of NFS Architecture
UNIX file-system interface (based on the open,
read, write, and close calls, and file descriptors).
Virtual File System (VFS) layer – distinguishes local
files from remote ones, and local files are further
distinguished according to their file-system types.
The VFS activates file-system-specific operations to
handle local requests according to their file-system
types.
Calls the NFS protocol procedures for remote requests.
NFS service layer – bottom layer of the
architecture; implements the NFS protocol.
Operating System Concepts
Schematic View of NFS Architecture
Operating System Concepts
NFS Protocol
Provides a set of remote procedure calls for remote file operations. The
procedures support the following operations:
 searching for a file within a directory
 reading a set of directory entries
 manipulating links and directories
 accessing file attributes
 reading and writing files
NFS servers are stateless; each request has to provide a full set of arguments.
Modified data must be committed to the server’s disk before results are
returned to the client (lose advantages of caching).
The NFS protocol does not provide concurrency-control mechanisms.

More Related Content

PPTX
Ch11 file system implementation
PDF
Ch11 file system implementation
PPT
8 1-os file system implementation
PPT
Operating systems presentation part 1 2025
PPT
PPT
Ch12 OS
 
PPT
file system implementation in operating systems
Ch11 file system implementation
Ch11 file system implementation
8 1-os file system implementation
Operating systems presentation part 1 2025
Ch12 OS
 
file system implementation in operating systems

Similar to FILE Implementation Introduction imp .pptx (20)

PPTX
ch12-File-System Implementation (1).pptx
PPT
Unit 3 chapter 1-file management
PDF
ch12_fileImplementation.pdf
PPTX
ch11 File System Implementation.pptx important rdbms topic
PPTX
Chapter 14 Computer Architecture
PDF
009709863.pdf
PDF
Ch10 file system interface
PPT
Chapter 11 - File System Implementation
PPT
file management_part2_os_notes.ppt
PPT
Os10
PDF
Introduction to distributed file systems
PPT
Lecture10-File Systems-PAfgfgfgfgfgfgf.ppt
PPTX
File system implementation
PPT
operating system notes for II year IV semester students
PPTX
OS Unit5.pptx
PPT
Unit 3 file management
PPTX
File Management & Access Control
ODP
Distributed File System
 
PPT
File Management.ppt
PPT
11.file system implementation
ch12-File-System Implementation (1).pptx
Unit 3 chapter 1-file management
ch12_fileImplementation.pdf
ch11 File System Implementation.pptx important rdbms topic
Chapter 14 Computer Architecture
009709863.pdf
Ch10 file system interface
Chapter 11 - File System Implementation
file management_part2_os_notes.ppt
Os10
Introduction to distributed file systems
Lecture10-File Systems-PAfgfgfgfgfgfgf.ppt
File system implementation
operating system notes for II year IV semester students
OS Unit5.pptx
Unit 3 file management
File Management & Access Control
Distributed File System
 
File Management.ppt
11.file system implementation
Ad

More from pranilArunJadhav (7)

PPTX
Railway Engg presence of mind us very buggesst nurcgutioshiim ghiv
PDF
chapter 2 axial force sf and bm.praveshani
PPT
Solid-state physics.Praniljadhao8@2gmail
PPT
ECE692_1_1208.I hope helpful everyone this ppt
PDF
PPT-Physics-CSE-ECE1pranil_arun_JADHAV_by
PDF
Unit 2:- Biological Unit Process(a).pdf
PDF
Unit 1--Preliminary Treatment Systems.pdf
Railway Engg presence of mind us very buggesst nurcgutioshiim ghiv
chapter 2 axial force sf and bm.praveshani
Solid-state physics.Praniljadhao8@2gmail
ECE692_1_1208.I hope helpful everyone this ppt
PPT-Physics-CSE-ECE1pranil_arun_JADHAV_by
Unit 2:- Biological Unit Process(a).pdf
Unit 1--Preliminary Treatment Systems.pdf
Ad

Recently uploaded (20)

PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PDF
Unit1 - AIML Chapter 1 concept and ethics
PDF
Mechanics of materials week 2 rajeshwari
PDF
VSL-Strand-Post-tensioning-Systems-Technical-Catalogue_2019-01.pdf
PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
PPTX
Software Engineering and software moduleing
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
Design of Material Handling Equipment Lecture Note
PPTX
CT Generations and Image Reconstruction methods
PPT
UNIT-I Machine Learning Essentials for 2nd years
PPTX
Unit_1_introduction to surveying for diploma.pptx
PDF
Present and Future of Systems Engineering: Air Combat Systems
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PDF
Beginners-Guide-to-Artificial-Intelligence.pdf
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
Cisco Network Behaviour dibuywvdsvdtdstydsdsa
PDF
electrical machines course file-anna university
August 2025 - Top 10 Read Articles in Network Security & Its Applications
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Unit1 - AIML Chapter 1 concept and ethics
Mechanics of materials week 2 rajeshwari
VSL-Strand-Post-tensioning-Systems-Technical-Catalogue_2019-01.pdf
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
Software Engineering and software moduleing
Management Information system : MIS-e-Business Systems.pptx
Design of Material Handling Equipment Lecture Note
CT Generations and Image Reconstruction methods
UNIT-I Machine Learning Essentials for 2nd years
Unit_1_introduction to surveying for diploma.pptx
Present and Future of Systems Engineering: Air Combat Systems
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
Beginners-Guide-to-Artificial-Intelligence.pdf
Computer organization and architecuture Digital Notes....pdf
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
Cisco Network Behaviour dibuywvdsvdtdstydsdsa
electrical machines course file-anna university

FILE Implementation Introduction imp .pptx

  • 1. File System Implementation File System Structure File System Implementation Directory Implementation Allocation Methods Free-Space Management Efficiency and Performance Recovery Log-Structured File Systems NFS Operating System Concepts
  • 2. Operating System Concepts File-System Structure File structure Logical storage unit Collection of related information File system resides on secondary storage (disks). File system organized into layers. File control block – storage structure consisting of information about a file.
  • 4. Operating System Concepts A Typical File Control Block
  • 5. Operating System Concepts In-Memory File System Structures open Read/write
  • 6. Operating System Concepts Virtual File Systems Virtual File Systems (VFS) provide an object- oriented way of implementing file systems. VFS allows the same system call interface (the API) to be used for different types of file systems. The API is to the VFS interface, rather than any specific type of file system.
  • 7. Operating System Concepts User program & Kernel, VSF interface Note: This picture is excerpted from Write a Linux Hardware Device Driver, Andrew O’Shauqhnessy, Unix world
  • 8. Operating System Concepts Schematic View of Virtual File System
  • 9. Operating System Concepts Directory Implementation Linear list of file names with pointer to the data blocks. simple to program time-consuming to execute Hash Table – linear list with hash data structure. decreases directory search time collisions – situations where two file names hash to the same location fixed size An improved implementation is a hash table with a linked list (entry) Collision free Can grow
  • 10. Operating System Concepts Allocation Methods An allocation method refers to how disk blocks are allocated for files: Contiguous allocation Linked allocation Indexed allocation
  • 11. Operating System Concepts Contiguous Allocation Each file occupies a set of contiguous blocks on the disk. Simple – only starting location (block #) and length (number of blocks) are required. Random access. Wasteful of space (dynamic storage- allocation problem). Files cannot grow.
  • 12. Operating System Concepts Contiguous Allocation of Disk Space
  • 13. Operating System Concepts Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. pointer block =
  • 15. Operating System Concepts Linked Allocation (Cont.) Simple – need only starting address Free-space management system – no waste of space No random access Space waste for pointer (e.g. 4byte of 512 B) Reliability
  • 16. Operating System Concepts File-Allocation Table Improved linked method: File-allocation table (FAT) – disk- space allocation used by MS-DOS and OS/2.
  • 17. Operating System Concepts Indexed Allocation Brings all pointers together into the index block. Logical view. index table
  • 18. Operating System Concepts Example of Indexed Allocation
  • 19. Operating System Concepts Indexed Allocation (Cont.) Need index table Random access Dynamic access without external fragmentation, but have overhead of index block.
  • 20. Operating System Concepts Indexed Allocation – Mapping (Cont.)  outer-index index table file
  • 21. Operating System Concepts Combined Scheme: UNIX (4K bytes per block)
  • 22. Operating System Concepts Free-Space Management • Bit vector (n blocks) … 0 1 2 n-1 bit[i] =  0  block[i] free 1  block[i] occupied
  • 23. Operating System Concepts Free-Space Management (Cont.) Bit map requires extra space. Example:  block size = 212 bytes (4 K)  disk size = 230 bytes (1 gigabyte)  n = 230 /212 = 218 bits (or 32K bytes) Easy to get contiguous files Linked list (free list) Cannot get contiguous space easily No waste of space Grouping Large free blocks can be quickly found Counting
  • 24. Operating System Concepts Free-Space Management (Cont.) Need to protect: Pointer to free list Bit map Must be kept on disk Copy in memory and disk may differ.
  • 25. Operating System Concepts Linked Free Space List on Disk
  • 26. Operating System Concepts Efficiency and Performance Efficiency dependent on: disk allocation and directory algorithms types of data kept in file’s directory entry Performance disk cache – separate section of main memory for frequently used blocks free-behind and read-ahead – techniques to optimize sequential access improve PC performance by dedicating section of memory as virtual disk, or RAM disk.
  • 27. Operating System Concepts Recovery Consistency checking – compares data in directory structure with data blocks on disk, and tries to fix inconsistencies. Use system programs to back up data from disk to another storage device (floppy disk, magnetic tape). Recover lost file or disk by restoring data from backup.
  • 28. Operating System Concepts Log Structured File Systems Log structured (or journaling) file systems record each update to the file system as a transaction. All transactions are written to a log. A transaction is considered committed once it is written to the log. However, the file system may not yet be updated. The transactions in the log are asynchronously written to the file system. When the file system is modified, the transaction is removed from the log.
  • 29. Operating System Concepts The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs (or WANs). The implementation is part of the Solaris and SunOS operating systems running on Sun workstations using an unreliable datagram protocol (UDP/IP protocol and Ethernet. Interconnected workstations viewed as a set of independent machines with independent file systems, which allows sharing among these file systems in a transparent manner.
  • 30. Operating System Concepts NFS (Cont.) NFS is designed to operate in a heterogeneous environment of different machines, operating systems, and network architectures; the NFS specifications independent of these media. This independence is achieved through the use of RPC primitives built on top of an External Data Representation (XDR) protocol used between two implementation-independent interfaces. The NFS specification distinguishes between the services provided by a mount mechanism and the actual remote-file-access services.
  • 31. Operating System Concepts Three Major Layers of NFS Architecture UNIX file-system interface (based on the open, read, write, and close calls, and file descriptors). Virtual File System (VFS) layer – distinguishes local files from remote ones, and local files are further distinguished according to their file-system types. The VFS activates file-system-specific operations to handle local requests according to their file-system types. Calls the NFS protocol procedures for remote requests. NFS service layer – bottom layer of the architecture; implements the NFS protocol.
  • 32. Operating System Concepts Schematic View of NFS Architecture
  • 33. Operating System Concepts NFS Protocol Provides a set of remote procedure calls for remote file operations. The procedures support the following operations:  searching for a file within a directory  reading a set of directory entries  manipulating links and directories  accessing file attributes  reading and writing files NFS servers are stateless; each request has to provide a full set of arguments. Modified data must be committed to the server’s disk before results are returned to the client (lose advantages of caching). The NFS protocol does not provide concurrency-control mechanisms.