



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




What is Hard Disk? Hard Disk is a secondary storage device. It is a type of electro mechanical device. A hard disk stores and retrieves digital data using magnetic storage. Disk is rigid rapidly rotating platters coated with magnetic material. Hard Disk Pack consist of more than one disk. How Data is Stored in a Hard Disk? ● Data is stored in Disk in form of tracks and sectors. ● Disk surface is divided in to tracks. ● Track is further dived in to sectors. ● Sector is the addressable unit in disk. Basic picture for disk storage concept is given below Disk Structure in OS Disk structure is as shown in following figure
Step wise description of Disk Structure is given below ● Disk surfacе dividеd into tracks ● A rеad/writе hеad positionеd just abovе thе disk surfacе ● Information storеd by magnеtic rеcording on thе track undеr rеad/writе hеad ● Fixеd hеad disk ● Moving hеad disk ● Dеsignеd for largе amount of storagе ● Primary dеsign considеration cost, sizе, and spееd Hardwarе for disk systеm ● Disk drivе, Dеvicе motor, Rеad/writе hеad, Associatеd logic Disk controllеr ● Dеtеrminеs thе logical intеraction with thе computеr
data. Some commonly used disk scheduling algorithms include First-Come-First-Serve, Shortest Seek Time First, and SCAN. Disk management, on the other hand, involves tasks such as disk partitioning, formatting, and file system creation. It ensures that the disk is properly utilized, optimized for performance, and maintained to prevent data loss or corruption. Efficient disk scheduling and management are crucial for ensuring the smooth and effective operation of a computer system. Types of Disk Scheduling Algorithms ● First-Come, First-Served (FCFS) − The FCFS algorithm is the simplest disk scheduling algorithm, in which the requests are processed in the order they arrive. It is a nonpreemptive algorithm that does not take into account the distance between the current request and the next request. ● Shortest Seek Time First (SSTF) − The SSTF algorithm processes the request with the shortest seek time, i.e., the request that requires the least amount of movement by the disk's head. This algorithm can minimize the head movement, but it may result in starvation of some requests. ● SCAN − The SCAN algorithm processes the requests in a specific direction, either from the innermost track to the outermost track or vice versa. After reaching the end of the disk, the head reverses direction and processes the requests in the opposite direction. This algorithm provides a balance between the number of requests processed and the time each request waits. ● C-SCAN − The C-SCAN algorithm is similar to the SCAN algorithm, but the head moves only in one direction and processes requests only in that direction. When it reaches the end of the disk, it immediately returns to the beginning of the disk and starts processing requests again. This algorithm can eliminate the possibility of starvation. ● LOOK − The LOOK algorithm is similar to the SCAN algorithm, but the head reverses direction when it reaches the last request in the current direction. This algorithm can reduce the waiting time for requests that are close to the head's current position. ● C-LOOK − The C-LOOK algorithm is similar to the C-SCAN algorithm, but the head reverses direction when it reaches the last request in the current direction. This algorithm can reduce the waiting time for requests that are close to the head's current position and eliminate the possibility of starvation. Evaluation Criteria for Disk Scheduling Algorithms ● Throughput − Throughput is the number of input/output operations that can be processed per unit time. A disk scheduling algorithm with high throughput can process more requests in a shorter time, resulting in higher system performance. ● Turnaround time − Turnaround time is the time taken to process a request from the time it is submitted to the time it is completed. A disk scheduling algorithm with a low turnaround time can provide faster service to the users.
● Waiting time − Waiting time is the time that a request spends waiting in the queue before it is processed. A disk scheduling algorithm with a low waiting time can provide faster service to the users. ● Response time − Response time is the time taken to provide the first response to a user's request. A disk scheduling algorithm with a low response time can provide faster service to the users. ● Fairness − Fairness refers to the equal treatment of all requests in the queue. A disk scheduling algorithm that provides fair treatment to all requests can ensure that no request is starved of resources. Selection of Disk Scheduling Algorithm ● Deterministic − In deterministic disk scheduling, the algorithm is selected based on the characteristics of the workload. For example, if the workload consists of short requests, the SSTF algorithm may be the best choice. ● Dynamic − In dynamic disk scheduling, the algorithm is selected based on the current state of the system. For example, if the disk is heavily loaded, the operating system may switch to a more efficient algorithm to handle the increased workload. Dynamic disk scheduling can adapt to changes in the workload and improve system performance. The selection of the disk scheduling algorithm depends on several factors, including the characteristics of the workload, system performance requirements, and the available resources. The operating system must evaluate the different disk scheduling algorithms based on the evaluation criteria and select the algorithm that best meets the system's requirements. Advantages ● Improved performance − Disk scheduling algorithms ensure that data is accessed in the most efficient manner possible, which improves the performance of the system. ● Fairness − Disk scheduling algorithms ensure that all requests for data access are treated fairly and given a chance to be processed. ● Reduced disk fragmentation − Disk scheduling algorithms can help to reduce disk fragmentation by accessing data in a more organized manner. Disadvantages ● Overhead − Disk scheduling algorithms can create overhead and delay in processing data access requests, which can reduce overall system performance. ● Complexity − Some disk scheduling algorithms can be complex and difficult to understand, which may make it difficult to optimize system performance. ● Risk of starvation − Disk scheduling algorithms can result in starvation of certain requests, which can lead to inefficiencies and reduced system performance. Disk Management
● Prevent data loss − Disk management includes features such as disk partitioning, formatting, and backup. This helps to prevent data loss and recover lost data in the event of disk failure or other issues. ● Optimized performance − Proper disk management ensures that the disk is optimized for performance, which improves the speed and efficiency of data access. Disadvantages ● Complexity − Disk management can be complex and difficult to understand, especially for novice users. This can result in errors or improper disk configurations that may cause data loss or corruption. ● Time-consuming − Disk management tasks such as disk partitioning and formatting can be time- consuming, especially for large disks or complex configurations. ● Risk of data loss − Improper disk management can result in data loss or corruption, which can be difficult or impossible to recover.