A UNIX file system has 4096byte blocks this is typical and 4
A UNIX file system has 4096-byte blocks (this is typical) and 4-byte disk addresses. What is the maximum file size if i-nodes contain 100 direct entries, and one single, double, and triple indirect entry each?
Solution
A UNIX file system has 4096-byte blocks and 4-byte disk addresses.
For irregular files, the first 12 blok addresses in this array are the addresses of the first 12 blocks of the file. If the block size is 4096 bytes(4KB), then a file with at most 12 . 4= 48 KB can be accessed by one level of indirection.
If a file is larger than 48KB, then the 13th address is the address of a single indirect block, which is a 4096 byte block used to storeblock address . Since a block address is 4bytes, there are 4096/4 = 1024block addresses in this block. Since each of these 1024 blocks is 4096 bytes, using the first 12 addresses plus the 13th address allows for addressing files whose size is most 48KB+1024-4096 bytes or 48KB +4MB.
Eachinodecontains15blockpointers – First12aredirectblocks. Then single,double,triple indirectblocks
