SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Method in oop
Method in oopMethod in oop
Method in oop
 
Memory allocation (4)
Memory allocation (4)Memory allocation (4)
Memory allocation (4)
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Spanning trees
Spanning treesSpanning trees
Spanning trees
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
File records on disk
File records on diskFile records on disk
File records on disk
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Memory management
Memory managementMemory management
Memory management
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
Association agggregation and composition
Association agggregation and compositionAssociation agggregation and composition
Association agggregation and composition
 
Loaders
LoadersLoaders
Loaders
 
File Management – File Concept, access methods, File types and File Operation
File Management – File Concept, access methods,  File types and File OperationFile Management – File Concept, access methods,  File types and File Operation
File Management – File Concept, access methods, File types and File Operation
 
Basic Garbage Collection Techniques
Basic  Garbage  Collection  TechniquesBasic  Garbage  Collection  Techniques
Basic Garbage Collection Techniques
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
page replacement.pptx
page replacement.pptxpage replacement.pptx
page replacement.pptx
 
Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
 

Andere mochten auch

Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1Amir Payberah
 
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
 
File management ppt
File management pptFile management ppt
File management pptmarotti
 

Andere mochten auch (20)

File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
 
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
 
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
 
File management ppt
File management pptFile management ppt
File management ppt
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von Rotract CLUB of BSAU

Mehr von 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
 

Kürzlich hochgeladen

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 

Kürzlich hochgeladen (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

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

Hinweis der Redaktion

  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.