SlideShare una empresa de Scribd logo
1 de 19
Unit – 4




   File System Implementation
Overview

 Free Space Management
 Efficiency and Performance
 Recovery
 Log-Structured File Systems
 NFS
Free-Space Management
 How should unallocated blocks be managed?
 Need a data structure to keep track of them
    Index block
          same as for conventional file, but no info in any block
          initially very large; makes it impractical: index table too large
    Linked list
          Very large
          Hard to manage spatial locality
          want to allocate closely located blocks to a file
          this minimizes seek time
          hard to do with a linked list; have to traverse the list to find appropriate
           blocks
Linked Free Space List on Disk
Free-Space Management
 Need a data structure to keep track of them
    Grouping
          Modification of free-list (linked-list) approach
          Store the addresses of n free blocks in the first free block
          n - 1 of these are actually free; last block contains pointers to the next n
           free block. Etc.
          Can now find a large number of free blocks quickly.
    Counting
          Don’t keep the address of every free block.
          Free blocks are often consecutive
          So keep the address of the first free block and the number of following
           consecutive blocks that are free.
          Each entry in the free-space list consists of a disk address and a count.
Free-Space Management
Bit vector (block status map or “disk map”) (n blocks)

                     0 1       2                         n-1
                                               …


                         
                               0   block[i] free
                  bit[i] =
                               1    block[i] occupied
 Block number calculation

                   (number of bits per word) *
                   (number of 0-value words) +
                   offset of first 1 bit

 Most CPUs have special bit-manipulation instructions.
 Example: Intel and PowerPC have instructions that return the offset in a
    word of the first bit with the value 1
Free-Space Management (Cont.)

 Bit map requires extra space
   Example:
              block size = 212 bytes
              disk size = 230 bytes (1 gigabyte)
              n = 230/212 = 218 bits (or 32K bytes)
 Easy to get contiguous files
 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
Efficiency and Performance

 Efficiency dependent on:
     disk allocation and directory algorithms
     types of data kept in file’s directory entry
         Example: keep a “last write date” and a “last access date”
          Thus whenever a file is read, a field in the directory structure must be
           written to.
          This means that the block must be read into memory, a section changed,
           and the block written back out to disk.
Efficiency and Performance

Performance
   disk cache – separate section of RAM in the disk controller for
    frequently used blocks
   Some systems maintain a separate section of main memory for a
    buffer cache.
   Keep blocks read from disk on assumption that they’ll be used again
   free-behind and read-ahead – techniques to optimize sequential
    access
   improve PC performance by dedicating section of memory as virtual
    disk, or RAM disk
Recovery
Consistency checking
Problem:
1.   Directory information kept in main memory
2.   Main memory more up to date than info on disk
What happens when computer crashes?
          Changes to directories may be lost.
          Actual state is not reflected in the directory structure.
          compares data in directory structure with data blocks on
           disk
          tries to fix inconsistencies
Recovery
Fixable problems
   Depend on free-space-management algorithms
   If linked allocation used and each block links to next block
   Then directory structure can be reconstructed from data
    block
    Example: UNIX
   Indexed system, blocks have no knowledge of one another
   Impossible to recreate files
   This is why UNIX caches read
   But any action that results in metadata changes is done
    synchronously, before data blocks are written
Recovery
 Use system programs to back up data from disk to another
  storage device (floppy disk, magnetic tape, other magnetic disk,
  optical)
 Recover lost file or disk by restoring data from backup
Backup programs take advantage of metadata about file
updates:
    Day 1 Copy all files from disk to backup drive (full backup)
    Day 2 Copy changes since day 1 (incremental backup)
    Day 3 Copy changes since day 2
    …
    Day n Copy changes since day n-1.
    Start over again.
 Allows restoration by starting with full backup, then applying all
  incremental changes.
Log Structured File Systems
  Log structured (or journaling) file systems record each update to
   the file system as a transaction
  All metadata transactions are written to a log
  Each set of operations for performing a specific task is a
   transaction
  A transaction is considered committed once it is written to the log
   (even though the operations are not yet performed)
  The transactions in the log are asynchronously written to the file
   system
  As the operations are completed, a pointer is updated to indicate
   which actions have completed and which are still incomplete
  When all operations are complete, the transaction is removed from
   the log file
  If the file system crashes, all remaining transactions in the log
   must still be performed
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
NFS
  Accesing file over a network
  A remote directory is mounted over a local file system
   directory
  The mounted directory looks like an integral subtree of the
   local file system, replacing the subtree descending from the
   local directory
  Specification of the remote directory for the mount operation
   is nontransparent; the host name of the remote directory has
   to be provided
  Files in the remote directory can then be accessed in a
   transparent manner
  Subject to access-rights accreditation, potentially any file
   system (or directory within a file system), can be mounted
   remotely on top of any local directory
NFS Protocol
 Provides a set of remote procedure calls for remote file
  operations.
 The procedures support the following operations:
    1.   searching for a file within a directory
    2.   reading a set of directory entries
    3.   manipulating links and directories
    4.   accessing file attributes
    5.   reading and writing files
 NFS servers are stateless; each request has to provide a full set
  of arguments
 (NFS V4 is just coming available – very different, stateful)
 The NFS protocol does not provide concurrency-control
  mechanisms
Three Major Layers of NFS
Architecture
UNIX file-system layer
 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
Hope u have learnt something !!

     Thank you

Más contenido relacionado

La actualidad más candente

Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systemsvampugani
 
OS Memory Management
OS Memory ManagementOS Memory Management
OS Memory Managementanand hd
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptinfomerlin
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
Free space managment46
Free space managment46Free space managment46
Free space managment46myrajendra
 
Process' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/LinuxProcess' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/LinuxVarun Mahajan
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms Paresh Parmar
 
File organization 1
File organization 1File organization 1
File organization 1Rupali Rana
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating SystemRaj Mohan
 
Cache memory
Cache memoryCache memory
Cache memoryAnuj Modi
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
FILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMSFILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMSAbhishek Dutta
 

La actualidad más candente (20)

Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 
OS Memory Management
OS Memory ManagementOS Memory Management
OS Memory Management
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
 
Process' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/LinuxProcess' Virtual Address Space in GNU/Linux
Process' Virtual Address Space in GNU/Linux
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms
 
File organization 1
File organization 1File organization 1
File organization 1
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
VIRTUAL MEMORY
VIRTUAL MEMORYVIRTUAL MEMORY
VIRTUAL MEMORY
 
System calls
System callsSystem calls
System calls
 
Memory management
Memory managementMemory management
Memory management
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Cache memory
Cache memoryCache memory
Cache memory
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
FILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMSFILE STRUCTURE IN DBMS
FILE STRUCTURE IN DBMS
 

Destacado

File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1Amir Payberah
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating systemtittuajay
 
Constructor and Destructor PPT
Constructor and Destructor PPTConstructor and Destructor PPT
Constructor and Destructor PPTShubham Mondal
 
Ch7: Process Synchronization
Ch7: Process SynchronizationCh7: Process Synchronization
Ch7: Process SynchronizationAhmar Hashmi
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cppgourav kottawar
 
Ch11: File System Interface
Ch11: File System InterfaceCh11: File System Interface
Ch11: File System InterfaceAhmar Hashmi
 
Page Replacement Algorithms
Page Replacement AlgorithmsPage Replacement Algorithms
Page Replacement AlgorithmsKashif Dayo
 
Distributed computing
Distributed computingDistributed computing
Distributed computingDeepak John
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process SynchronizationSonali Chauhan
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System InterfaceWayne Jones Jnr
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitorssgpraju
 
File Management Presentation
File Management PresentationFile Management Presentation
File Management PresentationSgtMasterGunz
 
File management
File managementFile management
File managementMohd Arif
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 

Destacado (20)

File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
File system
File systemFile system
File system
 
Constructor and Destructor PPT
Constructor and Destructor PPTConstructor and Destructor PPT
Constructor and Destructor PPT
 
Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
Ch7: Process Synchronization
Ch7: Process SynchronizationCh7: Process Synchronization
Ch7: Process Synchronization
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
 
Ch11: File System Interface
Ch11: File System InterfaceCh11: File System Interface
Ch11: File System Interface
 
Page Replacement Algorithms
Page Replacement AlgorithmsPage Replacement Algorithms
Page Replacement Algorithms
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
 
Page Replacement
Page ReplacementPage Replacement
Page Replacement
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
Constructors & destructors
Constructors & destructorsConstructors & destructors
Constructors & destructors
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitors
 
File Management Presentation
File Management PresentationFile Management Presentation
File Management Presentation
 
File management
File managementFile management
File management
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 

Similar a File system implementation

Ch12 OS
Ch12 OSCh12 OS
Ch12 OSC.U
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSUnited International University
 
file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.pptHelalMirzad
 
Operating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsOperating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsMukesh Chinta
 
Ch11 file system implementation
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementationWelly Dian Astika
 
chapter5-file system implementation.ppt
chapter5-file system implementation.pptchapter5-file system implementation.ppt
chapter5-file system implementation.pptBUSHRASHAIKH804312
 
File System and File allocation tables
File System and File allocation tablesFile System and File allocation tables
File System and File allocation tablesshashikant pabari
 
File systemimplementationfinal
File systemimplementationfinalFile systemimplementationfinal
File systemimplementationfinalmarangburu42
 
Distributed File System
Distributed File SystemDistributed File System
Distributed File SystemNtu
 
OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)Chinmaya M. N
 
Root file system
Root file systemRoot file system
Root file systemBindu U
 
File system interfacefinal
File system interfacefinalFile system interfacefinal
File system interfacefinalmarangburu42
 
File Access & File System & File Allocation Table
File Access & File System & File Allocation TableFile Access & File System & File Allocation Table
File Access & File System & File Allocation TableChinmaya M. N
 
Filesystemimplementationpre final-160919095849
Filesystemimplementationpre final-160919095849Filesystemimplementationpre final-160919095849
Filesystemimplementationpre final-160919095849marangburu42
 

Similar a File system implementation (20)

OSCh12
OSCh12OSCh12
OSCh12
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
 
OS_Ch12
OS_Ch12OS_Ch12
OS_Ch12
 
Ch11
Ch11Ch11
Ch11
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
 
file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.ppt
 
Operating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsOperating Systems - Implementing File Systems
Operating Systems - Implementing File Systems
 
Ch11 file system implementation
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementation
 
chapter5-file system implementation.ppt
chapter5-file system implementation.pptchapter5-file system implementation.ppt
chapter5-file system implementation.ppt
 
File System and File allocation tables
File System and File allocation tablesFile System and File allocation tables
File System and File allocation tables
 
File systemimplementationfinal
File systemimplementationfinalFile systemimplementationfinal
File systemimplementationfinal
 
Chapter13
Chapter13Chapter13
Chapter13
 
Distributed File System
Distributed File SystemDistributed File System
Distributed File System
 
OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)OS_Assignment for Disk Space & File System & File allocation table(FAT)
OS_Assignment for Disk Space & File System & File allocation table(FAT)
 
Root file system
Root file systemRoot file system
Root file system
 
File system interfacefinal
File system interfacefinalFile system interfacefinal
File system interfacefinal
 
File Access & File System & File Allocation Table
File Access & File System & File Allocation TableFile Access & File System & File Allocation Table
File Access & File System & File Allocation Table
 
File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating system
 
Filesystemimplementationpre final-160919095849
Filesystemimplementationpre final-160919095849Filesystemimplementationpre final-160919095849
Filesystemimplementationpre final-160919095849
 
File Management.ppt
File Management.pptFile Management.ppt
File Management.ppt
 

Más de Rotract CLUB of BSAU

Más de Rotract CLUB of BSAU (7)

Web technology
Web technologyWeb technology
Web technology
 
Security model evaluation of 3 g
Security  model  evaluation  of  3 gSecurity  model  evaluation  of  3 g
Security model evaluation of 3 g
 
Electricityconservationtips
ElectricityconservationtipsElectricityconservationtips
Electricityconservationtips
 
Security model evaluation of 3 g wireless network1 paper presentation
Security model evaluation of 3 g wireless network1 paper presentationSecurity model evaluation of 3 g wireless network1 paper presentation
Security model evaluation of 3 g wireless network1 paper presentation
 
word of god
 word of god  word of god
word of god
 
word of god
word of god word of god
word of god
 
ppt about Nokia
ppt about Nokia ppt about Nokia
ppt about Nokia
 

Último

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Último (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 

File system implementation

  • 1. Unit – 4 File System Implementation
  • 2. Overview Free Space Management Efficiency and Performance Recovery Log-Structured File Systems NFS
  • 3. Free-Space Management  How should unallocated blocks be managed?  Need a data structure to keep track of them Index block  same as for conventional file, but no info in any block  initially very large; makes it impractical: index table too large Linked list  Very large  Hard to manage spatial locality  want to allocate closely located blocks to a file  this minimizes seek time  hard to do with a linked list; have to traverse the list to find appropriate blocks
  • 4. Linked Free Space List on Disk
  • 5. Free-Space Management  Need a data structure to keep track of them Grouping  Modification of free-list (linked-list) approach  Store the addresses of n free blocks in the first free block  n - 1 of these are actually free; last block contains pointers to the next n free block. Etc.  Can now find a large number of free blocks quickly. Counting  Don’t keep the address of every free block.  Free blocks are often consecutive  So keep the address of the first free block and the number of following consecutive blocks that are free.  Each entry in the free-space list consists of a disk address and a count.
  • 6. Free-Space Management Bit vector (block status map or “disk map”) (n blocks) 0 1 2 n-1 …  0 block[i] free bit[i] = 1 block[i] occupied Block number calculation (number of bits per word) * (number of 0-value words) + offset of first 1 bit Most CPUs have special bit-manipulation instructions. Example: Intel and PowerPC have instructions that return the offset in a word of the first bit with the value 1
  • 7. Free-Space Management (Cont.)  Bit map requires extra space Example: block size = 212 bytes disk size = 230 bytes (1 gigabyte) n = 230/212 = 218 bits (or 32K bytes)  Easy to get contiguous files  Counting
  • 8. 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
  • 9. Efficiency and Performance  Efficiency dependent on:  disk allocation and directory algorithms  types of data kept in file’s directory entry Example: keep a “last write date” and a “last access date”  Thus whenever a file is read, a field in the directory structure must be written to.  This means that the block must be read into memory, a section changed, and the block written back out to disk.
  • 10. Efficiency and Performance Performance  disk cache – separate section of RAM in the disk controller for frequently used blocks  Some systems maintain a separate section of main memory for a buffer cache.  Keep blocks read from disk on assumption that they’ll be used again  free-behind and read-ahead – techniques to optimize sequential access  improve PC performance by dedicating section of memory as virtual disk, or RAM disk
  • 11. Recovery Consistency checking Problem: 1. Directory information kept in main memory 2. Main memory more up to date than info on disk What happens when computer crashes?  Changes to directories may be lost.  Actual state is not reflected in the directory structure.  compares data in directory structure with data blocks on disk  tries to fix inconsistencies
  • 12. Recovery Fixable problems  Depend on free-space-management algorithms  If linked allocation used and each block links to next block  Then directory structure can be reconstructed from data block Example: UNIX  Indexed system, blocks have no knowledge of one another  Impossible to recreate files  This is why UNIX caches read  But any action that results in metadata changes is done synchronously, before data blocks are written
  • 13. Recovery  Use system programs to back up data from disk to another storage device (floppy disk, magnetic tape, other magnetic disk, optical)  Recover lost file or disk by restoring data from backup Backup programs take advantage of metadata about file updates: Day 1 Copy all files from disk to backup drive (full backup) Day 2 Copy changes since day 1 (incremental backup) Day 3 Copy changes since day 2 … Day n Copy changes since day n-1. Start over again.  Allows restoration by starting with full backup, then applying all incremental changes.
  • 14. Log Structured File Systems  Log structured (or journaling) file systems record each update to the file system as a transaction  All metadata transactions are written to a log  Each set of operations for performing a specific task is a transaction  A transaction is considered committed once it is written to the log (even though the operations are not yet performed)  The transactions in the log are asynchronously written to the file system  As the operations are completed, a pointer is updated to indicate which actions have completed and which are still incomplete  When all operations are complete, the transaction is removed from the log file  If the file system crashes, all remaining transactions in the log must still be performed
  • 15. 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
  • 16. NFS  Accesing file over a network  A remote directory is mounted over a local file system directory  The mounted directory looks like an integral subtree of the local file system, replacing the subtree descending from the local directory  Specification of the remote directory for the mount operation is nontransparent; the host name of the remote directory has to be provided  Files in the remote directory can then be accessed in a transparent manner  Subject to access-rights accreditation, potentially any file system (or directory within a file system), can be mounted remotely on top of any local directory
  • 17. NFS Protocol  Provides a set of remote procedure calls for remote file operations.  The procedures support the following operations: 1. searching for a file within a directory 2. reading a set of directory entries 3. manipulating links and directories 4. accessing file attributes 5. reading and writing files  NFS servers are stateless; each request has to provide a full set of arguments  (NFS V4 is just coming available – very different, stateful)  The NFS protocol does not provide concurrency-control mechanisms
  • 18. Three Major Layers of NFS Architecture UNIX file-system layer  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
  • 19. Hope u have learnt something !! Thank you

Notas del editor

  1. A return to a normal condition.Not staying the same throughout
  2. A collection of items of the same type stored in a hidden or inaccessible place.
  3. he return of something to a former owner, place, or condition.
  4. Solaris is the computer operating system that Sun Microsystems Intel-based processors. Sun has historically dominated the large UNIX workstation market. Internet-oriented design.SunOS was the UNIX-based operating system for Scalable Processor Architecture-based workstations and servers from Sun Microsystems. SunOS was based on BSD. SunOS was replaced by Solaris in 1992
  5. allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed. implement the protocol.