Suppose a file is on a filesystem using a 1K block size. This file is maintained on the disk using i-nodes as is typical

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Suppose a file is on a filesystem using a 1K block size. This file is maintained on the disk using i-nodes as is typical

Post by answerhappygod »

Suppose a file is on a filesystem using a 1K block size. This
file is maintained on the disk using i-nodes as is typical on many
UNIX filesystems. Suppose there are seven direct (32-bit) pointers,
and then a pointer to one singly direct block, a pointer to a
doubly indirect block, and a pointer to a triply indirect block.
Suppose a program creates and opens a file in this filesystem, and
then seeks to the following positions, writes a character, and then
exits. Identify how many disk blocks, (both data and indirect
blocks) must be allocated to store the data for the file. (Note
that a-c each represent a different file.) (Note: we are going to
consider the filesystem implementation to support ‘sparse’ files –
blocks that are never written to in the file will not be allocated
but will be represented by a NULL pointer in the direct and
indirect blocks. Answer the following considering sparse file
allocation.)
a. Seek to 8900
b. Seek to 350000
c. Seek to 63,000,000
How big would a file need to be to require the triply indirect
pointer?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply