DBMS 1 Disk Structure v2
DBMS 1 Disk Structure v2
2018
Disks - Physical Structure
Platters : each individual disk. A hard disk contains several platters.
Cylinder : tracks at the same radius. Therefore total no. of cylinders = no. of tracks/surface
Sectors and Gaps : sectors are segments of the tracks separated by gaps that are not magnetized
- blank areas, help identity the beginning of a sector).
Read/Write heads : a head reads the bits (magnetic orientation) passing under it, and can also
alter the bits to write information on the disk. The heads are each attached to an arm, and the arms
for all the surfaces move in and out together, being part of the rigid head assembly.
In this example, since there are 4
platters (and therefore 8 surfaces) each
cylinder is made up of 8 tracks (of the
same radius)
Blocks and Granularity
Blocks are logical units of data that are transferred between disk and main
memory; blocks consist of one or more sectors. So, a "sector" is a physical unit of
the disk, while a "block" is a logical unit.
Some Videos
https://youtu.be/9eMWG3fwiEU?t=53
https://youtu.be/n6uPALWAyxc?t=11
Detailed:
https://www.youtube.com/watch?v=kdmLvl1n82U
Disks Access Characteristics
Blocks (or the consecutive sectors that comprise the blocks) are read or written
when:
a) The heads are positioned at the cylinder containing the track on which the block
is located, and
b) The sectors containing the block move under the disk head as the entire disk
assembly rotates.
Disks Access Characteristics
Seek Time : the time to position the head assembly at the proper cylinder. Seek
time can be 0 if the heads happen already to be at the proper cylinder. If not, then
the heads require some minimum time to start moving and to stop again, plus
additional time that is roughly proportional to the distance traveled.
Rotational Latency : the time for the disk to rotate so the first of the sectors
containing the block reaches the head.
Transfer Time : the time it takes the sectors of the block and any gaps between
them to rotate past the head. If a disk has 250,000 bytes per track and rotates
once in 10 milliseconds, we can read from the disk at 25 megabytes per second.
Disks Access Characteristics : Max and Min
Seek Time
● Max: In the worst case, the head is positioned at the innermost cylinder, and the block we want to
read is on the outermost cylinder (or vice versa). For a disk with n cylinders, this means travelling
n-1 cylinders. For example: n=5000, seek time would be maximum if head moves from cylinder
number 1 to cylinder number 5000, or from 5000 to 1, total cylinders crossed would 5000-1.
● Min: 0, if the head is already at the right cylinder.
Rotational Latency
New Slide
● Max: Time for one whole revolution, the max rotational latency.
● Min: 0, if the head is already at the right block.
Transfer Time
● Is constant and there is no maximum or minimum. It will always be the same because time to
read/write a block is fixed.
Sample Exercise
A disk has 4 platters, 5000 tracks/surface and 40 sectors to a track. Capacity of a
sector is 512 bytes and 4 sectors make a block. Gaps take up 15% of the tracks.
Seek time is given by 1+0.004n ms(n= number of cylinders traversed). Speed is
5200rpm.