Sistemas de archivos
Introducido| English | Significado |
|---|---|
| inode | inode |
| journaling | journaling |
Names, inodes, blocks
- The inode holds a file's metadata and 4 direct pointers plus one indirect block (256 pointers at 1 KiB each); the directory is itself a file of name-to-inode entries.
- Size bound: $(4 + 256) \times 1\,\mathrm{KiB} = 260$ KiB. With 4 KiB blocks: $(4 + 1024) \times 4\,\mathrm{KiB} = 4112$ KiB, about 4 MiB.

{exercise:uni-cs0705-layout}
With 1 KiB blocks, 4 direct pointers and one 256-pointer indirect block, the max file is —
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
(4 + 256) x 1 KiB = 260 KiB.
The price of block 6
- Reading block 6 of /notes/x: the directory lookup finds the inode (cached); block 6 is beyond the four direct pointers — read the indirect block (pointer 2), then the data block: two disk reads for one logical block.
- Sequentially reading a 100-block file costs $100 + 1$ reads (the indirect block once). Deletion clears pointers, not data — the bytes stay until reused.
{exercise:uni-cs0705-price}
Reading block 6 (beyond the direct pointers) costs — disk reads
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
The indirect block first (pointer 2), then the data block.
The crash question
- Append writes data, then the free-list bit, then the inode size. Crash between writes: data-then-inode loses only space (an orphan block); inode-then-data lies about size (reads return garbage).
- Journaling writes the intent first and replays it after the crash — the small write tax modern file systems pay for crash consistency.
{exercise:uni-cs0705-crash}
Journaling survives crashes by —
Dificultad 1/5 · 100 monedas + un pequeño bono en el primer intento de hoy
The journal records what is about to happen; replay finishes it after the crash.