• edited by
16,205 views
45 45 votes

In a particular Unix OS, each data block is of size $1024$ bytes, each node has $10$ direct data block addresses and three additional addresses: one for single indirect block, one for double indirect block and one for triple indirect block. Also, each block can contain addresses for $128$ blocks. Which one of the following is approximately the maximum size of a file in the file system?

  1. $512$ MB
  2. $2$ GB
  3. $8$ GB
  4. $16$ GB

7 Answers

Best answer
51 51 votes

Answer: (B)

Maximum file size $= 10 \times 1024$ Bytes $+ 1 \times 128 \times 1024$ Bytes $+ 1\times 128\times 128 \times 1024$ Bytes $+ 1 \times 128 \times 128 \times 128 \times 1024$ Bytes $=$ approx $2 \ GB$.

• edited by
17 17 votes

Size of File/Levels      

Direct Address         

Indirect Address-1                

Indirect Address-2                

Indirect Address-3                     

Level-0 10*1024 B           1             1               1
Level -1   1*128*1024 B 1*128*1024 B 1*128*1024 B
Level- 2     1*128*128*1024 B     1*128*128*1024 B    
Level -3       1*128*128*128*1024 B

Add the Principle Diagonal Values = 2.01575 GB = Approx. 2.0 GB

8 8 votes

maximum file size=(10+x+x2+x3)*Blocksize

x=no of block addresses in a block=27

maximum file size=(10+x+x2+x3)*210 B = (10+27+214+221)*210  = 231B = 2GB

 

5 5 votes

Maximum size of the File System = Summation of size of all the data blocks whose addresses belongs to the node.

Given:
Size of 1 data block = 1024 Bytes
No. of addresses which 1 data block can contain = 128 (just like 128 page table entry stored in a block)

Now, Maximum File Size can be calculated as:
10 direct addresses will point to 10 data blocks in the memory = 10*1024
1 single indirect entry will point to 1 block which again  points to 128 data block in the memory (just like multi level paging) = 128*1024
1 doubly indirect entry will point to 128*128 data block = 128*128*1024
1 triple indirect entry will point to 128*128*128 data block = 128*128*128*1024

Hence,
Max File Size = 10*1024 + 128*1024 + 128*128*1024 + 
                128*128*128*1024 Bytes
              = 2113674*1024 Bytes
              = 2.0157 GB ~ 2GB

1 1 vote

Its 2GB

1 1 vote
Block Size = 2^10B

No. of block pointer in one block = 2^7

Total no. of block pointers = 10+2^7+2^7*2^7+2^7*2^7*2^7

                            = 10+2^7+2^14+2^21

Max file Size = (10+2^7+2^14+2^21)*1KB

              = 2113674KB

              = 2.01575660706 MB (option B)
Answer:
Position:
Show:

Related questions

38 38 votes
1 answers 1 answer
17.1k
17.1k views
Ishrat Jahan asked Nov 2, 2014
17,086 views
In a virtual memory system, size of the virtual address is $32$-bit, size of the physical address is $30$-bit, page size is $4$ Kbyte and size of each page table entry is...
35 35 votes
7 answers 7 answers
12.1k
12.1k views
Ishrat Jahan asked Nov 2, 2014
12,097 views
The semaphore variables full, empty and mutex are initialized to $0$, $n$ and $1$, respectively. Process P1 repeatedly adds one item at a time to a buffer of size $n$, an...
79 79 votes
10 answers 10 answers
26.9k
26.9k views
Ishrat Jahan asked Nov 2, 2014
26,940 views
In a certain operating system, deadlock prevention is attempted using the following scheme. Each process is assigned a unique timestamp, and is restarted with the same ti...
40 40 votes
4 answers 4 answers
17.1k
17.1k views
Ishrat Jahan asked Nov 2, 2014
17,053 views
A disk has $200$ tracks (numbered $0$ through $199$). At a given time, it was servicing the request of reading data from track $120$, and at the previous request, service...