Question

Assume an FFS-style file system with an 8 KB block size, 4 byte block numbers, and...

  1. Assume an FFS-style file system with an 8 KB block size, 4 byte block numbers, and an inode that contains pointers to the first 10 block numbers, one indirect block, and one double indirect block. Remember that 1 KB = 1024 B, 1 MB = 1024 KB, and 1 GB = 1024 MB.
    1. How large in KB can a file be without needing to use the indirect block?
    2. How many block numbers can be stored in a single indirect block?
    3. How many MB of data does an indirect block point to?
    4. How large in KB can a file be without needing to use the double indirect block?
    5. How many GB of data does a double indirect block point to?
    6. What is the maximum size of a file in KB?
  2. Given the assumptions in the previous problem, give the logical block number and offset within the block for the following file offsets:
    1. 0
    2. 8188
    3. 8192
    4. 10000
    5. 20000
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1

a) Without Indirect Block, File size

= Number of Direct Block * Block Size

= 10*8 KB

= 80 KB

b) Count of Block Numbers which can be stored in a indirect block

= Block Size / Block Number Size

= 8 KB / 4 B

= 2048

c) An indirect Block can contain 2048 block numbers, so total data which an indirect block is pointing to

= 2048*Block Size

= 2048*8 KB

= 16 MB

d) Without double Indirect Block, File size

= Number of Direct Block * Block Size + Number of Block entries in Indirect Block * Block Size

= 10*8 + 2048*8 KB

= 16464 KB

e) A double indirect Block can contain 2048 indirect block entries and each block in 2048 blocks can contain 2048 direct block entries., so total data which an double indirect block is pointing to

= 2048*2048*Block Size

= 2048*2048*8 KB

= 33,554,432‬ KB

= 32 GB

f) Maximum Size of file

= 80 KB + 16464 KB + 33,554,432‬ KB

= 33,570,976‬ KB

Answer 2

Block Size = 8 KB = 8192 Bytes means

0th block will have 0 - 8191 Bytes

1st block will have 8192 - 16383 Bytes and so on

a) 0 => Logical Block Number = 0 and offset = 0

b) 8188

=> Block number = 8188/8192 = 0

=> offset = 8188%8192 = 8188

c) 8192

=> Block number = 8192/8192 = 1

=> offset = 8192%8192 = 0

d) 10000

=> Block number = 10000/8192 = 1

=> offset = 10000%8192 = 1,808‬

e) 20000

=> Block number = 20000/8192 = 2

=> offset = 20000%8192 = 3,616‬

Add a comment
Know the answer?
Add Answer to:
Assume an FFS-style file system with an 8 KB block size, 4 byte block numbers, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT