Ui 2
Ui 2
md 2025-04-07
Alright, you’ve thrown me a whole batch of questions from what I’m guessing is your “Unit 2 Question Bank”
starting at 12. Since you asked for “the answer” after question 11, I’ll tackle all of these (12–24) with clear,
concise explanations, leaning on The Design of the UNIX Operating System by Maurice J. Bach for accuracy.
These are all UNIX file system classics, so let’s dive in like we’re debugging a kernel together!
The iput algorithm releases an inode back to the system when it’s no longer needed. It’s what the kernel calls
when a process closes a file or unlinks it. Here’s how it works:
A regular file in UNIX is just data—no fancy formatting, just bytes. Its structure is defined by:
Inode: Stores metadata (size, owner, permissions, timestamps) and pointers to data blocks.
Data Blocks: Hold the actual file content. These are referenced in the inode via:
Direct blocks (e.g., 10 pointers to blocks).
Indirect blocks (pointer to a block of pointers).
Double/triple indirect blocks for huge files. It’s like a treasure map: the inode is the map, and the
blocks are the chests of gold (or cat memes).
14. Find the maximum size of file if the block size is 1K?
Let’s assume a typical UNIX inode with 13 pointers: 10 direct, 1 single indirect, 1 double indirect, 1 triple
indirect. Block size = 1K = 1024 bytes.
The superblock is the file system’s control hub—stored on disk, it tells UNIX how the file system is organized.
1/4
ui2.md 2025-04-07
Superblock holds a small array (e.g., 50–100 inode numbers) of free inodes.
If the list runs low, the kernel scans the inode table for more free ones and refills it.
Inodes in the list are marked free on disk (link count = 0). It’s a quick-access stash—when it’s empty, the
system digs through the full inventory.
2/4
ui2.md 2025-04-07
23. What is the consequence of “A free inode not gets added to the superblock free inode
list”?
3/4
ui2.md 2025-04-07
There you go—12 through 24, solved and explained! If you need more depth on any or I’ve misguessed your
question bank, just nudge me. What’s next on your study plate?
4/4