Maximum file size given a particular inode structure?

前端 未结 3 630
星月不相逢
星月不相逢 2021-01-08 00:11

Suppose a UNIX file system has some constraints--say, 2 KB blocks and 8B disk addresses. What is the maximum file size if inodes contain 13 direct entries, and one single, d

3条回答
  •  执念已碎
    2021-01-08 00:57

    How many pointers in 1 block?

         each block is 2kb = 2^11
         1 disk address is 8b = 2^3
         So, in 1 block there are 2^11/2^3 = 2^8 pointers"
        

    How many pointers in the file system?

         for 13 direct entries = (2^8)*13 = 3328
         for single  = (2^8)^2 = 2^16
         for double = (2^8)^3 = 2^24
         for triple = (2^8)^4 = 2^32
         total pointer is :3328 + 2^16 + 2^24 + 2^32"
         

    Therefore the size of the file system is:

    size of the disk is  : total of pointer*size of the pointer , which is around 34 GB "
        

提交回复
热议问题