SlideShare a Scribd company logo
UNIT – 5
FILE SYSTEM IMPLEMENTATION
AND MASS STORAGE STRUCTURE
FILE SYSTEM STRUCTURE
• Disks provide the bulk of secondary storage on
which a file system is maintained.
Characteristics
• A disk can be rewritten in place; it is possible to
read a block from the disk, modify the block, and
write it back into the same place.
• A disk can access directly any given block of
information it contains.
Layered File System
• Application program layer
• Logical file system layer – Meta data(File
structure)
• File organization modules layer – Information
about files and logical blocks(Mapping)
• Basic file system layer – generates commands
for device driver(To read and write data)
• I/O control interface – consist of device driver
and interrupts.
• Physical h/w devices layer
FILE SYSTEM IMPLEMENTATION
• File-System Implementation are done by the
following
• On-disk structure
• In-memory structure
On-disk
• On-disk is the file system may contain
information about
» How to boot an operating system stored there
» The total number of blocks
» The number and location of free blocks
» The directory structure
» Individual files
On-disk structure:
• The On-disk structure include
» Boot control block
• Contain information needed by the system to boot an
operating system from the volume
• First block of a volume.
» Volume control block
• Contains volume details, such as the number of blocks in the
partition, size of the blocks, free block count and free-block
pointers, and free FCB count and FCB pointers.
» Directory structure
• Used to organize the files.
» FCB
• Contains the details about the file, including file permissions,
ownership, size, and location of the data blocks.
File data blocks
File permissions
File dates (create, access,
write)
File owner, group, ACL
File Size
• In-memory Structure
• The structures may include the ones described
below
» In-memory mount table
• Contains information about each mounted volume
» In-memory directory-structure
• Holds the directory information of recently accessed
directories
» System-wide open-file table
• Contains a copy of the FCB of each open file as well as other
information
» Per-process open file table
• Contains a pointer to the appropriate entry in the system-
wide open file table as well as other information
• In-memory file-system structures for File open.
• In-memory file-system structures for File read
Directory Implementation
• Linear list of file names with pointer to the data blocks
– Simple to program
– Time-consuming to execute
• Linear search time
• Could keep ordered alphabetically via linked list or
use B+ tree
• Hash Table – linear list with hash data structure
– Decreases directory search time
• Collisions – A collision is a situation where two file names
hash to the same location. Alternatively, a chained-overflow
hash table can be used to avoid collisions
Allocation methods
• Allocation methods is a methods used to
allocate space to the files for
-Utilizing the disk space effectively
-Accessing the files quickly
Methods
• Contiguous allocation
• Linked allocation
• Indexed allocation
Allocation Methods - Contiguous
• An allocation method refers to how disk blocks are
allocated for files:
• Contiguous allocation – each file occupies set of
contiguous blocks
– Best performance in most cases
– Simple – only starting location (block #) and
length (number of blocks) are required
– Problems include finding space for file, knowing
file size, external fragmentation, need for
compaction off-line (downtime) or on-line
Contiguous Allocation
• Mapping from logical to physical
Allocation Methods - Linked
• Linked allocation – each file a linked list
of blocks
– File ends at nil pointer
– No external fragmentation
– Each block contains pointer to next block
– No compaction, external fragmentation
Linked Allocation
File-Allocation Table
Allocation Methods - Indexed
• Indexed allocation
– Each file has its own index block(s) of pointers to
its data blocks
• Logical view
index table
Example of Indexed Allocation
Indexed Allocation – Mapping
(Cont.)
Free-Space Management
• Maintaining the free-space list to keep track of free disk space.
• File system maintains free-space list to track available blocks/clusters
– (Using term “block” for simplicity)
• Bit vector or bit map (n blocks)
…
0 1 2 n-1
bit[i] =

1  block[i] free
0  block[i] occupied
3,4,6 free block
• File Creation
– Search the free space list for the required amount of space
– Space is removed from the free space list and allocate it to
the new file
• File Deletion
– Disk space is added to the free space list
• Types of mechanism
• The Free space list can be maintained in the following
ways
– Bit Vector
– Linked List
– Grouping
– Counting
Free-Space Management (Cont.)
• Bit map requires extra space
• Each block is represented by 1 bit. If the block is free the bit is 1 if the
block is allocated the bit is 0.
Linked Free Space List on Disk
 Linked list (free list)
 Cannot get contiguous
space easily
 No waste of space
 No need to traverse the
entire list (if # free blocks
recorded)
Free-Space Management (Cont.)
• Grouping
• A modification of the free list approach is to store the
addresses of n free blocks in the first free block.
• plus a pointer to next block that contains free-block-pointers
(like this one)
• Counting
• Keep address of first free block and count of following
free blocks
• Free space list then has entries containing addresses and
counts
DISK STRUCTURE
• The traditional head-sector-cylinder, HSC
numbers are mapped to linear block
addresses by numbering the first sector on the
first head on the outermost track as sector 0.
• Numbering proceeds with the rest of the
sectors on that same track, and then the rest
of the tracks on the same cylinder before
proceeding through the rest of the cylinders to
the centre of the disk
Disk Scheduling
• Minimize seek time
• Seek time  seek distance
• Disk bandwidth is the total number of
bytes transferred, divided by the total
time between the first request for
service and the completion of the last
transfer
Disk Scheduling (Cont.)
• To service a requset,a disk system requires that
the head to be moved the desired track,then a
wait for latency and finally transfer it
• Several algorithms exist to schedule the
servicing of disk I/O requests
1. FIFO
2. Shortest seek time first
3. Scan
4. Circular scan
5. LOOK
6. Circular LOOK
• The analysis is true for one or many platters
• We illustrate scheduling algorithms with a
request queue (0-199)
98, 183, 37, 122, 14, 124, 65, 67
Head pointer 53
FCFS
Illustration shows total head movement of 640 cylinders
SSTF
• Shortest Seek Time First selects the request
with the minimum seek time from the
current head position
• SSTF scheduling is a form of SJF scheduling
• Illustration shows total head movement of
236 cylinders
SCAN
• The disk arm starts at one end of the
disk, and moves toward the other end,
servicing requests until it gets to the
other end of the disk, where the head
movement is reversed and servicing
continues.
• SCAN algorithm Sometimes called the
elevator algorithm
SCAN (Cont.)
C-SCAN
• The head moves from one end of the disk to
the other, servicing requests as it goes
– When it reaches the other end, however, it
immediately returns to the beginning of the
disk, without servicing any requests on the
return trip
• Treats the cylinders as a circular list that
wraps around from the last cylinder to the
first one
• Total number of cylinders?
C-SCAN (Cont.)
LOOK
• Similar to SCAN beginning direction
• it reverses the direction immediately,
without going all the way to the end of
the disk
C-LOOK
• C-LOOK a version of C-SCAN
• Arm only goes as far as the last
request in each direction, then
reverses direction immediately,
without first going all the way to the
end of the disk
C-LOOK (Cont.)
Linux
File system
• Computer network is used to support RFS
• File transfer protocol(FTP) and Secure shell
protocol(SSP)
Client-server model:
1.Client
2.Server
3.Service
• Clients -mount remote file system from server
• Client open communication channel using IP
address of the remote host and port address
• Server opens to start service
• Network File system(NFS) – standard for UNIX
client server file sharing protocol
• Common Internet File system – WINDOWS
Failure modes
Reason for local file system failure
• Media fails where the file system is stored
• Corruption of directory structure
• Power cable and hard disk cable failure
• Disk controller failure
• Host adapter failure
Consistency semantics
• Related with file sharing
• When does the changes of original file reflect to
other users
1.Unix – Writes to open file immediately visible
2.Session - Writes to open file not visible. Once the
file is closed, the changes are visible only to new
sessions
3.Immutable – Becomes immutable and read only
4.Transaction like semantics
Record blocking
• File is a collection of data records
1.Fixed blocking
2.Variable length spanned blocking – records are
packed into blocks without wastage of space
3.Variable length unspanned – Large wastage

More Related Content

Similar to OS Unit5.pptx

Os
OsOs
Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02
Seshu Chakravarthy
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
ChethanaThammaiah
 
AOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksAOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksZubair Nabi
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
YuvrajWadavale
 
16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf
3operatordcslipiPeng
 
Mass storage systems presentation operating systems
Mass storage systems presentation operating systemsMass storage systems presentation operating systems
Mass storage systems presentation operating systems
night1ng4ale
 
Windows Forensics- Introduction and Analysis
Windows Forensics- Introduction and AnalysisWindows Forensics- Introduction and Analysis
Windows Forensics- Introduction and Analysis
Don Caeiro
 
7. Memory management in operating system.ppt
7. Memory management in operating system.ppt7. Memory management in operating system.ppt
7. Memory management in operating system.ppt
imrank39199
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
A29ShirleyDhawadkar
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
Geetha Kannan
 
OS UNIT4.pptx
OS UNIT4.pptxOS UNIT4.pptx
OS UNIT4.pptx
DHANABALSUBRAMANIAN
 
Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer Management
AnshGoyal32
 
storage techniques_overview-1.pptx
storage techniques_overview-1.pptxstorage techniques_overview-1.pptx
storage techniques_overview-1.pptx
20CS102RAMMPRASHATHK
 
virtual_memory (3).pptx
virtual_memory (3).pptxvirtual_memory (3).pptx
virtual_memory (3).pptx
HyperGamingPUBG
 
Ch10 file system interface
Ch10   file system interfaceCh10   file system interface
Ch10 file system interface
Welly Dian Astika
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdf
Christalin Nelson
 

Similar to OS Unit5.pptx (20)

Os7
Os7Os7
Os7
 
Os
OsOs
Os
 
Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
 
AOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocksAOS Lab 9: File system -- Of buffers, logs, and blocks
AOS Lab 9: File system -- Of buffers, logs, and blocks
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
 
16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf
 
Mass storage systems presentation operating systems
Mass storage systems presentation operating systemsMass storage systems presentation operating systems
Mass storage systems presentation operating systems
 
Windows Forensics- Introduction and Analysis
Windows Forensics- Introduction and AnalysisWindows Forensics- Introduction and Analysis
Windows Forensics- Introduction and Analysis
 
7. Memory management in operating system.ppt
7. Memory management in operating system.ppt7. Memory management in operating system.ppt
7. Memory management in operating system.ppt
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
OS UNIT4.pptx
OS UNIT4.pptxOS UNIT4.pptx
OS UNIT4.pptx
 
Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer Management
 
storage techniques_overview-1.pptx
storage techniques_overview-1.pptxstorage techniques_overview-1.pptx
storage techniques_overview-1.pptx
 
virtual_memory (3).pptx
virtual_memory (3).pptxvirtual_memory (3).pptx
virtual_memory (3).pptx
 
Ch10 file system interface
Ch10   file system interfaceCh10   file system interface
Ch10 file system interface
 
DiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdfDiskStorage_BasicFileStructuresandHashing.pdf
DiskStorage_BasicFileStructuresandHashing.pdf
 
kerch04.ppt
kerch04.pptkerch04.ppt
kerch04.ppt
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 

More from DHANABALSUBRAMANIAN

unit 2.ppt
unit 2.pptunit 2.ppt
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
DHANABALSUBRAMANIAN
 
Unit 4.ppt
Unit 4.pptUnit 4.ppt
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit -- 5.ppt
Unit -- 5.pptUnit -- 5.ppt
Unit -- 5.ppt
DHANABALSUBRAMANIAN
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit - 5.ppt
Unit - 5.pptUnit - 5.ppt
Unit - 5.ppt
DHANABALSUBRAMANIAN
 
Unit - 3.ppt
Unit - 3.pptUnit - 3.ppt
Unit - 3.ppt
DHANABALSUBRAMANIAN
 
unit -1.ppt
unit -1.pptunit -1.ppt
unit -1.ppt
DHANABALSUBRAMANIAN
 
Unit -2.ppt
Unit -2.pptUnit -2.ppt
Unit -2.ppt
DHANABALSUBRAMANIAN
 
OS UNIT1.pptx
OS UNIT1.pptxOS UNIT1.pptx
OS UNIT1.pptx
DHANABALSUBRAMANIAN
 
OS UNIT2.ppt
OS UNIT2.pptOS UNIT2.ppt
OS UNIT2.ppt
DHANABALSUBRAMANIAN
 
OS UNIT3.pptx
OS UNIT3.pptxOS UNIT3.pptx
OS UNIT3.pptx
DHANABALSUBRAMANIAN
 

More from DHANABALSUBRAMANIAN (14)

unit 2.ppt
unit 2.pptunit 2.ppt
unit 2.ppt
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
 
Unit 4.ppt
Unit 4.pptUnit 4.ppt
Unit 4.ppt
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
 
Unit -- 5.ppt
Unit -- 5.pptUnit -- 5.ppt
Unit -- 5.ppt
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 3.ppt
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
Unit - 5.ppt
Unit - 5.pptUnit - 5.ppt
Unit - 5.ppt
 
Unit - 3.ppt
Unit - 3.pptUnit - 3.ppt
Unit - 3.ppt
 
unit -1.ppt
unit -1.pptunit -1.ppt
unit -1.ppt
 
Unit -2.ppt
Unit -2.pptUnit -2.ppt
Unit -2.ppt
 
OS UNIT1.pptx
OS UNIT1.pptxOS UNIT1.pptx
OS UNIT1.pptx
 
OS UNIT2.ppt
OS UNIT2.pptOS UNIT2.ppt
OS UNIT2.ppt
 
OS UNIT3.pptx
OS UNIT3.pptxOS UNIT3.pptx
OS UNIT3.pptx
 

Recently uploaded

How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

OS Unit5.pptx

  • 1. UNIT – 5 FILE SYSTEM IMPLEMENTATION AND MASS STORAGE STRUCTURE
  • 2. FILE SYSTEM STRUCTURE • Disks provide the bulk of secondary storage on which a file system is maintained. Characteristics • A disk can be rewritten in place; it is possible to read a block from the disk, modify the block, and write it back into the same place. • A disk can access directly any given block of information it contains.
  • 4. • Application program layer • Logical file system layer – Meta data(File structure) • File organization modules layer – Information about files and logical blocks(Mapping) • Basic file system layer – generates commands for device driver(To read and write data) • I/O control interface – consist of device driver and interrupts. • Physical h/w devices layer
  • 5. FILE SYSTEM IMPLEMENTATION • File-System Implementation are done by the following • On-disk structure • In-memory structure On-disk • On-disk is the file system may contain information about » How to boot an operating system stored there » The total number of blocks » The number and location of free blocks » The directory structure » Individual files
  • 6. On-disk structure: • The On-disk structure include » Boot control block • Contain information needed by the system to boot an operating system from the volume • First block of a volume. » Volume control block • Contains volume details, such as the number of blocks in the partition, size of the blocks, free block count and free-block pointers, and free FCB count and FCB pointers. » Directory structure • Used to organize the files. » FCB • Contains the details about the file, including file permissions, ownership, size, and location of the data blocks. File data blocks File permissions File dates (create, access, write) File owner, group, ACL File Size
  • 7. • In-memory Structure • The structures may include the ones described below » In-memory mount table • Contains information about each mounted volume » In-memory directory-structure • Holds the directory information of recently accessed directories » System-wide open-file table • Contains a copy of the FCB of each open file as well as other information » Per-process open file table • Contains a pointer to the appropriate entry in the system- wide open file table as well as other information
  • 8. • In-memory file-system structures for File open.
  • 9. • In-memory file-system structures for File read
  • 10. Directory Implementation • Linear list of file names with pointer to the data blocks – Simple to program – Time-consuming to execute • Linear search time • Could keep ordered alphabetically via linked list or use B+ tree • Hash Table – linear list with hash data structure – Decreases directory search time • Collisions – A collision is a situation where two file names hash to the same location. Alternatively, a chained-overflow hash table can be used to avoid collisions
  • 11. Allocation methods • Allocation methods is a methods used to allocate space to the files for -Utilizing the disk space effectively -Accessing the files quickly Methods • Contiguous allocation • Linked allocation • Indexed allocation
  • 12. Allocation Methods - Contiguous • An allocation method refers to how disk blocks are allocated for files: • Contiguous allocation – each file occupies set of contiguous blocks – Best performance in most cases – Simple – only starting location (block #) and length (number of blocks) are required – Problems include finding space for file, knowing file size, external fragmentation, need for compaction off-line (downtime) or on-line
  • 13. Contiguous Allocation • Mapping from logical to physical
  • 14. Allocation Methods - Linked • Linked allocation – each file a linked list of blocks – File ends at nil pointer – No external fragmentation – Each block contains pointer to next block – No compaction, external fragmentation
  • 17. Allocation Methods - Indexed • Indexed allocation – Each file has its own index block(s) of pointers to its data blocks • Logical view index table
  • 18. Example of Indexed Allocation
  • 19. Indexed Allocation – Mapping (Cont.)
  • 20. Free-Space Management • Maintaining the free-space list to keep track of free disk space. • File system maintains free-space list to track available blocks/clusters – (Using term “block” for simplicity) • Bit vector or bit map (n blocks) … 0 1 2 n-1 bit[i] =  1  block[i] free 0  block[i] occupied 3,4,6 free block
  • 21. • File Creation – Search the free space list for the required amount of space – Space is removed from the free space list and allocate it to the new file • File Deletion – Disk space is added to the free space list • Types of mechanism • The Free space list can be maintained in the following ways – Bit Vector – Linked List – Grouping – Counting
  • 22. Free-Space Management (Cont.) • Bit map requires extra space • Each block is represented by 1 bit. If the block is free the bit is 1 if the block is allocated the bit is 0.
  • 23. Linked Free Space List on Disk  Linked list (free list)  Cannot get contiguous space easily  No waste of space  No need to traverse the entire list (if # free blocks recorded)
  • 24. Free-Space Management (Cont.) • Grouping • A modification of the free list approach is to store the addresses of n free blocks in the first free block. • plus a pointer to next block that contains free-block-pointers (like this one) • Counting • Keep address of first free block and count of following free blocks • Free space list then has entries containing addresses and counts
  • 25. DISK STRUCTURE • The traditional head-sector-cylinder, HSC numbers are mapped to linear block addresses by numbering the first sector on the first head on the outermost track as sector 0. • Numbering proceeds with the rest of the sectors on that same track, and then the rest of the tracks on the same cylinder before proceeding through the rest of the cylinders to the centre of the disk
  • 26. Disk Scheduling • Minimize seek time • Seek time  seek distance • Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer
  • 27. Disk Scheduling (Cont.) • To service a requset,a disk system requires that the head to be moved the desired track,then a wait for latency and finally transfer it • Several algorithms exist to schedule the servicing of disk I/O requests 1. FIFO 2. Shortest seek time first 3. Scan 4. Circular scan 5. LOOK 6. Circular LOOK
  • 28. • The analysis is true for one or many platters • We illustrate scheduling algorithms with a request queue (0-199) 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53
  • 29. FCFS Illustration shows total head movement of 640 cylinders
  • 30.
  • 31. SSTF • Shortest Seek Time First selects the request with the minimum seek time from the current head position • SSTF scheduling is a form of SJF scheduling • Illustration shows total head movement of 236 cylinders
  • 32.
  • 33.
  • 34. SCAN • The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues. • SCAN algorithm Sometimes called the elevator algorithm
  • 36.
  • 37. C-SCAN • The head moves from one end of the disk to the other, servicing requests as it goes – When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip • Treats the cylinders as a circular list that wraps around from the last cylinder to the first one • Total number of cylinders?
  • 39. LOOK • Similar to SCAN beginning direction • it reverses the direction immediately, without going all the way to the end of the disk
  • 40. C-LOOK • C-LOOK a version of C-SCAN • Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk
  • 42. Linux File system • Computer network is used to support RFS • File transfer protocol(FTP) and Secure shell protocol(SSP) Client-server model: 1.Client 2.Server 3.Service
  • 43. • Clients -mount remote file system from server • Client open communication channel using IP address of the remote host and port address • Server opens to start service • Network File system(NFS) – standard for UNIX client server file sharing protocol • Common Internet File system – WINDOWS
  • 44. Failure modes Reason for local file system failure • Media fails where the file system is stored • Corruption of directory structure • Power cable and hard disk cable failure • Disk controller failure • Host adapter failure
  • 45. Consistency semantics • Related with file sharing • When does the changes of original file reflect to other users 1.Unix – Writes to open file immediately visible 2.Session - Writes to open file not visible. Once the file is closed, the changes are visible only to new sessions 3.Immutable – Becomes immutable and read only 4.Transaction like semantics
  • 46. Record blocking • File is a collection of data records 1.Fixed blocking 2.Variable length spanned blocking – records are packed into blocks without wastage of space 3.Variable length unspanned – Large wastage