MASS STORAGE
STRUCTURE AND
FILE SYSTEM
OVERVIEW OF MASS-STORAGE STRUCTURE
• In this section, we present a general overview of
the physical structure of secondary and tertiary
storage devices.
Magnetic Disks
• Magnetic disks provide a bulk of secondary
storage. Disks come in various sizes and speed.
Here the information is stored magnetically.
• Each disk platter has a flat circular shape like
CD.
• The two surfaces of a platter are covered with a
magnetic material.
• The surface of a platter is logically
divided into circular tracks, which are
subdivided into sectors.
• Sector is the basic unit of storage.
• The set of tracks that are at one arm
position makes up a cylinder
•.
• There may be thousands of concentric
cylinders in a disk drive, and each track
may contain hundreds of sectors.
• The storage capacity of disk drives is
measured in gigabytes
• The head moves from the inner track of the disk to the outer track.
• When the disk drive is operating the disks is rotating at a constant
speed.
• To read or write the head must be positioned at the desired track and
at the beginning of the desired sector on that track
• Seek Time:-Seek time is the time required to move the disk arm to
the required track.
• Rotational Latency(Rotational Delay):-Rotational latency is the
time taken for the disk to rotate so that the required sector comes
under the r/w head.
• Positioning time or random access time is the summation of seek time
and rotational delay.
• Disk Bandwidth:-Disk bandwidth is the total number of bytes
transferred divided by total time between the first request for service
and the completion of last transfer.
• Transfer rate is the rate at which data flow between the drive and the
computer
• As the disk head flies on an extremely thin cushion of air, the head will
make contact with the disk surface.
• Although the disk platters are coated with a thin protective layer,
sometimes the head will damage the magnetic surface. This accident is
called a head crash.
Magnetic Tapes
• Magnetic tape is a secondary-storage medium.
• It is a permanent memory and can hold large quantities of data.
• The time taken to access data (access time) is large compared with
that of magnetic disk, because here data is accessed sequentially.
• When the nth data has to be read, the tape starts moving from first
and reaches the nth position and then data is read from nth position.
• It is not possible to directly move to the nth position.
• So tapes are used mainly for backup, for storage of infrequently
used information
DISK STRUCTURE
• Each disk platter is divided into number of tracks and each track is
divided into number of sectors.
• Sectors is the basic unit for read or write operation in the disk.
• Modern disk drives are addressed as a large one-dimensional array.
• The one-dimensional array of logical blocks is mapped onto the sectors
of the disk sequentially.
• Sector 0 is the first sector of the first track on the outermost cylinder.
• The mapping proceeds in order through that track, then through the rest
of the tracks in that cylinder, and then through the rest of the cylinders
from outermost to innermost
• By using this mapping, we can—at least in theory—convert a logical
block number into an old-style disk address that consists of a cylinder
number, a track number within that cylinder, and a sector number within
that track.
• In practice, it is difficult to perform this translation, for two reasons.
•
• First, most disks have some defective sectors, but the mapping hides this
by substituting spare sectors from elsewhere on the disk.
• Second, the number of sectors per track is not a constant on some drives
• The disk structure (architecture) can be of two types – i) Constant
Linear Velocity (CLV) ii) Constant Angular Velocity (CAV)
• i) CLV - The density of bits per track is uniform.
• The farther a track is from the center of the disk, the greater its length,
so the more sectors it can hold.
• As we move from outer zones to inner zones, the number of sectors per
track decreases.
• This architecture is used in CD-ROM and DVD-ROM.
ii) CAV(Constant Angular velocity) – There is same number of
sectors in each track.
• The sectors are densely packed in the inner tracks.
• The density of bits decreases from inner tracks to outer tracks to
keep the data rate constant
DISK ATTACHMENT
• Computers can access data in two ways.
i) via I/O ports (or host-attached storage)
ii) via a remote host in a distributed file system( or network-attached
storage)
i)Host-Attached Storage
• Host-attached storage is storage accessed through local I/O ports.
• Example : the typical desktop PC uses an I/O bus architecture called
IDE or ATA. This architecture supports a maximum of two drives per
I/O bus.
• The other cabling systems are – SATA(Serially Attached
Technology Attachment), SCSI(Small Computer System Interface)
and fiber channel (FC).
• SCSI is a bus architecture. Its physical medium is usually a ribbon
cable.
• FC is a high- speed serial architecture that can operate over optical
fiber or over a four-conductor copper cable.
• An improved version of this architecture is the basis of storage-area
networks (SAN)
ii) Network-Attached Storage
• A network-attached storage (NAS) device is a special-purpose storage
system that is accessed remotely over a network as shown in the figure.
• Clients access network-attached storage via a remote-procedure-call
interface.
• The remote procedure calls (RPCs) are carried via TCP or UDP over an
IP network—-usually the same local-area network (LAN) carries all data
traffic to the clients
iii) Storage Area Network(SAN)
• A storage-area network (SAN) is a private network connecting
servers and storage units.
• The power of a SAN lies in its flexibility.
• Multiple hosts and multiple storage arrays can attach to the same
SAN, and storage can be dynamically allocated to hosts.
• A SAN switch allows or prohibits access between the hosts and the
storage.
• Fiber Chanel is the most common SAN interconnect
DISK SCHEDULING
• One of the responsibilities of the operating system is to use the
hardware efficiently
• To achieve this, the disk needs to have : Fast Access time , Large
disk management
• The seek time is the time for the disk arm to move the heads to the
cylinder containing the desired sector.
• The rotational latency is the additional time for the disk to rotate
the desired sector to the disk head.
• The disk bandwidth is the total number of bytes transferred, divided by the
total time between the first request for service and the completion of the last
transfer.
• We can improve both the access time and the bandwidth by managing the order in
which disk I/O requests are serviced.
• Whenever a process needs I/O to or from the disk, it issues a system call to the
operating system.
• The request specifies several pieces of information:
✓Whether this operation is input or output
✓What the disk address for the transfer is
✓What the memory address for the transfer is
✓What the number of sectors to be transferred is
✓If the desired disk drive and controller are available, the request can be serviced
immediately.
• If the drive or controller is busy, any new requests for service will be
placed in the queue of pending requests for that drive.
• For a multiprogramming system with many processes, the disk queue
may often have several pending requests.
• Thus, when one request is completed, the operating system chooses
which pending request to service next.
• How does the operating system make this choice? Any one of several
disk-scheduling algorithms can be used
FCFS DISK SCHEDULING
• Consider, for example, a disk queue with requests for I/O to blocks on
cylinders 98, 183, 37, 122, 14, 124, 65, 67
queue 98, 183, 37, 122, 14, 124, 65, 67 head starts at 53
Advantages
• The algorithm is fair
• There is no starvation
Disadvantages
• Not the best performance
SSTF SCHEDULING
• SSTF ( Shortest Seek Time First) algorithm:
• This selects the request with minimum seek time from the current head
position.
• STF chooses the pending request closest to the current head position.
• Eg:- consider a disk queue with request for i/o to blocks on cylinders. 98,
183, 37, 122, 14, 124, 65, 67
• If the disk head is initially at 53, the closest is at cylinder 65
• Total head movement=236
• Advantage
• SSTF is a substantial improvement in performance when compared to FCFS,
Disadvantage
It causes starvation
it is not optimal
SCAN ALGORITHM
• In this the disk arm starts moving towards one end, servicing the
request as it reaches each cylinder until it gets to the other end of the
disk.
• At the other end, the direction of the head movement is reversed and
servicing continues.
• The initial direction is chosen depending upon the direction of the
head.
• Eg:-:-consider a disk queue with request for i/o to
blocks on cylinders. 98, 183, 37, 122, 14, 124, 65,
67
• If the disk head is initially at 53 and if the head is
moving towards 0 th track, it services 37 and then
14. At cylinder 0 the arm will reverse and will
move towards the other end of the disk servicing
65, 67, 98, 122, 124 and 183
• If the disk head is initially at 53 and if the head is
moving towards the outer track, it services 65, 67,
98, 122, 124 and183. At cylinder 199 the arm will
reverse and will move towards the other end of the
disk servicing 37 and then 14. The SCAN is also
called as elevator algorithm.
C-SCAN SCHEDULING
• Circular SCAN (C-SCAN)
scheduling is a variant of SCAN
designed to provide a more uniform wait
time. Like SCAN, C-SCAN moves the
head from one end of the disk to the
other, servicing requests along the way.
• When the head reaches the other end,
however, it immediately returns to the
beginning of the disk without servicing
any requests on the return trip (Figure
10.7).
• The C-SCAN scheduling algorithm
essentially treats the cylinders as a
circular list that wraps around from the
final cylinder to the first one.
LOOK SCHEDULING
• Both SCAN and C-SCAN move the disk arm
across the full width of the disk.
• In practice, neither algorithm is often implemented
this way. More commonly, the arm goes only as far
as the final request in each direction. Then, it
reverses direction immediately, without going all the
way to the end of the disk.
• Versions of SCAN and C-SCAN that follow this
pattern are called LOOK and C-LOOK
scheduling, because they look for a request
before continuing to move in a given direction
(Figure 10.8).
C-LOOK