Understanding Inodes

I mean the link about Inodes concepts

I got confused in parts:

  • 12 direct block pointers
  • 1 block single pointer
  • 1 double indirect block pointer
  • 1 triple indirect block indicator

Now the chart says that each pointer has 32/64 bits.

  • [Request]: Why and how are these values ​​displayed? I mean, why only 32 or 64 bit pointers specifically have?

The diagram says: One data block {8 KB} for each pointer {4 bytes / 8 bytes}

  • [Query]: How does it work? those. 8 * 1024 bytes / 8 bytes = 1024 bytes? What is the logic for having an 8-byte pointer for an 8K block?
+5
source share
3

, , - - , . 512 ( 4096 8192 ), 32- , 512 * 4 * 1024 3= 2 TiB (Tebibytes - ), 1/2 KiB; ( 32 TiB 8 KiB). , 48- 64- .

, Q1, 32- - . , 32 , 64 .

Q2:

  • 8 KiB, 96 , 12 , .

  • , . , , , , . , () , , , .

  • 8 KiB 4- 2048 . , 96 KiB + 1 16 MiB .

  • , . . , 2048 , 16 , 32 ().

  • , . 2048 . , 32- 32- 64 TiB. , ( 32 TiB - 32- 8 KiB).

, inode , 32- .

, , 64- .

+10

* Assume that there are 10 direct pointers to data blocks, 1 indirect pointer, 1 double indirect pointer, and 1 triple indirect pointer
* Assume that the size of the data blocks is 1024 bytes = 1Kb, i.e., BlockSize = 1Kb
* Assume that the block numbers are represented as 4 byte unsigned integers, i.e., BlockNumberSize = 4b
* Some data blocks are used as index blocks. They store 1024 bytes / 4 bytes/entry = 256 entries
* Maximum number of bytes addressed by 10 direct pointers is

    = Number of direct pointers * Blocksize 
    = 10 * 1Kb
    = 10Kb


* Maximum number of bytes addressed by single indirect pointer is

    = NumberOfEntries * BlockSize
    = (Blocksize / BlockNumberSize) * BlockSize
    = (1Kb / 4b) * 1Kb
    = 256 * 1Kb
    = 256Kb


* Maximum number of bytes addressed by double indirect pointer is

    = NumberOfEntries^2 * BlockSize
    = (Blocksize / BlockNumberSize)^2 * BlockSize
    = (1Kb / 4b)^2 * 1Kb
    = (2^10 / 2^2)^2 * (2^10b)
    = (2^8)^2 * (2^10)b
    = (2^16) * (2^10)b
    = 2^6 * 2^20 b
    = 64 Mb


* Maximum number of bytes addressed by triple indirect pointer is

    = NumberOfEntries^3 * BlockSize
    = (Blocksize / BlockNumberSize)^3 * BlockSize
    = (1Kb / 4b)^3 * 1Kb
    = (2^10 / 2^2)^3 * (2^10b)
    = (2^8)^3 * (2^10)b
    = (2^24) * (2^10)b
    = 2^4 * 2^30 b
    = 16 Gb


* Maximum file size is 16Gb + 64Mb + 266Kb 
+12

, , :

, , inode, . , Unix- , ( , Microsoft Windows). , , .

, 32 64 . 2 ^ 32, , . . .

-, ( ) (8 , ), , Unix . , , , .

, Unix.

alt text

+3

All Articles