SlideShare a Scribd company logo
Chapter 11:  File System Implementation
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
Layered File System
A Typical File Control Block
File System Implementation  On-disk structures A boot controller block (per volume), contains information needed to boot an OS (in NTFS is called boot sector). A volume controller block (per volume), contains partition details such as number of blocks, size of blocks, etc. (in NTFS is called master file table). A directory structure per file system (in NTFS is called master file table). A per-file FCB, in Unix called inode, in NTFS information is stored in master file table (i.e. DB).
File System Implementation  In memory  structures   An In memory mount table for each mounted volume.  An In memory  directory-structure cache (holds the directory info. Of recently accessed directories.  The system-wide open file table, contains a copy of FCB of each open file. The per-process open file table, contains a pointer to an entry in system-wide table.
In-Memory File System Structures
Partitions and mounting Cooked disk, contains file system. Raw disk, no file system (in UNIX it is used for swap space). Root partition (which contains the OS kernel) is mounted at boot time.  Mount table keeps track of mounted file systems by using pointers to blocks: In windows, file systems are mounted in drive letters. Each volume is a separate name space denoted by a letter and a colon. In UNIX, file systems are mounted as directories.
Virtual File Systems There are many different file systems available on any operating systems Windows: NTFS, FAT, FAT32 Linux: ext2/ext3, ufs, vfat, ramfs, tmpfs, reiserfs, xfs ... 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.
Schematic View of Virtual File System
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
Allocation Methods An allocation method refers to how disk blocks are allocated for files: Contiguous allocation Linked allocation Indexed allocation
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
Contiguous Allocation of Disk Space
Extent-Based Systems Many newer file systems (I.e. Veritas File System) use a modified contiguous allocation scheme Extent-based file systems allocate disk blocks in  extents An  extent  is a contiguous block of disks Extents are allocated for file allocation A file consists of one or more extents.
Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. Simple – need only starting address Free-space management system – no waste of space  No random access pointer block  =
Linked Allocation
File-Allocation Table
Indexed Allocation Brings all pointers together into the  index block. Logical view. index table
Example of Indexed Allocation
Indexed Allocation (Cont.) Need index table Random access Dynamic access without external fragmentation, but have overhead of index block. Mapping from logical to physical in a file of maximum size of 256K words and block size of 512 words.  We need only 1 block for index table.
Indexed Allocation – Mapping (Cont.)  outer-index index table file
Combined Scheme:  UNIX (4K bytes per block)
Free-Space Management Bit vector  ( n  blocks) … 0 1 2 n-1 bit[ i ] =  0    block[ i ] free 1    block[ i ] occupied Block number calculation =  (number of bits per word) * (number of 0-value words) + offset of first 1 bit
Free-Space Management (Cont.) Bit map requires extra space Example: block size = 2 12  bytes disk size = 2 30  bytes (1 gigabyte) n  = 2 30 /2 12  = 2 18  bits (or 32K bytes) Easy to get contiguous files  Linked list (free list) Cannot get contiguous space easily No waste of space Grouping  Counting
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 Cannot allow for block[ i ] to have a situation where bit[ i ] = 1 in memory and bit[ i ] = 0 on disk Solution: Set bit[ i ] = 1 in disk Allocate block[ i ] Set bit[ i ] = 1 in memory
Linked Free Space List on Disk
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
Page Cache A  page cache  caches pages rather than disk blocks using virtual memory techniques Memory-mapped I/O uses a page cache Routine I/O through the file system uses the buffer (disk) cache This leads to the following figure
I/O Without a Unified Buffer Cache
Unified Buffer Cache A unified buffer cache uses the same page cache to cache both memory-mapped pages and ordinary file system I/O
I/O Using a Unified Buffer Cache

More Related Content

PPT
PDF
ITFT_File system interface in Operating System
PPTX
File system implementation
PPTX
directory structure and file system mounting
PPT
PPTX
File System Implementation
PPTX
File system Os
PDF
File Systems
ITFT_File system interface in Operating System
File system implementation
directory structure and file system mounting
File System Implementation
File system Os
File Systems

What's hot (20)

PDF
File system
PPTX
File system structure
PDF
10 File System
PPT
PDF
File implementation
PPTX
File System Interface
PPT
Files concepts.53
PPT
Chapter 11 - File System Implementation
PDF
File management
PDF
Operating Systems - Implementing File Systems
PPTX
File System in Operating System
PPTX
File Management in Operating System
PPTX
File Directory Structure-R.D.Sivakumar
PPT
Chapter 10 - File System Interface
PDF
File
PDF
File systems linux class 8
PPTX
file system in operating system
PPT
Ch12 OS
 
PPTX
File system
PPTX
Operating system file system
File system
File system structure
10 File System
File implementation
File System Interface
Files concepts.53
Chapter 11 - File System Implementation
File management
Operating Systems - Implementing File Systems
File System in Operating System
File Management in Operating System
File Directory Structure-R.D.Sivakumar
Chapter 10 - File System Interface
File
File systems linux class 8
file system in operating system
Ch12 OS
 
File system
Operating system file system
Ad

Viewers also liked (10)

PPT
Korean War
PDF
Dependable Systems -Reliability Prediction (9/16)
PPT
PPTX
file sharing semantics by Umar Danjuma Maiwada
PPT
File models and file accessing models
PPTX
Types Of Buses
PDF
Intro to Buses (Computer Architecture)
PPT
Chapter 7 - Deadlocks
PPT
Chapter 17 - Distributed File Systems
PPTX
Types of buses of computer
Korean War
Dependable Systems -Reliability Prediction (9/16)
file sharing semantics by Umar Danjuma Maiwada
File models and file accessing models
Types Of Buses
Intro to Buses (Computer Architecture)
Chapter 7 - Deadlocks
Chapter 17 - Distributed File Systems
Types of buses of computer
Ad

Similar to Ch11 (20)

PDF
Ch11 file system implementation
PPT
file management_part2_os_notes.ppt
PPTX
Allocation and free space management
PPT
chapter5-file system implementation.ppt
PPTX
File Management & Access Control
PPTX
OS Unit5.pptx
PPT
Chapter 06
PDF
Lect09
PPT
Contigious
PPT
Operating systems presentation part 1 2025
PPTX
8 File Management system project .pptx
PPT
Unix file systems 2 in unix internal systems
PPTX
Operating System File System IMpl lecture19.pptx
PPT
Lecture 14,15 and 16 file systems
PPTX
File System Implementation.pptx
PPTX
Operating System Unit 4(RTU Syllabus).pptx
PPT
Files Allocation.ppt
PPT
File Management.ppt
PPTX
Report blocking ,management of files in secondry memory , static vs dynamic a...
Ch11 file system implementation
file management_part2_os_notes.ppt
Allocation and free space management
chapter5-file system implementation.ppt
File Management & Access Control
OS Unit5.pptx
Chapter 06
Lect09
Contigious
Operating systems presentation part 1 2025
8 File Management system project .pptx
Unix file systems 2 in unix internal systems
Operating System File System IMpl lecture19.pptx
Lecture 14,15 and 16 file systems
File System Implementation.pptx
Operating System Unit 4(RTU Syllabus).pptx
Files Allocation.ppt
File Management.ppt
Report blocking ,management of files in secondry memory , static vs dynamic a...

More from tech2click (11)

PPT
Process Synchronization And Deadlocks
PPT
PPT
PPT
Tutorial4 Threads
PPT
Operating System 5
PPT
Mid1 Revision
PPT
Operating System 4
PPT
Operating System 3
PPT
Tutorial 2
PPT
Operating System 2
PPT
Rootkit
Process Synchronization And Deadlocks
Tutorial4 Threads
Operating System 5
Mid1 Revision
Operating System 4
Operating System 3
Tutorial 2
Operating System 2
Rootkit

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Approach and Philosophy of On baking technology
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Encapsulation theory and applications.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Modernizing your data center with Dell and AMD
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Approach and Philosophy of On baking technology
NewMind AI Monthly Chronicles - July 2025
Encapsulation theory and applications.pdf
The AUB Centre for AI in Media Proposal.docx
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Understanding_Digital_Forensics_Presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Building Integrated photovoltaic BIPV_UPV.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Review of recent advances in non-invasive hemoglobin estimation
20250228 LYD VKU AI Blended-Learning.pptx
Modernizing your data center with Dell and AMD

Ch11

  • 1. Chapter 11: File System Implementation
  • 2. 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. A Typical File Control Block
  • 5. File System Implementation On-disk structures A boot controller block (per volume), contains information needed to boot an OS (in NTFS is called boot sector). A volume controller block (per volume), contains partition details such as number of blocks, size of blocks, etc. (in NTFS is called master file table). A directory structure per file system (in NTFS is called master file table). A per-file FCB, in Unix called inode, in NTFS information is stored in master file table (i.e. DB).
  • 6. File System Implementation In memory structures An In memory mount table for each mounted volume. An In memory directory-structure cache (holds the directory info. Of recently accessed directories. The system-wide open file table, contains a copy of FCB of each open file. The per-process open file table, contains a pointer to an entry in system-wide table.
  • 8. Partitions and mounting Cooked disk, contains file system. Raw disk, no file system (in UNIX it is used for swap space). Root partition (which contains the OS kernel) is mounted at boot time. Mount table keeps track of mounted file systems by using pointers to blocks: In windows, file systems are mounted in drive letters. Each volume is a separate name space denoted by a letter and a colon. In UNIX, file systems are mounted as directories.
  • 9. Virtual File Systems There are many different file systems available on any operating systems Windows: NTFS, FAT, FAT32 Linux: ext2/ext3, ufs, vfat, ramfs, tmpfs, reiserfs, xfs ... 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.
  • 10. Schematic View of Virtual File System
  • 11. 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
  • 12. Allocation Methods An allocation method refers to how disk blocks are allocated for files: Contiguous allocation Linked allocation Indexed allocation
  • 13. 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
  • 15. Extent-Based Systems Many newer file systems (I.e. Veritas File System) use a modified contiguous allocation scheme Extent-based file systems allocate disk blocks in extents An extent is a contiguous block of disks Extents are allocated for file allocation A file consists of one or more extents.
  • 16. Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. Simple – need only starting address Free-space management system – no waste of space No random access pointer block =
  • 19. Indexed Allocation Brings all pointers together into the index block. Logical view. index table
  • 20. Example of Indexed Allocation
  • 21. Indexed Allocation (Cont.) Need index table Random access Dynamic access without external fragmentation, but have overhead of index block. Mapping from logical to physical in a file of maximum size of 256K words and block size of 512 words. We need only 1 block for index table.
  • 22. Indexed Allocation – Mapping (Cont.)  outer-index index table file
  • 23. Combined Scheme: UNIX (4K bytes per block)
  • 24. Free-Space Management Bit vector ( n blocks) … 0 1 2 n-1 bit[ i ] =  0  block[ i ] free 1  block[ i ] occupied Block number calculation = (number of bits per word) * (number of 0-value words) + offset of first 1 bit
  • 25. Free-Space Management (Cont.) Bit map requires extra space Example: block size = 2 12 bytes disk size = 2 30 bytes (1 gigabyte) n = 2 30 /2 12 = 2 18 bits (or 32K bytes) Easy to get contiguous files Linked list (free list) Cannot get contiguous space easily No waste of space Grouping Counting
  • 26. 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 Cannot allow for block[ i ] to have a situation where bit[ i ] = 1 in memory and bit[ i ] = 0 on disk Solution: Set bit[ i ] = 1 in disk Allocate block[ i ] Set bit[ i ] = 1 in memory
  • 27. Linked Free Space List on Disk
  • 28. 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
  • 29. Page Cache A page cache caches pages rather than disk blocks using virtual memory techniques Memory-mapped I/O uses a page cache Routine I/O through the file system uses the buffer (disk) cache This leads to the following figure
  • 30. I/O Without a Unified Buffer Cache
  • 31. Unified Buffer Cache A unified buffer cache uses the same page cache to cache both memory-mapped pages and ordinary file system I/O
  • 32. I/O Using a Unified Buffer Cache