How inodes Work

8,739 views
8,435 views

Published on

One of the tutorials I gave at University of Wollongong on inodes.

Describes direct, single, double and triple linking, and how that all ties together with addressable space.

Published in: Education, Business, Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,739
On SlideShare
0
From Embeds
0
Number of Embeds
81
Actions
Shares
0
Downloads
205
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

How inodes Work

  1. 1. inodes explained Tutorial 3 - CSCI212 by: Roman Tarnavski
  2. 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. 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. 4. Source: CSCI212 Lecture Notes by: Daniel Saffioti
  5. 5. Your typical inode Mode Permissions Size Timestamps Direct Blocks Single Double Triple
  6. 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. 7. Single Direct Data Block 1 Direct Data Block 2 Direct Direct Direct Data Block 2048 Direct Address 1 Direct Address 2 Direct . Direct . . Direct Address 2048 Direct Direct Single Double Triple
  8. 8. Double Data Block 1 Direct Data Block 2 Direct Direct Direct Address 1 Data Block 2048 Direct Address 2 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. 9. Triple Data Block 1 Data Block 2 Direct Address 1 Direct Data Block 2048 Address 2 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 Direct Address 1 Data Block 2048 Direct Address 2 . Direct . . Single Address 1 Double Address 2048 Address 2 Triple . . Data Block 1 . Data Block 2 Address 2048 Address 1 Data Block 2048 Address 2 . . Address 1 . Address 2 Address 2048 . . . Address 2048
  10. 10. All Together?
  11. 11. Data Block 1 Data Block 2 . . . Direct Data Block 1 Direct Data Block 3 Data Block 2 Direct Direct Direct Data Block 2048 Data Block 1 Direct Address 1 Data Block 2 Direct Address 1 Address 2 Direct Data Block 2048 Address 2 . Direct . . . Direct . . Address 2048 Data Block 1 Direct Address 2048 Data Block 2 Direct Single Double Address 1 Data Block 2048 Triple Address 2 Address 1 . Data Block 1 . Address 2 . Data Block 2 . . Address 2048 . Address 1 Address 2048 Data Block 2048 Address 2 . . . Address 1 Address 1 Address 2 Address 2 Address 2048 . . Data Block 1 . . . . Data Block 2 Address 2048 Address 2048 Address 1 Data Block 2048 Address 2 . . . Address 1 Address 2048 Address 2 . . Data Block 1 . Data Block 2 Address 2048 Address 1 Data Block 2048 Address 2 . . Address 1 . Address 2 Address 2048 . . . Address 2048
  12. 12. Maximum Size of Direct Blocks
  13. 13. Maximum Size of Direct Blocks Where did the 2048 Addresses come from?
  14. 14. Maximum Size of Direct Blocks Where did the 2048 Addresses come from? Assuming 32-bit architectures
  15. 15. Maximum Size of Direct Blocks Where did the 2048 Addresses come from? Assuming 32-bit architectures 32-bit = 4 bytes (32 / 8)
  16. 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 /4 [block size] [bytes per addressable block]
  17. 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 /4 [block size] [bytes per addressable block] = 2048 Addressable Blocks
  18. 18. Questions What is the maximum possible file size that can be represented via direct data blocks?
  19. 19. Maximum Size of Direct Blocks block size blocks = 8192 x 12 = 98,304 bytes = 96Kb
  20. 20. Maximum FileSize using First-Indirect Linking
  21. 21. Maximum FileSize using First-Indirect Linking Direct: 12 blocks @ 8192 bytes (12 x 8192)
  22. 22. Maximum FileSize using First-Indirect Linking Direct: 12 blocks @ 8192 bytes (12 x 8192) =96Kb
  23. 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. 24. Maximum using Double Indirect 16,875,520 x 2048 addressable blocks = 34,561,064,960 bytes = 32,960 Mbytes
  25. 25. Maximum Filesize [direct + single + double + triple] 2048 x 32.1875Gb = 64.375 Tb
  26. 26. Overhead
  27. 27. Overhead Wish to store: 8,437,760 bytes
  28. 28. Overhead Wish to store: 8,437,760 bytes 8437760 / 8192 [bytes per block] = 1030 blocks x 4 bytes [per address] BUT
  29. 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. 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. 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

×