SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Contiguous
Allocation
1
Contiguous Allocation of Disk Space
Linked Allocation
File-Allocation Table (DOS, others)
•Section of disk at
start of partition
•Table with one entry
per disk block
•Indexed by block#
•Each entry contains
link to next block
•Special code for
EOF
•“0” means empty
block
Indexed Allocation
 Brings all pointers (for one file) together into an
index block.
 Supports both sequential and random access
• (Index into table, pointer to block)
 Wasteful for small files (use entire block for index)
• But no external fragmentation
 Logical view.
index table
Example of Indexed Allocation
Indexed Allocation – Multilevel Index
(Supports very large file size)

outer-index
index table file
Combined Scheme: UNIX inode
(Example with 4K bytes per block)
1212
linklink
Size:blocks, bytes
One inode table
per partition
64 bytes per inode
Directory entries
point to inode
Link count
Direct index
supports 48k file
Double indirect
supports huge
files (>4 GB)
Maximum File Size with inodes
 Assume 12 direct blocks, 4K blocks, 4 byte block
pointer
 Estimate maximum addressable up to the double
indirect blocks:
• Direct blocks (12) 48k
• Single indirect (4096/4=1024 ptrs to blocks) 4096k
• Double indirect (1024 of these) 4194304k
• Total 4198448k
• (> 4 GB)
 Didn’t even use triple indirect!
File Access With Unix inodes
 “Superblock” and
other structures
not shown
 “root” directory is
inode #2
 Directories contain
pointers to inodes
 Access path
shown to
/usr/bin/wc
 Notice 8 disk
accesses to get
first block of wc!
inodes
(root)
root
directory
usr
directory
bin
directory
wc
(file)
Data blocks
usr
bin
wc
#2
0
n
In-Memory File System Structures Re-Visited:
(Unix Case)
Opening
A file
Reading
A file
inode
Copy of
inode
Pointer to
Memory copy
Of inode
Free-Space Management
 Bit vector (n blocks)
…
0 1 2 n-1
bit[i] =

1 ⇒ block[i] free
0 ⇒ block[i] occupied
To find a free block: find the first non-zero
word, locate first 1-bit.
Block number (of first free block) is:
umber of bits per word) * (number of 0-value words) + offset of first 1
Bit Vector (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
• Just look for consecutive 1’s in bit map
Linked List of Free Space on Disk
Free List Approach
 Linked list
• Hard to find contiguous space easily
• But no waste of space
 Grouping
• Store addresses of n free blocks in the first block
• Last of these addresses is to a block that contains
addresses of another n free blocks
• So many free blocks can be found at one time
 Counting
• Clusters of contiguous free blocks recorded together
• Keep list of first block address, count of contiguous
free ones

Weitere ähnliche Inhalte

Was ist angesagt?

Op Sy 03 Ch 41
Op Sy 03 Ch 41Op Sy 03 Ch 41
Op Sy 03 Ch 41
Google
 
File management
File managementFile management
File management
Mohd Arif
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
myrajendra
 
Chapter 06
Chapter 06Chapter 06
Chapter 06
Google
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
C.U
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
tittuajay
 

Was ist angesagt? (19)

File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
 
File System and File allocation tables
File System and File allocation tablesFile System and File allocation tables
File System and File allocation tables
 
Op Sy 03 Ch 41
Op Sy 03 Ch 41Op Sy 03 Ch 41
Op Sy 03 Ch 41
 
Operating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsOperating Systems - Implementing File Systems
Operating Systems - Implementing File Systems
 
File management
File managementFile management
File management
 
Examining Linux File Structures
Examining Linux File StructuresExamining Linux File Structures
Examining Linux File Structures
 
Linux and windows file system
Linux and windows  file systemLinux and windows  file system
Linux and windows file system
 
File System Interface
File System InterfaceFile System Interface
File System Interface
 
Ch11 file system implementation
Ch11 file system implementationCh11 file system implementation
Ch11 file system implementation
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
 
File system Os
File system OsFile system Os
File system Os
 
File
FileFile
File
 
Chapter 06
Chapter 06Chapter 06
Chapter 06
 
Files
FilesFiles
Files
 
File management
File managementFile management
File management
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
 
Xfs file system for linux
Xfs file system for linuxXfs file system for linux
Xfs file system for linux
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 

Andere mochten auch

Index allocation 48 1
Index allocation 48 1Index allocation 48 1
Index allocation 48 1
myrajendra
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47
myrajendra
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48
myrajendra
 
Memory management early_systems
Memory management early_systemsMemory management early_systems
Memory management early_systems
Mybej Che
 
Scan scheduling 50 1
Scan scheduling 50 1Scan scheduling 50 1
Scan scheduling 50 1
myrajendra
 
C scan scheduling 50 2
C scan scheduling 50 2C scan scheduling 50 2
C scan scheduling 50 2
myrajendra
 
C look scheduling 51 1
C look scheduling 51 1C look scheduling 51 1
C look scheduling 51 1
myrajendra
 
Look scheduling.51
Look scheduling.51Look scheduling.51
Look scheduling.51
myrajendra
 
Sstf scheduling.50
Sstf scheduling.50Sstf scheduling.50
Sstf scheduling.50
myrajendra
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
myrajendra
 

Andere mochten auch (20)

Index allocation 48 1
Index allocation 48 1Index allocation 48 1
Index allocation 48 1
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47
 
Allocation Methods-R.D.Sivakumar
Allocation Methods-R.D.SivakumarAllocation Methods-R.D.Sivakumar
Allocation Methods-R.D.Sivakumar
 
Allocation Method
Allocation MethodAllocation Method
Allocation Method
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48
 
File system
File systemFile system
File system
 
memory allocation methods
memory allocation methodsmemory allocation methods
memory allocation methods
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Continguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelContinguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux Kernel
 
Memory management early_systems
Memory management early_systemsMemory management early_systems
Memory management early_systems
 
File system
File systemFile system
File system
 
SSM
SSMSSM
SSM
 
Scan scheduling 50 1
Scan scheduling 50 1Scan scheduling 50 1
Scan scheduling 50 1
 
C scan scheduling 50 2
C scan scheduling 50 2C scan scheduling 50 2
C scan scheduling 50 2
 
C look scheduling 51 1
C look scheduling 51 1C look scheduling 51 1
C look scheduling 51 1
 
Look scheduling.51
Look scheduling.51Look scheduling.51
Look scheduling.51
 
Sstf scheduling.50
Sstf scheduling.50Sstf scheduling.50
Sstf scheduling.50
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 

Ähnlich wie Contigious

chapter5-file system implementation.ppt
chapter5-file system implementation.pptchapter5-file system implementation.ppt
chapter5-file system implementation.ppt
BUSHRASHAIKH804312
 
AOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondAOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyond
Zubair Nabi
 
Allocation methods (1).pptx
Allocation methods (1).pptxAllocation methods (1).pptx
Allocation methods (1).pptx
ssuser55cbdb
 
There are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docxThere are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docx
susannr
 
There are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docxThere are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docx
susannr
 
There are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docxThere are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docx
susannr
 
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
Zubair Nabi
 
HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7
HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7
HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7
Hackito Ergo Sum
 

Ähnlich wie Contigious (20)

Internal representation of files ppt
Internal representation of files pptInternal representation of files ppt
Internal representation of files ppt
 
Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems
 
Ext2
Ext2Ext2
Ext2
 
File System Implementation.pptx
File System Implementation.pptxFile System Implementation.pptx
File System Implementation.pptx
 
Allocation and free space management
Allocation and free space managementAllocation and free space management
Allocation and free space management
 
chapter5-file system implementation.ppt
chapter5-file system implementation.pptchapter5-file system implementation.ppt
chapter5-file system implementation.ppt
 
Internal representation of file chapter 4 Sowmya Jyothi
Internal representation of file chapter 4 Sowmya JyothiInternal representation of file chapter 4 Sowmya Jyothi
Internal representation of file chapter 4 Sowmya Jyothi
 
file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.ppt
 
AOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyondAOS Lab 10: File system -- Inodes and beyond
AOS Lab 10: File system -- Inodes and beyond
 
Allocation methods (1).pptx
Allocation methods (1).pptxAllocation methods (1).pptx
Allocation methods (1).pptx
 
Disk and file operation
Disk and file operationDisk and file operation
Disk and file operation
 
There are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docxThere are 4 parts for the project. The question may be long to read .docx
There are 4 parts for the project. The question may be long to read .docx
 
There are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docxThere are 4 part for the project and the question may be long to rea.docx
There are 4 part for the project and the question may be long to rea.docx
 
There are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docxThere are 4 parts for the project. The question may be long to r.docx
There are 4 parts for the project. The question may be long to r.docx
 
OS_Ch12
OS_Ch12OS_Ch12
OS_Ch12
 
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
 
HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7
HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7
HES2011 - Tarjei Mandt – Kernel Pool Exploitation on Windows 7
 
Ch 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashingCh 17 disk storage, basic files structure, and hashing
Ch 17 disk storage, basic files structure, and hashing
 
In-depth forensic analysis of Windows registry files
In-depth forensic analysis of Windows registry filesIn-depth forensic analysis of Windows registry files
In-depth forensic analysis of Windows registry files
 
Ch11 file system implementation
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementation
 

Mehr von Ramasubbu .P (20)

radar
radarradar
radar
 
Press
PressPress
Press
 
Milling 2
Milling 2Milling 2
Milling 2
 
MIlling 1
MIlling 1MIlling 1
MIlling 1
 
Drillings
DrillingsDrillings
Drillings
 
Holding
HoldingHolding
Holding
 
Saftey
SafteySaftey
Saftey
 
Harvesting
HarvestingHarvesting
Harvesting
 
Plough
PloughPlough
Plough
 
Tractor PTO
Tractor PTOTractor PTO
Tractor PTO
 
Tractor Components
Tractor ComponentsTractor Components
Tractor Components
 
MSAT
MSATMSAT
MSAT
 
GPS
GPSGPS
GPS
 
RTOS
RTOSRTOS
RTOS
 
Virus
VirusVirus
Virus
 
Hacker
HackerHacker
Hacker
 
Denail of Service
Denail of ServiceDenail of Service
Denail of Service
 
RAID CONCEPT
RAID CONCEPTRAID CONCEPT
RAID CONCEPT
 
Network Security
Network SecurityNetwork Security
Network Security
 
Timer
TimerTimer
Timer
 

Kürzlich hochgeladen

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
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
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Kürzlich hochgeladen (20)

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
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
 
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
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Contigious

  • 4. File-Allocation Table (DOS, others) •Section of disk at start of partition •Table with one entry per disk block •Indexed by block# •Each entry contains link to next block •Special code for EOF •“0” means empty block
  • 5. Indexed Allocation  Brings all pointers (for one file) together into an index block.  Supports both sequential and random access • (Index into table, pointer to block)  Wasteful for small files (use entire block for index) • But no external fragmentation  Logical view. index table
  • 6. Example of Indexed Allocation
  • 7. Indexed Allocation – Multilevel Index (Supports very large file size)  outer-index index table file
  • 8. Combined Scheme: UNIX inode (Example with 4K bytes per block) 1212 linklink Size:blocks, bytes One inode table per partition 64 bytes per inode Directory entries point to inode Link count Direct index supports 48k file Double indirect supports huge files (>4 GB)
  • 9. Maximum File Size with inodes  Assume 12 direct blocks, 4K blocks, 4 byte block pointer  Estimate maximum addressable up to the double indirect blocks: • Direct blocks (12) 48k • Single indirect (4096/4=1024 ptrs to blocks) 4096k • Double indirect (1024 of these) 4194304k • Total 4198448k • (> 4 GB)  Didn’t even use triple indirect!
  • 10. File Access With Unix inodes  “Superblock” and other structures not shown  “root” directory is inode #2  Directories contain pointers to inodes  Access path shown to /usr/bin/wc  Notice 8 disk accesses to get first block of wc! inodes (root) root directory usr directory bin directory wc (file) Data blocks usr bin wc #2 0 n
  • 11. In-Memory File System Structures Re-Visited: (Unix Case) Opening A file Reading A file inode Copy of inode Pointer to Memory copy Of inode
  • 12. Free-Space Management  Bit vector (n blocks) … 0 1 2 n-1 bit[i] =  1 ⇒ block[i] free 0 ⇒ block[i] occupied To find a free block: find the first non-zero word, locate first 1-bit. Block number (of first free block) is: umber of bits per word) * (number of 0-value words) + offset of first 1
  • 13. Bit Vector (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 • Just look for consecutive 1’s in bit map
  • 14. Linked List of Free Space on Disk
  • 15. Free List Approach  Linked list • Hard to find contiguous space easily • But no waste of space  Grouping • Store addresses of n free blocks in the first block • Last of these addresses is to a block that contains addresses of another n free blocks • So many free blocks can be found at one time  Counting • Clusters of contiguous free blocks recorded together • Keep list of first block address, count of contiguous free ones