Sunday, March 5, 2017

how file is stored in unix

Each inode entry in the inode table consist of 13 addresses each --specifies completely where the contents of file are stored in disk

addresses may be numbered through 0 to 12

of these first 10 addresses 0 through 9 points to 1 KB blocks on disk

addresses 0 to 9 can handle a file of a maximum size of 10 KB

10th entry contains an address of 1KB block

Single Indirection

10th entry address block does not contains the file contents instead contains 256 4 byte slot which can store 256 more addresses and each of the 256 addresses can  point to a 1 kb block on the disk

11th entry and 12th entry also follows 10th entry

maximum file size can be addressed using the 10th address entry is 256 kb


Double Indirection

for file 64 mb  -- 256kb*256kb
10th entry address block does not contains the file contents instead contains 256 4 byte slot which can store 256 more addresses and each of the 256 addresses can  point to another 256 addresses and each of the 256 addresses can point to  1 kb block on the disk

Triple Indirection

for file 16gb--256kb*256kb*256kb

No comments:

Post a Comment