recategorized by
3,901 views

2 Answers

Best answer
4 votes
4 votes

ans should be B  linked 

Just like linked list where insertion , deletion of blocks is easy . In linked allocation only pointer needs to be changed 

In linked allocation, each file is a linked list of disk blocks. The directory contains a pointer to the first and (optionally the last) block of the file. For example, a file of 5 blocks which starts at block 4, might continue at block 7, then block 16, block 10, and finally block 27. Each block contains a pointer to the next block and the last block contains a NIL pointer. The value -1 may be used for NIL to differentiate it from block 0.

With linked allocation, each directory entry has a pointer to the first disk block of the file. This pointer is initialized to nil (the end-of-list pointer value) to signify an empty file. A write to a file removes the first free block and writes to that block. This new block is then linked to the end of the file. To read a file, the pointers are just followed from block to block.

There is no external fragmentation with linked allocation. Any free block can be used to satisfy a request. Notice also that there is no need to declare the size of a file when that file is created. A file can continue to grow as long as there are free blocks.

Linked allocation, does have disadvantages, however. The major problem is that it is inefficient to support direct-access; it is effective only for sequential-access files. To find the ith block of a file, it must start at the beginning of that file and follow the pointers until the ith block is reached. Note that each access to a pointer requires a disk read. 
Another severe problem is reliability. A bug in OS or disk hardware failure might result in pointers being lost and damaged. The effect of which could be picking up a wrong pointer and linking it to a free block or into another file.

selected by
0 votes
0 votes

in Linked allocation

they didn’t say anything particular about pointer so by default we have to assume that it only has pointer of starting block of file. so to add or delete we have to go through all the blocks in file in linked allocation.

and also if you also assume the possibility of last node pointer then there will be many I/O operation

like first writing the new block second reading last block file and then writing node pointer in node. total I/O operation will be 3 

but In index allocation

there will be only 1 write operation in creating new block and index will be updated in main memory.

here is very good reference i found http://www2.cs.uregina.ca/~hamilton/courses/330/notes/allocate/allocate.html

Answer:

Related questions

6 votes
6 votes
1 answer
1
go_editor asked Jul 31, 2016
1,414 views
In the indexed scheme of blocks to a file, the maximum possible size of the file depends on:The number of blocks used for index and the size of indexSize of Blocks and si...
3 votes
3 votes
1 answer
2
go_editor asked Aug 2, 2016
2,589 views
Match the following for UNIX system calls :$\begin{array}{clcl} &\textbf{List-I} && \textbf{List-II} \\ \text{(a)} & \text{exec} & \text{(i)} & \text{Creates new process...
2 votes
2 votes
1 answer
3
go_editor asked Aug 1, 2016
2,799 views
A unix file may be of the typeRegular fileDirectory fileDevice fileAny one of the above
2 votes
2 votes
2 answers
4
go_editor asked Aug 1, 2016
3,573 views
Dining Philosopher's problem is aProducer - consumer problemClassical IPC problemStarvation problemSynchronization primitive