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
Posted: Sun May 15, 2022 12:32 pm
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?
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?