0% found this document useful (0 votes)
5 views

SEG3420 File Structures and Processing - Lecture3 Secondary Storage Media_Magnetic Disks

This document provides an overview of magnetic disks as secondary storage devices, covering their characteristics, capacity, seek and latency times, and data transfer rates. It discusses disk architecture, including sector and block addressable devices, and details on clusters and extents. The content is based on a textbook and lecture notes, aimed at understanding file structures and processing in computer systems.

Uploaded by

simon wong
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

SEG3420 File Structures and Processing - Lecture3 Secondary Storage Media_Magnetic Disks

This document provides an overview of magnetic disks as secondary storage devices, covering their characteristics, capacity, seek and latency times, and data transfer rates. It discusses disk architecture, including sector and block addressable devices, and details on clusters and extents. The content is based on a textbook and lecture notes, aimed at understanding file structures and processing in computer systems.

Uploaded by

simon wong
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

SEG3420 File Structures and Processing

Lecture 3 – Secondary Storage Devices:


Magnetic Disks

Source: This notes is based on


• Chapter 2 of the textbook Panos E. Livadas, File Structure Theory
and Practice, Prentice Hall
• Lecture Notes from Prof. Wong class available at
http://www.se.cuhk.edu.hk/~seg3420/
Agenda

• General Characteristics
• Disk Capacity
• Seek and Latency Time
• Data Transfer Rate
• Average Seek Time
• Disk Architecture
• Clusters and Extents
General Characteristics 1/4

• Magnetic disks support both sequential and


random access
• They are called Direct Access Storage
Devices (DASD)
– Records can be accessed directly (no need to
access all preceding records)
• A disk (or disk pack) is
– a collection of equal size platters
– permanently mounted in their centers on a spindle
General Characteristics 2/4

• Each surface of a platter consists of a number


of concentric rings known as tracks

Tracks are
numbered in
sequence
On each track
3 2 1 0
data are
encoded in a
serial
representation
General Characteristics 3/4
- Capacity

• The capacity of track (TC) is the number of


bytes that can be stored in a track
• Each track has the same capacity for most
systems
– What is the implication of this on the densities of
the tracks?
General Characteristics 4/4
- Cylinder

• A cylinder is the set of all tracks with the


same number in a pack of disks
– Example: cylinder 0 is the set of all tracks with
track number 0
• Two parameters are needed to specify a
track
– Cylinder number
– Track number
Disk Capacity

• The disk capacity, denoted by DC, of a disk is


the number of bytes that can be stored and
can be computed as follows
DC = NC x TPC x TC
where
– NC: The number of cylinders
– TPC: The number of tracks per cylinder
– TC: Capacity of a track
Seek and Latency Time

• Seek Time: The time required to move the


actuator from the current cylinder to the
requested one
• Head-Switching Time: The time required to
activate the R/W head corresponding to the
requested track
• Latency Time: The time to rotate the disk until
the beginning of the requested block is
positioned immediately under the R/W head
Data Transfer Rate 1/3

• Under the assumption that the contents of the


whole track can be either read or written, the
maximal data transfer rate (MDTR) can be
computed as
MDTR = TC / RT
where RT is the time takes for a complete
disk revolution
Data Transfer Rate 2/3

• Question: What are the overheads to access


a target block?
• Conceptually, a block consists of two portions
– The block overhead that consists of system data
(information identifying the block) with size
denoted by BOS
– The data subblock that consists of user’s data with
size denoted by DBS
• Question: What is the total time required to
obtain the requested block?
Data Transfer Rate 3/3

• Question: What is the total time required to


obtain the requested block?
• Question: The time spent for reading the data
is called the effective data transfer rate
(EDTR).
– How can we compute the EDTR?
– What is the dominant quantity in the EDTR?
Average Seek Time 1/4

• The determination of the seek time is


important
• Exact value of the seek time is complicated to
compute
• We compute the average seek time instead
• Assumptions
– Accesses are distributed randomly
– The disk has n cylinders numbered from 0 to n - 1
Average Seek Time 2/4

• The average seek time s is given by


n-1

s = Σ s[j] x p[j]
j=0

where
– S[j] = seek time for a seek of length j
– P[j] = probability that a seek has length j
Average Seek Time 3/4

• Now suppose the R/W head is positioned


over cylinder k currently. Then
– A seek of length l is possible towards the center of
the disk iff k is less than or equal to (n – 1) – l
– A seek of length l is possible towards the outer
surface of the disk iff k is greater than or equal to l
Average Seek Time 4/4

• Let
p[i] = The probability of a length-l-seek from the
current cylinder i towards the center of the
disk
p[j] = The probability of a length-l-seek from the
current cylinder j towards the center of the
disk
What is the probability of a length-l-seek in
terms of p[i] and p[j]?
Disk Architecture

• There are two categories of disks according to


the differences in their addressing scheme
– Sector addressable devices
– Block addressable devices
Disk Architecture
- Sector Addressable Devices 1/4
• Each track is divided into a fixed number of
fixed equal size sectors by
– The manufacturer (called hard sectoring)
– The disk controller (called soft sectoring)
• Characteristics of a sector
– It is the smallest addressable unit
– The capacity of hard sectoring sector is known to
the disk drive
– The capacity of soft sectoring sector is known via
special markers written on the disk surface
Disk Architecture
- Sector Addressable Devices 2/4
– As the sector capacity is fixed, records are handled
with method similar to the one for variable length
records for tapes
– The VAX/VMS system uses record terminator
(special character such as a carriage return or line
feed) to separate blocks
• Question: What is the difference between this and the
method used for for spanned variable record in tapes?
Disk Architecture
- Sector Addressable Devices 3/4
• Example: The IBM 3310 Disk
– Its architecture is known as fixed-block architecture
(FBA) according to IBM terminology
– Sectors are referred to as blocks
– Only 32 sectors of the 33 sectors of each track are
available for use
– Each sector has a capacity of 600 bytes (only 512
bytes of these are available for use)
– Address of each block is given in terms of its
displacement from the very first block of the disk
(known as the physical block number)
Disk Architecture
- Sector Addressable Devices 4/4
– The controller resolves the physical block number
into the following three components during I/O
operations
• Cylinder number
• Track number within the cylinder
• Block number within the track
– Control interval (CI) is the unit of data that can be
transferred between primary and secondary storage
in one physical I/O operation
Disk Architecture
- Block Addressable Devices 1/11
• Most IBM-manufactured devices are block
addressable devices
• There are two formats
– Count data format
– Count-key data format
• The block size (i.e. blocking factor) is user-
defined
Disk Architecture
- Block Addressable Devices 2/11
BASE DATA DATA
IM HA IBG IBG IBG IBG
BLOCK BLOCK BLOCK

• Track format
– IM (Index Marker): indicates the physical beginning
of a particular track
– HA (Home Address): Consists of the following five
subfields
• Cylinder number
• Head number
• Physical address
• A flag indicates whether it is defective or operative and
whether it is a primary or alternate track
• A 2-byte cyclic checking field
Disk Architecture
- Block Addressable Devices 3/11
COUNT AREA ISBG DATA AREA

• Base Block or Track Descriptor Block


– Contains system information
– No user information
– Count area
• Contains the address of an alternate track when this track is
defective
• A key length subfield that is set to 0
• Number of fields = Count area of a data block
Disk Architecture
- Block Addressable Devices 4/11

– Data area
• 10-byte-long area
• Gives the amount of unused space in this track
• 2-byte-long subfield for cyclic check
• Interblock Gaps (IBG)
– Size depends on
• Block size
• Number of blocks allocated
Disk Architecture
- Block Addressable Devices 5/11
Count
A ISBG ISBG R0 R1 R2 … R3
area

• Count Data Format


– A is a 2-byte field that indicates the physical
beginning of the data block called the address marker
– ISBG allows the switching between R/W operations
and is called the intersubblock gaps
Disk Architecture
- Block Addressable Devices 6/11

– Count area contains eight subfields


• Cylinder number
• Head number (Track number)
• Block number
• Key length field
• Data length field
• Flag field
• Cyclic check
• The block’s physical address
– Data area that contains user data
Disk Architecture
- Block Addressable Devices 7/11

• What is the block overhead (BOS)?


Disk Architecture
- Block Addressable Devices 8/11
Count Key Data
A ISBG ISBG ISBG
area area area

• Count-Key Data Format


– A indicates the physical beginning and is called the
address marker
– Count area contains the same eight subfields as the
count data format except the key length is set equal to
the length of the key in bytes
– Key area provides information on the key of the last
record in the data area
Disk Architecture
- Block Addressable Devices 9/11
– Data area
• There are two formats: nonembedded and embedded
• In both formats, the key in the key area is attached to the
beginning of the data area
• Embedded format: Data are structured as in the count data
format

n R0 R1 R2 … Rn

• Nonembedded format: The record keys are attached to their


beginnings

n 0 R0 1 R1 … n Rn
Disk Architecture
- Block Addressable Devices 10/11
• Question: What is the block overhead for count-
key data format?
Disk Architecture
- Block Addressable Devices 11/11
• A word about IBG in disks:
– The sizes of IBG In disks are not fixed
– IBG sizes for disks depends on
• Block size
• The specific device
– Exact values cannot be calculated
• IBG size will be ignored from now on
Disk Architecture
- Parity Checking
• Parity check is performed by the disk controller
• Two cyclic check redundancy bytes are used
• Four error correction code bytes are computed
during a physical write operation
Clusters and Extents 1/2

• Physical blocks for external storage must be


allocated for the creation of a physical file
• A cluster is a collection of contiguous physical
blocks
• The cluster size of a cluster is the number of
blocks in the cluster
• A collection of contiguous tracks/cylinders is called
an extent
• Multiple extent will be assigned to a physical file in
general
Clusters and Extents 2/2
VOLUME VOLNME
VTOC
VOL LABEL SERIAL SECURITY UNUSED IDENTIFICATION UNUSED
ADDRESS
NUMBER NUMBER

• Volume label
– Uses to identify a disk
– Resides in the first track of the first cylinder
– The VTOC acts as the disk directory
References

1. Panos E. Livadas, File Structure Theory


and Practice, Prentice Hall
2. Past SEG3420 Lecture Notes from Prof.
Wong’s class available at
http://www.se.cuhk.edu.hk/~seg3420/

You might also like