1/8/23
Secondary Storage and System Software
Lecture No. 2
Contents
1 Introduction
2 Magnetic Storage Technology
3 Optical Storage Technology
4 Solid State Storage Technology
7 LOGO
7
1
1/8/23
Introduction
8 LOGO
8
Secondary Storage Devices
v Since secondary storage is different from main memory
we have to understand how it works in order to do good
file designs.
v Two major types of storage devices according to
Access type:
§ Direct Access Storage Devices (DASDs)
• Magnetic Disks
Hard Disks (high capacity, low cost per bit)
• Optical Disks
CD-ROM,DVD-ROM
(Read-only/write-once, holds a lot of data, cheap)
§ Serial Devices
• Magnetic Tapes
9 LOGO
9
2
1/8/23
Storage Basics
v A data storage system has two main components: a
storage medium and a storage device.
v A storage medium is the disk,
tape, CD, DVD, paper, or other
substance that contains data.
v A storage device is the
mechanical device that records and
retrieves data from a storage
medium.
10 LOGO
10
Storage Basics
v Three types of storage technologies are commonly used
for personal computers: magnetic, optical, and solid state
v Each storage technology has its advantages and
disadvantages.
11 LOGO
11
3
1/8/23
Magnetic Storage
Technology
12 LOGO
12
Magnetic Storage Technology
v Magnetic storage stores data by magnetizing
microscopic particles on a disk or tape surface.
v The particles retain their magnetic orientation until that
orientation is changed, thereby making disks fairly
permanent but modifiable storage media.
Hard disk Floppy disk Tape
13 LOGO
13
4
1/8/23
Hard Disks
v A hard disk drive contains one or more platters and their
associated read-write heads.
v A hard disk platter is a flat, rigid disk made of aluminum or
glass and coated with magnetic iron oxide particles.
v More platters mean more data storage capacity. The
platters rotate as a unit on a spindle, making thousands of
rotations per minute (RPM).
v Hard disk platters are typically 3.5" in diameter, with
storage capacities ranging from 40 GB to 2 TB.
14 LOGO
14
Hard Disks
15 LOGO
15
5
1/8/23
Hard Disks
16 LOGO
16
Hard Disks
17 LOGO
17
6
1/8/23
Hard Disks
18 LOGO
18
Hard Disks
v Each platter has a read-write head that hovers just a few
microinches above the surface.
v A read-write head mechanism in the disk drive magnetizes
particles to write data, and senses the particles’ polarities to
read data.
v Hard disk technology is the preferred type of main storage
for most personal computers because:
§ It provides lots of storage capacity.
§ It provides fast access to files.
§ A hard disk is economical.
19 LOGO
19
7
1/8/23
Hard Disks
20 LOGO
20
Hard Disks
v Magnetic disks support direct access to a desired location
v Simplified structure of a disk:
§ Disk blocks
§ Tracks
§ Platters
§ Cylinder
§ Sectors
§ Disk heads
§ Disk Controller
§ Seek Time
§ Rotational delay
21 LOGO
21
8
1/8/23
Hard Disks
v The platters spin (7200 rpm
or 5400 rpm)
v The arm assembly is moved
in or out to position a head on
a desired track.
v Tracks under heads make a
cylinder.
v Only one head reads/writes
at any one time
22 LOGO
22
Hard Disks
v Disk contains concentric tracks
v Tracks are divided into sectors
v A sector is the
smallest
addressable unit
in disk
23 LOGO
23
9
1/8/23
Hard Disks
24 LOGO
24
Hard Disks
25 LOGO
25
10
1/8/23
Hard Disks
26 LOGO
26
Hard Disks
27 LOGO
27
11
1/8/23
Hard Disks
v Cylinder: the set of tracks on
a disk that are directly
above/below each other
v All the information on a
cylinder can be accessed
without moving the read/write
arm (seeking)
28 LOGO
28
Disk Access Bottleneck
v When a program reads a byte from the disk,
the operating system locates the surface,
track and sector containing that byte, and
reads the entire sector into a special area in
main memory called buffer.
v The bottleneck of a disk access is moving
the read/write arm.
v So, it makes sense to store a file in tracks
that are below/above each other in different
surfaces, rather than in several tracks in the
same surface.
29 LOGO
29
12
1/8/23
How to calculate Disk Capacity?
v Number of cylinders = number of tracks in a surface
v Track capacity = number of sector per track × bytes per
sector
v Cylinder capacity = number of surfaces × track capacity
v Drive capacity = number of cylinders × cylinder capacity
30 LOGO
30
How to calculate Disk Capacity?
v If we know the number of bytes in a file, we can use it to
compute the amount of disk space the file is likely to
require.
v Suppose we have a file containing fixed-length records
§ Number of records = 50.000 records
§ Size of a record = 256 bytes
v Disk characteristics
§ Number of bytes per sector = 512
§ Number of sectors per track = 63
§ Number of tracks per cylinder = 16
§ Number of cylinders = 4092
v How many cylinders are needed?
31 LOGO
31
13
1/8/23
How to calculate Disk Capacity?
v Since each sector can hold two records, the file requires:
v One cylinder can hold:
v so the number of cylinders required is approximately
32 LOGO
32
Clusters, Extents, and Fragmentation
v The file manager is the part of the operating system
responsible for managing files
v The file manager maps the logical parts of the file into
their physical location
v A cluster is a fixed number of contiguous sectors
v The file manager allocates an integer number of clusters
to a file.
33 LOGO
33
14
1/8/23
Clusters, Extents, and Fragmentation
v An example: Sector size: 512 bytes, Cluster size: 2
sectors
v If a file contains 10 bytes, a cluster is allocated (1024
bytes).
v There may be unused space in the last cluster of a file.
v This unused space contributes to internal fragmentation
34 LOGO
34
Clusters, Extents, and Fragmentation
v Clusters are good since they improve sequential access:
reading bytes sequentially from a cluster can be done in
one revolution, seeking only once.
v The file manager maintains a file allocation table (FAT)
containing for each cluster in the file and its location in
disk
v An extent is a group of contiguous clusters. If file is
stored in a single extent then seeking is done only once.
v If there is not enough contiguous clusters to hold a file,
the file is divided into 2 or more extents.
35 LOGO
35
15
1/8/23
Fragmentation
v Due to records not fitting exactly in a sector
§ Example: Record size = 200 bytes, sector size = 512 bytes
§ To avoid that a record span 2 sectors we can only store 2
records in this sector (112 bytes go unused per sector)
§ The alternative is to let a record span two sectors, but in this
case, two sectors must be read when we need to access this
record)
v Due to the use of clusters
§ If the file size is not multiple of the cluster size, then the last
cluster will be partially used.
36 LOGO
36
How to Choose Cluster Size
v Some OS allow the system administrator to choose the
cluster size.
v When to use large cluster size?
§ When disks contain large files likely to be processed
sequentially.
§ Example: Updates in a master file of bank accounts (in batch
mode)
v What about small cluster size?
§ When disks contain small files and/or files likely to be accessed
randomly
§ Example : online updates for airline reservation
37 LOGO
37
16
1/8/23
Organizing Tracks by Blocks
v Disk tracks may be divided into user-defined blocks
rather than into sectors.
v The amount transferred in a single I/O operation can
vary depending on the needs of the software designer
v A block is usually organized to contain an integral
number of logical records.
Blocking Factor = number of records stored in each
block in a file
v No internal fragmentation, no record spanning two
blocks
38 LOGO
38
Organizing Tracks by Blocks
v A block typically contains subblocks:
§ Count subblock: contains the number of bytes in a block
§ Key subblock (optional): contains the key for the last record in
the data subblock (disk controller can search for key without
loading it in main memory)
§ Data subblock: contains the records in this block.
Count subblock Key subblock Data subblock
block
39 LOGO
39
17
1/8/23
Nondata Overhead
v Amount of space used for extra stuff other than data
v Sector-Addressable Disks
§ At the beginning of each sector some info is stored, such as
sector address, track address, condition (if sector is defective);
§ There is some gap between sectors
v Block-Organized Disks
§ subblocks and interblock gaps is part of the extra stuff; more
nondata overhead than with sector-addressing
40 LOGO
40
Solved Example
v Disk characteristics
§ Block-addressable Disk Drive
§ Size of track = 20.000 bytes
§ Nondata overhead per block = 300 bytes
v File Characteristics
§ Record size = 100 bytes
v How many records can be stored per track for the
following blocking factors?
1. Block factor = 10
2. Block factor = 60
41 LOGO
41
18
1/8/23
Solved Example
v Blocking factor is 10
v Size of data subblocks = 1000
v Number of blocks that can fit in a track =
v Number of records per track = 150 records
42 LOGO
42
Solved Example
v Blocking factor is 60
v Size of data subblocks = 6000
v Number of blocks that can fit in a track =
v Number of records per track = 180 records
43 LOGO
43
19
1/8/23
The Cost of Disk Access
v Seek time: the time required to move the access arm to
position disk head on the correct track.
v Rotational delay: the time it takes for the disk to rotate
so the desired sector is under the read/write head.
v Transfer time: the amount of time required to move data
to/from disk surface.
v Average Total time = Average Seek time + Average
Rotational delay + Transfer time
44 LOGO
44
External Hard Disks (Portable)
v The storage capacity of your desktop or laptop computer
can be increased by adding a second hard disk drive.
v Internal drives are inexpensive and can be easily installed
in a desktop computer’s system unit.
v External drives are slightly more expensive and connect
to a desktop or laptop computer using a cable.
45 LOGO
45
20
1/8/23
Floppy Disk
v Floppy disks (also called floppies
or diskettes) is a type of disk
storage composed of a disk of thin
and flexible magnetic storage
medium, sealed in a rectangular
plastic carrier lined with fabric that
removes dust particles.
v This storage technology is no
longer used because a floppy
disk’s 1.44 MB capacity is not
sufficient for today’s media-
intensive applications.
46 LOGO
46
Tapes
v A tape is a magnetically coated strip of plastic on which
data can be encoded.
v Tapes are similar to tapes used to store music.
v Storing data on tapes is considerably cheaper than
storing data on disks.
47 LOGO
47
21
1/8/23
Tapes
v Accessing data on tapes, however, is much slower than
accessing data on disks.
v Tapes are sequential-access media, which means that to
get to a particular point on the tape, the tape must go
through all the preceding points
48 LOGO
48
Optical Storage
Technology
49 LOGO
49
22
1/8/23
Optical Storage Technology
v CD, DVD, and Blu-ray technologies are classified as
optical storage, which stores data as microscopic light
and dark spots on the disc surface.
v The dark spots are called pits. The lighter, non-pitted
surface areas of the disc are called lands.
50 LOGO
50
Optical Storage Technology
v Optical drives contain a spindle that rotates the disc over
a laser lens.
v The laser directs a beam of light toward the underside of
the disc.
v The dark pits and light lands on the disc surface reflect
the light differently.
v As the lens reads the disc, these differences are
translated into the 0s and 1s that represent Data
51 LOGO
51
23
1/8/23
Optical Storage Technology
52 LOGO
52
Optical Storage Technology
53 LOGO
53
24
1/8/23
Optical Storage Technology
v Optical technologies are grouped into three categories:
read-only, recordable, and rewritable.
Read-only Recordable Rewritable
Read-only Recordable Rewritable
Technology (ROM) Technology (R) Technology (RW)
You cannot write to a You can write to one You can write to
-ROM disc, which left of these discs once these discs, erase
the factory with data (provided you have them, and write to
already on it. A -ROM an -R drive). But them again.
drive can read discs when you're done, The term re-
but not write to them, it's effectively a - recordable (RE) is
and has no use at all ROM disc sometimes used
for a blank disc. instead of rewritable
LOGO
54
CD (Compact Disc)
v CD (Compact Disc) technology was originally designed
to hold 74 minutes of recorded music.
v The original CD standard was adapted for computer
storage with capacity for 650 MB of data.
v Later improvements in CD standards increased the
capacity to 80 minutes of music or 700 MB of data.
55 LOGO
55
25
1/8/23
DVD (Digital Video Disc)
v DVD (Digital Video Disc or Digital Versatile Disc) is a
variation of CD technology that was originally designed as
an alternative to VCRs, but was quickly adopted by the
computer industry to store data.
v The initial DVD standard offered 4.7 GB (4,700 MB) of
data storage.
v A double layer DVD has two recordable layers on the
same side and can store 8.5 GB of data.
56 LOGO
56
Blu-ray
v Blu-ray is a high-capacity storage technology with a 25
GB capacity per layer.
v The name Blu-ray is derived from the blue-violet colored
laser used to read data stored on Blu-ray discs.
v DVD technology uses a red laser; CD technology uses a
near infrared laser
57 LOGO
57
26
1/8/23
Solid State Storage
Technology
58 LOGO
58
Solid State Storage Technology
v Solid State Storage (sometimes called flash memory) is
a technology that stores data in erasable, rewritable
circuitry, rather than on spinning disks or streaming tape.
v It is widely used in portable consumer devices, such as
digital cameras, portable media players, iPads, and cell
phones.
v It is also used as an alternative for hard disk storage in
some laptop computers.
59 LOGO
59
27
1/8/23
Solid State Storage Technology
v Solid state storage contains a grid work of circuitry.
v Each cell in the grid contains two transistors that act as
gates to hold the 1s and 0s that represent data
v Very little power is required to open or close the gates,
which makes solid state storage ideal for battery-operated
devices, such as digital cameras and media players.
60 LOGO
60
Solid State Storage Technology
v Solid state storage has the following advantages:
§ Fast access to data because it includes no moving parts.
§ Very durable; it is virtually impervious to vibration, magnetic fields,
or extreme temperature fluctuations.
v However, the capacity of solid state storage does not
currently match that of hard disks.
v The cost per megabyte of solid state storage is slightly
higher than for magnetic or optical storage.
61 LOGO
61
28
1/8/23
Solid State Storage Technology
v Several types of solid state storage are available to
today’s consumers: memory cards, solid state drives, and
USB flash drives.
62 LOGO
62
Memory Cards
v A memory card is a flat, solid state storage medium
commonly used to transfer files from digital cameras and
media players to computers.
v A card reader is a device that reads and writes data on
solid state storage.
63 LOGO
63
29
1/8/23
Solid State Drive (SSD)
v A solid state drive (SSD) is a package of flash memory
that can be used as a substitute for a hard disk drive.
v Some solid state drives are about the same size as a
microprocessor chip, whereas others are about the size of
a small hard disk drive.
64 LOGO
64
USB Flash Drives
v A USB flash drive is a portable storage device that plugs
directly into a computer’s system unit using a built-in
connector.
v USB flash drives have capacities ranging from 16 MB to
256 GB.
v Flash drives are slower than hard disk drives.
65 LOGO
65
30
1/8/23
Advantages & Disadvantages of Different Storage Technology
66 LOGO
66
31