Basic concepts in the implementation of the file system

I do not understand about the implementation of the file system. In particular (operating systems - Tannenbaum (edition 3), p. 275) it says: "The first word of each block is used as a pointer to the next. The rest of the block is data."

Can someone explain to me the hierarchy of the division here? For example, each disk partition contains blocks, blocks contain words? etc...

+3
source share
3 answers

I do not know the context of this sentence, but it seems to describe a linked list of blocks. Generally speaking, a “block” is a small number of bytes (usually this value is two). It can be 4096 bytes, it can be 512 bytes, it depends. Hard drives are designed to extract data on a block at a time; if you want to get the 1234567th byte, you have to get the whole block. The word is much smaller and refers to a single number. It can be either 2 bytes (16 bits) or 8 bytes (64 bits); again, it depends on the file system.

, , . B-tree ( , , ). B- node . B-, B + -tree, , . B + -, , .

, , , 2-8 , , 512-4096 . , , , .. . , ( , / ), .

+3

, , , . ( , ). , , , , . , . ( 4k, , 512B) :

+------------------+------------- . . . . --------------+
| next blk pointer | another 4k - 4 or 8 bytes of stuff |
+------------------+------------- . . . . --------------+

, . , .

:

  • A - , 512B. , , , . ATA SCSI.
  • . , . ( , .)
  • , .

. . . (, , - , unix, .)

  • - . , . ( , , , .)

  • inode, "eye- node". Inodes , , . , inodes . Inodes , . - . , , .

  • - . (.. ), - . .

, , , , , . , , , , , .

+4

→ > Nibbles

.

, .

A block is a group of sectors (1, 2, 4, 8, 16, etc.). The larger the disk, the more sectors the block will occupy.

A word is the number of bits that the processor can process immediately (16-bit, 32-bit, 64-bit, etc.), and in your example it stores the address (or, possibly, the offset) of the next block.

A byte contains nibbles and a bit . 1 byte = 2 pieces; 1 Nibble = 4 bits.

+1
source

Source: https://habr.com/ru/post/1743678/


All Articles