SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
inodes explained
   Tutorial 3 - CSCI212

    by: Roman Tarnavski
Data Blocks

A file system contains ‘blocks’ which hold
data called inodes. A inode describes a
single file in the file system. Typical
information described includes, ownership,
modification times, size and permissions. We
call this information meta-data.
                             Source: CSCI212 Lecture Notes
                                   by: Daniel Saffioti
Data Blocks


Data Blocks

The remainder of the file system (larger proportion)
contains data blocks. These store the contents of
files.

                                 Source: CSCI212 Lecture Notes
                                       by: Daniel Saffioti
Source: CSCI212 Lecture Notes
      by: Daniel Saffioti
Your typical inode
          Mode
       Permissions
           Size
       Timestamps




       Direct Blocks




          Single
         Double
          Triple
Direct
         Data Block 1
         Data Block 2

             .
             .
Direct       .
Direct   Data Block 3
Direct
Direct
Direct
Direct
Direct
Direct
Direct
Direct
Direct
Direct
Single
Double
Triple
Single
Direct                    Data Block 1
Direct                    Data Block 2
Direct
Direct
Direct                   Data Block 2048

Direct
Direct     Address 1

Direct     Address 2

Direct        .
              .
Direct        .
Direct    Address 2048

Direct
Single
Double
Triple
Double
Direct                                    Data Block 1

Direct                                    Data Block 2

Direct
Direct                     Address 1
Direct                     Address 2     Data Block 2048

Direct                        .
                              .
Direct    Address 1           .
Direct    Address 2       Address 2048
Direct       .                            Data Block 1
             .
Direct       .                            Data Block 2
Direct   Address 2048
Direct
                           Address 1
Single                                   Data Block 2048
                           Address 2
Double
                              .
Triple                        .
                              .
                          Address 2048
Triple
                                                         Data Block 1
                                                         Data Block 2

Direct
Direct                                    Address 1
                                          Address 2     Data Block 2048
Direct
Direct                                       .
                                             .
Direct    Address 1        Address 1         .

Direct    Address 2        Address 2     Address 2048

Direct       .                .                          Data Block 1
             .                .
Direct
             .                .                          Data Block 2

Direct   Address 2048     Address 2048

Direct                                    Address 1
Direct                                    Address 2     Data Block 2048

Direct                                       .
                                             .
Single                     Address 1         .
Double                     Address 2     Address 2048
Triple                        .
                              .                          Data Block 1
                              .
                                                         Data Block 2
                          Address 2048


                                          Address 1
                                          Address 2     Data Block 2048

                                             .
                           Address 1         .
                                             .
                           Address 2
                                         Address 2048
                              .
                              .
                              .
                          Address 2048
All Together?
Data Block 1
         Data Block 2

             .
             .
Direct       .           Data Block 1
Direct   Data Block 3    Data Block 2
Direct
Direct
Direct                  Data Block 2048

Direct                                     Data Block 1

Direct    Address 1                        Data Block 2
                          Address 1
Direct    Address 2                       Data Block 2048
                          Address 2
Direct       .
             .                .
Direct       .                .
                              .
Direct   Address 2048                      Data Block 1
                        Address 2048
Direct                                     Data Block 2

Single
Double                    Address 1
Triple                                    Data Block 2048
                          Address 2
          Address 1
                              .                                Data Block 1
          Address 2           .
                              .                                Data Block 2
             .
             .          Address 2048
             .
         Address 2048                            Address 1
                                                 Address 2    Data Block 2048

                                                    .
                                                    .
          Address 1         Address 1               .
          Address 2         Address 2          Address 2048

             .                    .                            Data Block 1
             .                    .
             .                    .                            Data Block 2
         Address 2048     Address 2048

                                                 Address 1
                                                 Address 2    Data Block 2048

                                                    .
                                                    .
                            Address 1               .
                            Address 2          Address 2048

                                  .
                                  .                            Data Block 1
                                  .
                                                               Data Block 2
                          Address 2048


                                                 Address 1
                                                 Address 2    Data Block 2048

                                                    .
                            Address 1               .
                                                    .
                            Address 2
                                               Address 2048
                                  .
                                  .
                                  .
                          Address 2048
Maximum Size of Direct
       Blocks
Maximum Size of Direct
       Blocks
 Where did the 2048 Addresses come from?
Maximum Size of Direct
       Blocks
 Where did the 2048 Addresses come from?

 Assuming 32-bit architectures
Maximum Size of Direct
       Blocks
 Where did the 2048 Addresses come from?

 Assuming 32-bit architectures

   32-bit = 4 bytes (32 / 8)
Maximum Size of Direct
       Blocks
 Where did the 2048 Addresses come from?

 Assuming 32-bit architectures

   32-bit = 4 bytes (32 / 8)

   Thus 8192   [block size]   /4   [bytes per addressable block]
Maximum Size of Direct
       Blocks
 Where did the 2048 Addresses come from?

 Assuming 32-bit architectures

   32-bit = 4 bytes (32 / 8)

   Thus 8192   [block size]   /4   [bytes per addressable block]



   = 2048 Addressable Blocks
Questions



What is the maximum possible file size that
can be represented via direct data blocks?
Maximum Size of Direct
       Blocks

    block size
             blocks

 = 8192 x 12 = 98,304 bytes = 96Kb
Maximum FileSize using
 First-Indirect Linking
Maximum FileSize using
 First-Indirect Linking

 Direct: 12 blocks @ 8192 bytes (12 x 8192)
Maximum FileSize using
 First-Indirect Linking

 Direct: 12 blocks @ 8192 bytes (12 x 8192)

   =96Kb
Maximum FileSize using
 First-Indirect Linking

 Direct: 12 blocks @ 8192 bytes (12 x 8192)

    =96Kb

 Indirect: 2048 @ 8192 (2048 x 8192) =
 16,384 Kb = 16,480 [Inclusive of Direct] = 16.09Mb
Maximum using Double
      Indirect

16,875,520 x 2048 addressable blocks

= 34,561,064,960 bytes

= 32,960 Mbytes
Maximum Filesize
        [direct + single + double + triple]




2048 x 32.1875Gb

= 64.375 Tb
Overhead
Overhead
Wish to store: 8,437,760 bytes
Overhead
Wish to store: 8,437,760 bytes

8437760 / 8192   [bytes per block]




= 1030 blocks x 4 bytes              [per address]



BUT
Overhead
Wish to store: 8,437,760 bytes

8437760 / 8192   [bytes per block]




= 1030 blocks x 4 bytes              [per address]



BUT

12 Blocks are stored directly
Overhead
Wish to store: 8,437,760 bytes

8437760 / 8192   [bytes per block]




= 1030 blocks x 4 bytes              [per address]



BUT

12 Blocks are stored directly

Hence we only have 1018 blocks
Overhead
Wish to store: 8,437,760 bytes

8437760 / 8192   [bytes per block]




= 1030 blocks x 4 bytes              [per address]



BUT

12 Blocks are stored directly

Hence we only have 1018 blocks

1018 x 4 bytes = 4072 bytes = 3.98Kbytes

Contenu connexe

En vedette

The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structure
Teja Bheemanapally
 
File management
File managementFile management
File management
Mohd Arif
 

En vedette (19)

Unix File System
Unix File SystemUnix File System
Unix File System
 
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
 
Unix training session 1
Unix training   session 1Unix training   session 1
Unix training session 1
 
SO-08 Sistemas de Arquivos
SO-08 Sistemas de ArquivosSO-08 Sistemas de Arquivos
SO-08 Sistemas de Arquivos
 
NTFS and Inode
NTFS and InodeNTFS and Inode
NTFS and Inode
 
The linux file system structure
The linux file system structureThe linux file system structure
The linux file system structure
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file system
 
Linux file system
Linux file systemLinux file system
Linux file system
 
실무로 배우는 시스템 성능 최적화 - 4부. 프로세스 이해하기
실무로 배우는 시스템 성능 최적화 - 4부. 프로세스 이해하기실무로 배우는 시스템 성능 최적화 - 4부. 프로세스 이해하기
실무로 배우는 시스템 성능 최적화 - 4부. 프로세스 이해하기
 
4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
 
실무로 배우는 시스템 성능 최적화 8부 - 1,2,3장
실무로 배우는 시스템 성능 최적화 8부 - 1,2,3장실무로 배우는 시스템 성능 최적화 8부 - 1,2,3장
실무로 배우는 시스템 성능 최적화 8부 - 1,2,3장
 
실무로배우는시스템성능최적화 Ch1
실무로배우는시스템성능최적화 Ch1실무로배우는시스템성능최적화 Ch1
실무로배우는시스템성능최적화 Ch1
 
System calls
System callsSystem calls
System calls
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
File System and File allocation tables
File System and File allocation tablesFile System and File allocation tables
File System and File allocation tables
 
File management
File managementFile management
File management
 
Operating Systems - Processor Management
Operating Systems - Processor ManagementOperating Systems - Processor Management
Operating Systems - Processor Management
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 

Dernier

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Inode explanation

  • 1. inodes explained Tutorial 3 - CSCI212 by: Roman Tarnavski
  • 2. Data Blocks A file system contains ‘blocks’ which hold data called inodes. A inode describes a single file in the file system. Typical information described includes, ownership, modification times, size and permissions. We call this information meta-data. Source: CSCI212 Lecture Notes by: Daniel Saffioti
  • 3. Data Blocks Data Blocks The remainder of the file system (larger proportion) contains data blocks. These store the contents of files. Source: CSCI212 Lecture Notes by: Daniel Saffioti
  • 4. Source: CSCI212 Lecture Notes by: Daniel Saffioti
  • 5. Your typical inode Mode Permissions Size Timestamps Direct Blocks Single Double Triple
  • 6. Direct Data Block 1 Data Block 2 . . Direct . Direct Data Block 3 Direct Direct Direct Direct Direct Direct Direct Direct Direct Direct Single Double Triple
  • 7. Single Direct Data Block 1 Direct Data Block 2 Direct Direct Direct Data Block 2048 Direct Direct Address 1 Direct Address 2 Direct . . Direct . Direct Address 2048 Direct Single Double Triple
  • 8. Double Direct Data Block 1 Direct Data Block 2 Direct Direct Address 1 Direct Address 2 Data Block 2048 Direct . . Direct Address 1 . Direct Address 2 Address 2048 Direct . Data Block 1 . Direct . Data Block 2 Direct Address 2048 Direct Address 1 Single Data Block 2048 Address 2 Double . Triple . . Address 2048
  • 9. Triple Data Block 1 Data Block 2 Direct Direct Address 1 Address 2 Data Block 2048 Direct Direct . . Direct Address 1 Address 1 . Direct Address 2 Address 2 Address 2048 Direct . . Data Block 1 . . Direct . . Data Block 2 Direct Address 2048 Address 2048 Direct Address 1 Direct Address 2 Data Block 2048 Direct . . Single Address 1 . Double Address 2 Address 2048 Triple . . Data Block 1 . Data Block 2 Address 2048 Address 1 Address 2 Data Block 2048 . Address 1 . . Address 2 Address 2048 . . . Address 2048
  • 11. Data Block 1 Data Block 2 . . Direct . Data Block 1 Direct Data Block 3 Data Block 2 Direct Direct Direct Data Block 2048 Direct Data Block 1 Direct Address 1 Data Block 2 Address 1 Direct Address 2 Data Block 2048 Address 2 Direct . . . Direct . . . Direct Address 2048 Data Block 1 Address 2048 Direct Data Block 2 Single Double Address 1 Triple Data Block 2048 Address 2 Address 1 . Data Block 1 Address 2 . . Data Block 2 . . Address 2048 . Address 2048 Address 1 Address 2 Data Block 2048 . . Address 1 Address 1 . Address 2 Address 2 Address 2048 . . Data Block 1 . . . . Data Block 2 Address 2048 Address 2048 Address 1 Address 2 Data Block 2048 . . Address 1 . Address 2 Address 2048 . . Data Block 1 . Data Block 2 Address 2048 Address 1 Address 2 Data Block 2048 . Address 1 . . Address 2 Address 2048 . . . Address 2048
  • 12. Maximum Size of Direct Blocks
  • 13. Maximum Size of Direct Blocks Where did the 2048 Addresses come from?
  • 14. Maximum Size of Direct Blocks Where did the 2048 Addresses come from? Assuming 32-bit architectures
  • 15. Maximum Size of Direct Blocks Where did the 2048 Addresses come from? Assuming 32-bit architectures 32-bit = 4 bytes (32 / 8)
  • 16. Maximum Size of Direct Blocks Where did the 2048 Addresses come from? Assuming 32-bit architectures 32-bit = 4 bytes (32 / 8) Thus 8192 [block size] /4 [bytes per addressable block]
  • 17. Maximum Size of Direct Blocks Where did the 2048 Addresses come from? Assuming 32-bit architectures 32-bit = 4 bytes (32 / 8) Thus 8192 [block size] /4 [bytes per addressable block] = 2048 Addressable Blocks
  • 18. Questions What is the maximum possible file size that can be represented via direct data blocks?
  • 19. Maximum Size of Direct Blocks block size blocks = 8192 x 12 = 98,304 bytes = 96Kb
  • 20. Maximum FileSize using First-Indirect Linking
  • 21. Maximum FileSize using First-Indirect Linking Direct: 12 blocks @ 8192 bytes (12 x 8192)
  • 22. Maximum FileSize using First-Indirect Linking Direct: 12 blocks @ 8192 bytes (12 x 8192) =96Kb
  • 23. Maximum FileSize using First-Indirect Linking Direct: 12 blocks @ 8192 bytes (12 x 8192) =96Kb Indirect: 2048 @ 8192 (2048 x 8192) = 16,384 Kb = 16,480 [Inclusive of Direct] = 16.09Mb
  • 24. Maximum using Double Indirect 16,875,520 x 2048 addressable blocks = 34,561,064,960 bytes = 32,960 Mbytes
  • 25. Maximum Filesize [direct + single + double + triple] 2048 x 32.1875Gb = 64.375 Tb
  • 27. Overhead Wish to store: 8,437,760 bytes
  • 28. Overhead Wish to store: 8,437,760 bytes 8437760 / 8192 [bytes per block] = 1030 blocks x 4 bytes [per address] BUT
  • 29. Overhead Wish to store: 8,437,760 bytes 8437760 / 8192 [bytes per block] = 1030 blocks x 4 bytes [per address] BUT 12 Blocks are stored directly
  • 30. Overhead Wish to store: 8,437,760 bytes 8437760 / 8192 [bytes per block] = 1030 blocks x 4 bytes [per address] BUT 12 Blocks are stored directly Hence we only have 1018 blocks
  • 31. Overhead Wish to store: 8,437,760 bytes 8437760 / 8192 [bytes per block] = 1030 blocks x 4 bytes [per address] BUT 12 Blocks are stored directly Hence we only have 1018 blocks 1018 x 4 bytes = 4072 bytes = 3.98Kbytes