Question

A UNIX-type file-system uses a disk block size of 1KB, 128 byte inodes, and 32 bit...

A UNIX-type file-system uses a disk block size of 1KB, 128 byte inodes, and 32 bit disk addresses. If the inode contains 64 bytes of data, 8 direct, 1 indirect, 1 double-indirect, and 1 triple- indirect blocks, apart from other file information. How many disk blocks would be required for storing files of sizes

(a) 1 byte

(b) 1024 bytes

(c) 64 KB

(d) 1MB ?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Disk block size is 1 KB = 1024 bytes

Inode size = 128 bytes

Disk addresses = 4 bytes

Inode contains 64 bytes of data, 8 direct, 1 indirect, 1 double-indirect, 1 triple-indirect blocks

Size of each disk block is 1 KB and size of each disk block address is 32 bits(4 bytes).

So, each indirect block can addresses: 2^10 bytes / 2^2 bytes = 2^8 blocks, which can store in total of 2^8 *1024 = 262144 bytes.

a) 1 bytes: Inode stores the data(64 bytes), 1 inode is sufficient to store 1 byte file

b)1024 bytes: 1 inode + 1 direct data block(as the size of block is 1024 bytes)

c) 64 KB( 65536 bytes): 1 inode + 8 direct data blocks( 8*1024 = 8192 bytes) + 1 indirect data block + 56 data blocks

After using 8 direct blocks, remaing 57344 bytes (65536-8192 = 57344 ) should be stored in 56 blocks(57344/1024) using 1 indirect data block

d) 1 MB : 1 inode + 8 direct data blocks + 1 indirect block + 256 data blocks + 4 double indirect pointer blocks of overhead + 760 data blocks

After using 8 direct blocks and 1 indirect data blocks, remaing 778240(760Kbytes) bytes (1048576 - 8192 - 262144), still 760 data blocks are required. So 1 double indirect data block should also be used to point 4 blocks which in turn each points to 256 data blocks

1 double indirect can address 2^8*2^8*2^10 = 2^26 bytes

Add a comment
Know the answer?
Add Answer to:
A UNIX-type file-system uses a disk block size of 1KB, 128 byte inodes, and 32 bit...
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
ADVERTISEMENT