Enlist different file allocation methods? Explain contiguous allocation method in detail.

1 Answer

Answer :

From the user’s point of view, a file is an abstract data type. It can be created, opened, written, read, closed and deleted without any real concern for its implementation. The implementation of a file is a problem for the operating system.

The main problem is how to allocate space to these files so that disk space is effectively utilized and files can be quickly accessed. Three major methods of allocating disk space are in wide use:

Contiguous

Linked

Indexed

Contiguous Allocation

• The contiguous allocation method requires each file to occupy a set of contiguous addresses on the disk. Disk addresses define a linear ordering on the disk. Contiguous allocation of a file is defined by the disk address of the first block and its length. If the file is ‘n’ blocks long and starts at location ‘b’, then it occupies blocks b, b+1, b+2, - - - - - b+n-1. The directory entry for each file indicates the address of the starting block and the length of the area allocated for this file.

• Contiguous allocation supports both sequential and direct access.

• For direct access to block ‘i’ of a file, which starts at block ‘b’, we can immediately access block b+i. The difficulty with contiguous allocation is finding space for a new file.

• For direct access to block ‘i’ of a file, which starts at block ‘b’, we can immediately access block b+i.

• The difficulty with contiguous allocation is finding space for a new file.

• If file to be created are ‘n’ blocks long, we must search free space list for ‘n’ free contiguous blocks.

image

Advantages of Contiguous File Allocation Method:

1. Supports both sequential and direct access methods.

2. Contiguous allocation is the best form of allocation for sequential files. Multiple blocks can be brought in at a time to improve I/O performance for sequential processing.

3. It is also easy to retrieve a single block from a file. For example, if a file starts at block ‘n’ and the ith block of the file is wanted, its location on secondary storage is simply n + i.

4. Reading all blocks belonging to each file is very fast.

5. Provides good performance.


Disadvantages of Contiguous File Allocation Method:

1. Suffers from external fragmentation.

2. Very difficult to find contiguous blocks of space for new files.

3. Also with pre-allocation, it is necessary to declare the size of the file at the time of creation which many a times is difficult to estimate.

4. Compaction may be required and it can be very expensive.

Related questions

Description : Enlist the operating system tools. Explain any two in detail.

Last Answer : Following are the operating tools: User Management Security policy Device Management Performance Monitor Task Scheduler A) User management: User management includes everything ... routing tables, interface statistics, masquerade connections, and multicast memberships. # netstat -tulpn

Description : Enlist types of operating system. Explain multiprogramming OS in detail.

Last Answer : Types of operating system 1.Batch Systems 2.Multiprogramming 3.Multitasking 4.Time-Sharing Systems 5.Desktop Systems 6.Distributed system 7.Clustered system 8.Real Time system: Multiprogramming ... multiprogramming: user can open word, excel, access and other applications in a system.

Description : Explain multithreading model in detail.

Last Answer : Many systems provide support for both user and kernel threads, resulting in different multithreading models. Following are three multithreading model: Many-to-One Model The many-to- ... True concurrency cannot be achieved. Multiple threads of kernel is an overhead for operating system

Description : List components of OS. Explain process management in detail.

Last Answer : List of System Components: 1. Process management 2. Main memory management 3. File management 4. I/O system management 5. Secondary storage management Process Management: The operating ... synchronization. 4. A mechanism for process communication. 5. A mechanism for deadlock handling.

Description : List free space management techniques? Describe any one in detail.

Last Answer : A file system is responsible to allocate the free blocks to the file therefore it has to keep track of all the free blocks present in the disk. There are mainly four approaches by using which, the free ... block. This block contains a pointer to the next free disk block, and so on.

Description : In ............ allocation method for disk block allocation in a file system, insertion and deletion of blocks in a file is easy. (A) Index (B) Linked (C) Contiguous (D) Bit Map

Last Answer : (B) Linked

Description : Write Unix command for following: i)create a folder OSY ii) create a file FIRST in OSY folder iii) List/display all files and directories. iv) Write command to clear the screen

Last Answer : i) create a folder OSY: $mkdir OSY ii)create a file FIRST in OSY folder: $cd OSY $cat>FIRST or $ touch FIRST iii) List/display all files and directories: $ls iv) to clear screen: $clear

Description : Describe any four file attributes

Last Answer : File attributes: Name: The symbolic file name is the only information kept in human readable form. Identifier: File system gives a unique tag or number that identifies file within file ... Last modification and last use. These data can be useful for protection, security and usage monitoring.

Description : Describe sequential and direct access method.

Last Answer : Sequential access: Information from the file is processed in order i.e. one record after another. It is commonly used access mode. For example, editors and compilers access files in sequence. A read ... prevent the user from accessing portions of the file system that may not be part of his file.

Description : Explain LRU page replacement algorithm for following reference string. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Calculate the page fault.

Last Answer : LRU: The Least Recently Used (LRU) page replacement policy replaces the page that has not been used for the longest period of time. LRU replacement associates with each page the time of that page's last use. ... in question so assume frame size as 3 or 4) LRU: Assume frame size=3

Description : Explain PCB with diagram.

Last Answer : Each process is represented as a process control block (PCB) in the operating system. It contains information associated with specific process. Process State: It indicates current state of a process. ... . Each PCB gives information about a particular process for which it is designed.

Description : Explain Round Robin algorithm with suitable example.

Last Answer : It is preemptive scheduling algorithm. A small unit of time known as a time quantum or time slice is used for pre-emption of a currently running process. Ready queue is implemented as a circular ... has received 1 time quantum, the CPU returns to process P1 for an additional time quantum. 

Description : Explain partitioning and its types.

Last Answer : An important operation of memory management is to bring programs into main memory for execution by the processor. Partitioning is a technique that divides a memory into multiple partitions. These partitions ... in memory. For example: Consider following table with process and memory space.

Description : Explain deadlock? What are necessary conditions for deadlock?

Last Answer : In multiprogramming environment, several processes may compete for a finite number of resources. A process requests resources and if the resources are not available then the process enters into the ... Each process is waiting for the resources held by other waiting processes in circular form.

Description : With neat diagram explain inter process communication model.

Last Answer : Inter-process communication: Cooperating processes require an Interprocess communication (IPC) mechanism that will allow them to exchange data and information. There are two models of IPC 1. ... a communication link between them. Between each pair of processes exactly one communication link.

Description : Explain any four scheduling criteria.

Last Answer : 1. CPU utilization: In multiprogramming the main objective is to keep CPU as busy as possible. CPU utilization can range from 0 to 100 percent. 2.Throughput: It is the number of processes ... fairly early and can continue computing new results while previous results are being output to the user.

Description : Explain any 4 services provided by OS.

Last Answer : 1.User Interface: All operating systems have a user interface that allows users to communicate with the system. Three types of user interfaces are available: a. Command line interface ( ... to system resources. Security is provided by user authentication such as password for accessing information.

Description : List any four features of open source operating system.

Last Answer : 1. Open Source: open source OS code is freely available and it is community based development project. Multiple team's works in collaboration to enhance the capability of operating system and it is ... issuing a command in Linux Terminal or Shell. Linux can also run Windows applications if needed.

Description : State and describe types of scheduler.

Last Answer : There are three types of scheduler: Long term scheduler Short term scheduler Medium term scheduler 1. Long term scheduler: It selects programs from job pool and loads them into the ... scheduler works in close communication with long term scheduler for loading process into the main memory. 

Description : What is purpose of system call? State two system calls with their functions.

Last Answer : System call provides an interface between a running program and operating system. It allows user to access services provided by operating system. This system calls are procedures written using C, ... send, receive messages transfer status information attach or detach remote devices. 

Description : Describe I/O Burst and CPU Burst cycle with neat diagram.

Last Answer : CPU burst cycle: It is a time period when process is busy with CPU.  I/O burst cycle: It is a time period when process is busy in working with I/O resources. A process execution consists ... cycle and so on. The final CPU burst cycle ends with a system request to terminate execution.

Description : Write syntax for following commands: i)Sleep ii)Kill

Last Answer : i)sleep Syntax: sleep NUMBER[SUFFIX]… sleep OPTION ii) kill Syntax: kill pid

Description : Define virtual memory

Last Answer : Virtual memory is a memory management capability of an operating system (OS) that uses hardware and software to allow a computer to compensate for physical memory shortages by temporarily transferring data ... can be placed in overlays, but can concentrate instead on the problem to be programmed. 

Description : Draw process state diagram.

Last Answer : process state diagram

Description : Define real time operating system. List its any four applications of it.

Last Answer : Real time Operating System: A real time system has well defined fixed time constraints. Processing should be done within the defined constraints -Hard and Soft real time system. OR The ... Applications: 1. Flight Control System 2. Simulations 3. Industrial control 4. Military applications

Description : Compare the memory organization schemes of contiguous memory allocation, pure segmentation, and pure paging with respect to the following issues External fragmentation?

Last Answer : 1. Compare the memory organization schemes of contiguous memory allocation, pure segmentation, and pure paging with respect to the following issues: a. External fragmentationb. Internal fragmentation

Description : Explain the thermal triggering method of SCR. Enlist different triggering methods of SCR.

Last Answer : Types of Triggering: 1) Forward voltage triggering 2) Thermal triggering (Temperature triggering) 3) Radiation triggering (Light triggering) 4) dv/dt triggering 5) Gate triggering ... generated leakage current increases. This current gets multiplied internally and thyristor is turned on. 

Description : A zone is a contiguous portion of a ………….. of the DNS namespace whose database records exist and are managed in a……….. DNS database file. A. domain, particular B. Class, particular C. tree, local D. Domain, every

Last Answer : A. domain, particular

Description : Which of the following statements is not true about disk-arm scheduling algorithms ? (A) SSTF (shortest seek time first) algorithm increases performance of FCFS. (B) The number of requests for disk ... arm movements. (D) SCAN and C-SCAN algorithms are less likely to have a starvation problem.

Last Answer : (B) The number of requests for disk service are not influenced by file allocation method.

Description : Enlist types of weir and explain any one in detail.

Last Answer : Types of weirs are a) Based on materials of construction 1) Masonry weir 2) Rock-fill weir 3) Concrete weir b) Based on use and function 1) Storage weir 2) Pick- ... Canal has to run idle c) The terrain is geographically difficult so that canal alignment is very costly or impossible

Description : Differentiate between sterilization and Disinfection. Enlist the different methods of sterilization.

Last Answer : Sterilization Disinfection It is the process of complete destruction of microorganisms present in the system It is process that removes infection potential by microorganisms In case of ... Seitz filters 3. Sintered glass filters 4. Sintered metal filters 5. Membrane filters

Description : Classify the methods of curing of concrete with detail explanation of any one method.

Last Answer : Methods of curing: A. Water curing B. Membrane curing C. Application of heat D. Miscellaneous methods 1. Water curing: i) This is the best method of curing, because it satisfies all ... the surface prevents the mixed water from evaporation and thereby keeps the concrete wet for a long time. 

Description : Enlist the methods of quarrying and explain any one in brief.

Last Answer : The process of taking out stones from natural rock beds is known as quarrying of Stones. Methods of Quarrying of Stones: -  1.Digging  2.Heating  3.Wedging  4.Blasting  1. Digging ... Large blocks of stones are obtained by using blasting powder but small blocks are obtained by using dynamite.

Description : The ability to find an individual item in a file immediately _____ is used. 1) File allocation table 2) Directory 3) Sequential access 4) Direct access 4 5) None of these

Last Answer : Answer :1

Description : The ability to find an individual item in a file immediately _____ is used: a) file allocation table b) directory c) sequential access d) direct access e) None of The Above

Last Answer : a) file allocation table

Description : FAT stands for 1) File Accomdation Table 2) File Access Tape 3) File Allocation Table 4) File Activity Table

Last Answer : 3) File Allocation Table

Description : FAT stands for 1 File Accomdation Table 2 File Access Tape 3 File Allocation Table 4 File Activity Table

Last Answer : 3 File Allocation Table

Description : Which of the following information not included in memory table? A) The allocation of main memory to process. B) The allocation of secondary memory to process C) Any information needed to manage virtual memory D) Any information about the existence of file

Last Answer : D) Any information about the existence of file

Description : ................. maintains the list of free disk blocks in the Unix file system. (A) I-node (B) Boot block (C) Super block (D) File allocation table

Last Answer : (C) Super block 

Description : Enlist four methods for size reduction. 

Last Answer : Methods for size reduction: i) Cutting ii) Compression iii) Impact iv) Attrition iv) Combined impact and attrition.

Description : Enlist various methods of levelling.

Last Answer : Methods of leveling: i. Simple levelling ii. Differential levelling iii. Longitudinal levelling iv. Cross section levelling v. Fly levelling vi. Check levelling vii. Reciprocal levelling viii. Profile levelling

Description : Enlist the methods of plane tabling. 

Last Answer : Method of Surveying with the plane table are : 1) Radiation 2) Intersection 3) Traversing 4) Resection

Description : Enlist any two methods of transportation of concrete.

Last Answer : Methods of transportation of concrete: There are three methods of transportation of concrete listed below.  1. Manual method- Transportation through the hands of labour in the ghamela, wheel ... and hoist arrangement.  3. Mechanical Method- Transportation using truck, dumper, RMC vehicle.

Description : Enlist any two the methods of soil stabilization.

Last Answer : Methods of soil stabilization: 1. Mechanical Stabilization 2. Lime Stabilization 3. Cement Stabilization 4.Bitumen Stabilization 5.Fly ash Stabilization 6.Stabilization by chemicals 7.Stabilization by heating 8. ... seven days. vi. Then the stabilized portion is allowed for its further use.  

Description : Are there ever days where there is precepitation in all 48 contiguous states on the same day?

Last Answer : I wonder if there’s proof of rain/snow covering the whole earth for a prolonged period.

Description : What is the most southernmost contiguous us state?

Last Answer : What is the answer ?

Description : What 3 countries have larger land areas than the contiguous US?

Last Answer : First of all, this is a basic question and you should know thatAbraham Lincoln's pie experiment really stands out in thisparticular question. Secondly, Sir, Isaac Newtons eternal doughnutexperiment ... appearance on Quantum Mechanics. Ihope this clears up your understanding on how trump is Ginger

Description : Which of the following are true regarding Chhota Nagpur? [CDS 1994] 1. It is one of the former princely states. 2. It is a plateau area in Jharkhand inhabited mainly by the tribals. 3. It is a name given to the contiguous tribal areas in ... M.P. (a) 1 and 3 (b) 2 and 3 (c) 1 and 2 (d) 1, 2 and 3

Last Answer : Ans: (c)

Description : Neoplasms are best characterized as: C A. Malignant tumors B. A proliferation of cells that is characterized by its ability to invade contiguous structures C. A cellular proliferation in which growth is for the most part autonomous D. None of these

Last Answer : A cellular proliferation in which growth is for the most part autonomous

Description : What is not true for genetic code? (a) It is nearly universal. (b) It is degenerate. (c) It is unambiguous. (d) A codon in mRNA is read in a non-contiguous fashion.

Last Answer : (c) It is unambiguous.