Nothing Special   »   [go: up one dir, main page]

Disk Management

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Classes By: K.K.

Singh, The Launcher Academy, City Centre, Opp- Gossner


College, Club Road Ranchi. Contact- 8877155769, 7903154392

Disk Management

Magnetic disk:
Magnetic disk provides the permanent storage of information that is also
called secondary storage.
A magnetic disk contains a number of disks
of flat circular shape like a CD. Commonly platter’s diameter ranges
from 1.8 to 5.25 inches whose both side surface are covered with a
magnetic material. A read/write head flies just above each surface of
every platter. Heads are attached to a disk arm so that heads can be
moved backward and forward on the tracks. Each platter is divided into
a number of tracks which are again subdivided into a number of sectors.
The set of tracks that
are at one arm position makes up a cylinder. During read/write
operation, the drive motor spins/ rotate at high speed due to which it can
able to read/write in a particular sector on a track.
When a read/write operation
occurs the head move forward and backward to reach a particular track
or cylinder and spindle rotate to move a particular sector on the head.
The time to move the disk arm to a desired track
or cylinder is called seek time. And the time to rotate the disk to reach a
desired sector under the head is called latency time. These types of disks
can transfer several megabytes per second.
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

Disk structure:
CLV (Constant Linear Velocity): In this type of media, the density of
bits per track is uniform. The distant track from the center of the disk has
more length so it can hold more sectors. As we move from the outer
zones to inner zones, the number of sectors decreases. The drive
increases its rotation speed as the head moves from the outer to inner
tracks to keep the same rate of data moving under the head. This method
is used in CD-ROM and DVD ROM.
CAV (Constant Angular Velocity): in this type of media, the density of
bits decreases from inner track to outer tracks so to keep data rate
constant, disk rotation speed can be constant. This method is used in
hard disk.
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

Disk Formatting: two types of disk formatting are there:


1. Low level formatting or physical formatting
2. Logical formatting
1. A new magnetic disk is a blank just a platter of a magnetic
recording material. Before a disk can store data, it must be divided
into sectors that the disk controller can read/write. This division of
platters into the sectors is called low level formatting or physical
formatting.
2. To use a disk to hold files, O.S needs to record its own data
structures on the disk. It does it in two steps:
a. First step is partitioning that defines the O.S files area and
other users files area.
b. In this step, O.S stores the initial file system data structures
on to the disk.
FAT (File Allocation System) earlier systems
NTFS(New Technology File System) newer system
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

Disk Scheduling Algorithm:

The disk is a resource which has to be shared. It is therefore has to be


scheduled for use, according to some kind of scheduling system. A
scheduling policy should attempt to maximize throughput (defined as the
number of requests serviced per unit time) and also to minimize mean
response time (i.e., average waiting time plus service time).

There are several disk scheduling algorithms available in which these


five are most popular.
1. FCFS scheduling
2. SSTF scheduling
3. Scan scheduling
4. C-Scan scheduling
5. CLook scheduling
6. Look scheduling

1. FCFS: In FCFS scheduling when the first request of read/write on


a particular track, arrives is serviced first. It doesn’t provide the
faster service. FCFS will actually do the lengthy seek to service a
distant waiting request even though another request may have just
arrived on the same cylinder to which the R/W head is currently
positioned.

Ex: a disk queue with requests for I/O to block on Cylinder.


Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

87,170,40,150,36,72,66,15
Initially head at cylinder 60 it will first move to 87 the 87 to 170 and
so on.
27+83+130….=557 cylinders total movement of head.

2. SSTF(shortest seek time first) : this algorithm selects the request


with the minimum seek time from the current head position.
For example in the above case after 60 the closet request is 66 then
after 72, 87 and so on.

Total head movement=254 cylinders


The average head movements are 244/8=30.5 cylinders
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

3. SCAN: The scan scheduling algorithm is also called “Elevator”


algorithm. In this the disk arm starts at one end of the disk, and
moves towards the other end, while in the mean time all requests
are servicing until it gets other end of the disk. At the other end,
the direction of the head movement is reversed, and servicing
continuous.
Ex: ans 60-72-87-150-170-180(max in list)-36-15

Total disk movement=35.6 cylinder.


4. C-SCAN: stands for circular scan scheduling. In this algo. Moves
the head from one end to other end of the disk, servicing the
request along the way. When the head reaches the other end, it
immediately return to the beginning of the disk without servicing
any request on the return trip.
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

Ans: 380 cylinders movement.


5. Look: In the scheduling the disk arm goes only as far as the final
request in each direction. When completed the final request in one
direction return back to other end by servicing all the requests in
the return trip and moves to final request in this direction.
6. C-look: In the previous scheduling the disk arm goes only as far as
the final request in each direction, then it reverse the direction with
out reach at the end of the disk. On the return trip it does not
service any request in the way and reach up to first request and
continue servicing from this request.
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

Boot Block: when the computer is powered up or rebooted it must


have an initial program to run called bootstrap program. The job of
bootstrap program is to find the operating system kernel on disk, load
that kernel into the memory and jumps to an initial address to begin
the O.S execution. Generally bootstrap is stored in ROM chip because
this cannot be infected by the computer virus. Problem is that
changing this bootstrap code requires changing the hardware chips.
Due to this most system stores a tiny bootstrap loader in the boot
ROM whose only job is to bring in a full bootstrap program from
disk. This full bootstrap program is stored at the fixed location in the
disk called Boot Block. A disk that has a boot partition is called a
boot disk or system disk.
Ex: windows 2000 places its boot code in the first sector on the hard
disk called MBR (Master Boot Record).
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

Bad Block: As we know that disk have moving parts that is head just
flies above the disk surface. Due to moving this head on the disk surface
there may one or more sectors become defective. Most disks may come
from the factory with bad blocks.
Some disk with IDE (Integrated Device Electronics) controller(IDE
(Integrated Device Electronics) is a standardized interface for data storage devices in
computer systems. It is so named because much of the logic circuitry is integrated into the
device itself. IDE is most commonly used for hard drives and CD or DVD drives, but has
also been used for tape drives and zip drives.

An IDE controller is the primary interface (usually integrated into the motherboard) which
any IDE devices will be plugged into. It handles the flow of data to and from these devices. It
usually consists of two connections (known as IDE channels) both of which can handle up to
2 devices each. It is also possible to add more IDE controllers in the form of PCI or PCI-E
cards, these are usually referred to as IDE controller cards. This is often done to enable
more storage devices to be installed into the system, but may also be done to replace an
obsolete or malfuntioning on-board IDE controller.), bad blocks are handled
manually by performing format, in this process the entire disk is
scanned to find bad blocks if got the bad block, writes a special value
in the corresponding FAT (File Allocation Table) entry to tell the
allocation routine not to use that block.
Some disk with SCSI (Small Computer System Interface) controller,
can sets spare sectors not visible to Operating System. The controller
can replace each bad sector logically with one of spare sectors. This
scheme is known as sector sparing or forwarding. Most disks are
formatted to provide a few spare sectors in each, cylinder and a spare
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

cylinder as well. When a bad block is remapped, the controller uses a


spare sector from the same cylinder.
Some controller can be instructed to replace a bad block
by sector slipping. Suppose that logical block 17 becomes defective
and the first available spare follows sector 202, moving them all
down one spot that is sector 202 is copied into the spare then sector
201 into 202 and so on finally 17 to 18.

Swap space management


Swap space management is another low level task of O.S. virtual
memory uses disk space as an extension of main memory. Since disk
access is much slower than memory access which may decrease
system performance. The main goal for design and implementation of
swap space is to provide the best through put for the virtual memory
system. Swap space is used various way by different O.S, depending
on memory management technique in use. For example paging
system uses swap space to hold pages or other may use swap space to
hold an entire process. The amount of swap space needed on a system
vary based on amount of physical memory; it generally ranges from
few megabytes to gigabytes. If a system runs out of swap space it
may be forced to abort processes or may crash entirely. A swap space
can be resides in one of the two places, in the file system or it may be
in a separate disk partition. If a swap space is large file with in a file
system, normal file system routines can be used to create it, name it
and allocate its space. This approach is easy to implement but
inefficient.
Swap space can be created in a separate raw partition and file system
or directory structure cannot be placed in this space. A separate swap
space storage manager is used to allocate and de allocate the block
from the raw partition.
Classes By: K.K. Singh, The Launcher Academy, City Centre, Opp- Gossner
College, Club Road Ranchi. Contact- 8877155769, 7903154392

Question:
. Suppose the requests for inputting/ outputting to blocks on the cylinders have
arrived, forming the following disk queue: 50, 91, 150, 42, 130, 18, 140, 70, 60
Also assume that the disk head is initially at cylinder 50. Then calculate total no
of head movement per cylinders for all the above scheduling algorithms..
(Assume that head movement direction (let it towards 0, starting cylinder).

You might also like