Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do not understand where 2048 comes from

Where does the 2048 number comes from in is the problem?

Consider a file system that uses inodes to represent files. Disk blocks are 8 KB in size and a pointer to a disk block requires 4 bytes. This file system has 12 direct disk blocks, as well as single, double, and triple indirect disk blocks. What is the maximum size of a file that can be stored in this file system?

(12 * 8 KB) + (2048 * 8 KB) + (2048 * 2048 * 8 KB) + (2048 * 2048 * 2048 * 8 KB) = 64 terabytes 

I was thinking 8KB/4B, but isn't that 2000? 8000/4.

like image 504
Aaron Avatar asked Dec 02 '22 22:12

Aaron


1 Answers

Sometimes when discussing numbers in the context of computers, kB = 1024 bytes, MB = 1,048,576 bytes, etc.

In this case, 8kB = 8192 bytes. 8192 / 4 = 2048.

like image 80
Gabe Avatar answered Dec 15 '22 05:12

Gabe