0% found this document useful (0 votes)
31 views30 pages

OS CH 12 Mass Stogare

Uploaded by

Soumya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views30 pages

OS CH 12 Mass Stogare

Uploaded by

Soumya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Magnetic Disk

 A disk is a round plate on which data can be encoded.


It provide a means to store large amount of
information.
It is a input-output device.

There are two types of disk


1) Magnetic Disk (floppy disk ,hard disk etc)
2) Optical disk (CD-ROM, WORM etc)
Hard Disk
Definition -: The hard drive of a computer is a device that stores all the software
installed on a computer, as well as all the data files created and used by this software.
(in windows, this drive is typically called the c drive while in mac, it is just called the
hard drive)

 Hard disk is a rigid non-removable magnetic disk with a large data storage capacity
(contains billions to trillions of bytes of data)

 Hard disks can store data from 20MB to more than 1-TB (terabyte).

 A hard disk/drive unit comes with a set rotation speed varying from 4,200
revolutions per minute to 15,000 rpm.

 Hard disk is collection of multiple platters.


Magnetic Disk
Components of Hard Disk

 Basic component of typical hard disk


drive :-

1. Disk platter
2. Surface
3. Spindle
4. Tracks
5. Sectors
6. Read/write head
Components
platter :- Platter is the circular disk on which magnetic data is stored in a hard disk .
• Each platter(disk) has a flat circular shape like a CD or DVD.
• Platter have two surface(upper & lower),both surface are covered by a magnetic material.

Track :- Each surface of a platter is divided into concentric circles.


• Tracks are further divided into sectors.

Sector :- Sectors are inside tracks.


• We fetch data from these sectors.
CYLINDER
CYLINDER
 One or more platters in the form of disks covered with magnetic media.

 Hard disk platters are made of rigid metal, while "floppy" disks are made of
more flexible plastic.

 Each platter has two working surfaces. Older hard disk drives would
sometimes not use the very top or bottom surface of a stack of platters, as
these surfaces were more susceptible to potential damage.

 Each working surface is divided into a number of concentric rings


called tracks.

 The collection of all tracks that are the same distance from the edge of the
platter, ( i.e. all tracks immediately above one another in the following
diagram ) is called a cylinder.

 Each track is further divided into sectors, traditionally containing 512 bytes of
data each, although some modern disks occasionally use larger sector sizes.
CLV/CAV
The capacity of tracks(outer/inner) whether uniform or not depends on how disk surface
is organized and accordingly how disk rotation happens.
Disk can be rotated or organised in two modes:

 Constant Linear Velocity(CLV): present in Optical disk/floppy disk


 Constant Angular Velocity(CAV): present in Magnetic disk

CLV-here innermost tracks have less no of sectors as compare to


outermost tracks i.e. the density of bits per track is uniform. So as
we move from outer zone to inner zone the no. of sector per track
decreases.

CAV- innermost tracks have same no of sectors as compare to


outermost tracks. Here density of bits decreases from inner track to
outer track to keep the data rate constant.
Important Terms

Seek Time: Seek time is the time taken by the read/write head of
a disc to locate the specified track where the data is to be read or
write. So the disk scheduling algorithm that gives minimum
average seek time is better.

Rotational Latency: Rotational Latency is the time taken by the


read/write head to rotate to the requested sector from the
current position. So the disk scheduling algorithm that gives
minimum rotational latency is better.

Transfer Time: Transfer time is the time to transfer the data. It


depends on the rotating speed of the disk and number of bytes
to be transferred.
Disk Access Time: Disk Access Time is:

Disk Access Time = Seek Time + Rotational Latency + Transfer


Time

Disk Response Time: Response Time is the average of time spent


by a request waiting to perform its I/O operation.
Solid State Disk
As technologies improve and economics change, old technologies are
often used in different ways. One example of this is the increasing used
of solid state disks, or SSDs.

 SSDs use memory technology as a small fast hard disk. Specific


implementations may use either flash memory or DRAM chips
protected by a battery to sustain the information through power
cycles.
 Because SSDs have no moving parts they are much faster than
traditional hard drives
 SSDs are especially useful as a high-speed cache of hard-disk
information that must be accessed quickly.
Solid State Disk
Advantages of SSD
 High Speed
 Resistant to Shocks
 Low power consumption
 Long Lifespan as it is having no moving parts

Disadvantages
 Very Expensive
 Less storage capacity SSD are available as compared to hard
disk
Magnetic tapes
 Magnetic tapes were once used for common secondary storage
before the days of hard disk drives, but today are used primarily
for backups.

 Accessing a particular spot on a magnetic tape can be slow, but


once reading or writing commences, access speeds are
comparable to disk drives.

 Capacities of tape drives can range from 20 to 200 GB, and


compression can double that capacity.
Disk scheduling
Disk scheduling is done by operating systems to schedule I/O requests arriving for the
disk. Disk scheduling is also known as I/O scheduling.

Disk scheduling is important because:

 Multiple I/O requests may arrive by different processes and only one I/O request can
be served at a time by the disk controller. Thus other I/O requests need to wait in the
waiting queue and need to be scheduled.

 Two or more request may be far from each other so can result in greater disk arm
movement.

 Hard drives are one of the slowest parts of the computer system and thus need to be
accessed in an efficient manner.
Disk Scheduling Algorithms

FCFS: FCFS is the simplest of all the Disk Scheduling Algorithms. In


FCFS, the requests are addressed in the order they arrive in the disk
queue. Let us understand this with the help of an example.

Advantages:
Every request gets a fair chance
No indefinite postponement

Disadvantages:
Does not try to optimize seek time
May not provide the best possible service
Example:
Suppose the order of request is- (82,170,43,140,24,16,190)
And current position of Read/Write head is : 50

So, total seek time:


=(82-50)+(170-82)+(170-43)+(140-43)+(140-24)+(24-16)+(190-16)
=642
Shortest Seek Time First

SSTF: In SSTF (Shortest Seek Time First), requests having shortest


seek time are executed first. So, the seek time of every request is
calculated in advance in the queue and then they are scheduled
according to their calculated seek time.

As a result, the request near the disk arm will get executed first.
SSTF is certainly an improvement over FCFS as it decreases the
average response time and increases the throughput of system.Let
us understand this with the help of an example.
Suppose the order of request is- (82,170,43,140,24,16,190)
And current position of Read/Write head is : 50

So, total seek time:


=(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-40)+(190-170)
=208
SSTF
Advantages:
 Average Response Time decreases
 Throughput increases

Disadvantages:
 Overhead to calculate seek time in advance
 Can cause Starvation for a request if it has higher seek time as compared
to incoming requests
 High variance of response time as SSTF favours only some requests
SCAN
SCAN: In SCAN algorithm the disk arm moves into a particular
direction and services the requests coming in its path and after
reaching the end of disk, it reverses its direction and again services
the request arriving in its path.

So, this algorithm works as an elevator and hence also known


as elevator algorithm. As a result, the requests at the midrange are
serviced more and those arriving behind the disk arm will have to
wait.
Suppose the requests to be addressed are-
82,170,43,140,24,16,190. And the Read/Write arm is at 50, and it is
also given that the disk arm should move “towards the larger
value”.

Therefore, the seek time is calculated as:=(199-50)+(199-16)


=332
CSCAN
CSCAN: In SCAN algorithm, the disk arm again scans the path that
has been scanned, after reversing its direction. So, it may be possible
that too many requests are waiting at the other end or there may be
zero or few requests pending at the scanned area.

These situations are avoided in CSCAN algorithm in which the disk


arm instead of reversing its direction goes to the other end of the
disk and starts servicing the requests from there.

So, the disk arm moves in a circular fashion and this algorithm is also
similar to SCAN algorithm and hence it is known as C-SCAN (Circular
SCAN).
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the
Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.

Seek time is calculated as:


=(199-50)+(199-0)+(43-0)
=391
LOOK

LOOK: It is similar to the SCAN disk scheduling algorithm except for


the difference that the disk arm in spite of going to the end of the
disk goes only to the last request to be serviced in front of the head
and then reverses its direction from there only. Thus it prevents the
extra delay which occurred due to unnecessary traversal to the end
of the disk.
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the
Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.

So, the seek time is calculated as:


=(190-50)+(190-16)
=314
CLOOK

As LOOK is similar to SCAN algorithm, in similar way, CLOOK is


similar to CSCAN disk scheduling algorithm.

In CLOOK, the disk arm in spite of going to the end goes only to
the last request to be serviced in front of the head and then from
there goes to the other end’s last request.

Thus, it also prevents the extra delay which occurred due to


unnecessary traversal to the end of the disk.
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the
Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”

So, the seek time is calculated as:


=(190-50)+(190-16)+(43-16)
=341

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy