0% found this document useful (0 votes)
18 views42 pages

OS - MassStroge

The document provides an overview of secondary storage structures, including mass storage types like SSDs, HDDs, and tape drives, as well as their characteristics. It discusses disk scheduling algorithms such as FCFS, SSTF, SCAN, and LOOK, highlighting their advantages and disadvantages in managing I/O requests. Additionally, it covers file systems, directory structures, and various allocation methods for efficient data management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views42 pages

OS - MassStroge

The document provides an overview of secondary storage structures, including mass storage types like SSDs, HDDs, and tape drives, as well as their characteristics. It discusses disk scheduling algorithms such as FCFS, SSTF, SCAN, and LOOK, highlighting their advantages and disadvantages in managing I/O requests. Additionally, it covers file systems, directory structures, and various allocation methods for efficient data management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

By

K PAVAN KUMAR
Dept. Of CSE
VFSTR University
Secondary Storage Structure
 Overview of mass-storage structure,
 Disk structure, disk scheduling;
 File Systems - file concept, access methods
 Directory structure,
 File system mounting,
 File sharing protection;
 File-system structure,
 File system implementation,
 Directory implementation,
 Allocation methods,
 Free space management.
Mass-storage structure

 Mass storage refers to various techniques and


devices for storing large amounts of data.
 Measured in GB(1,024MB) and TB(1,024GB).
 Called auxiliary storage.
Ex:
 Solid-state drives (SSD) -- Hard drives
 External hard drives -- Optical drives
 Tape drives -- RAID storage
 USB storage -- Flash memory cards
Tape Drive
 Reads and writes data on a magnetic tape.
 Used for offline, archival data storage.
 Low cost and a long archival stability.
 Average access times.
Optical Disc Drive

 ODD is a disc drive that uses laser light or


electromagnetic waves.
 Used for Read/Write.

 Common types are Compact discs, DVDs, and Blu-


ray discs.
Flash Drive

 Uses EEPROM (electrically erasable programmable


read-only) format to store and retrieve data.
 Flash drives operate in a similar fashion as
conventional hard drives.
Flash drive/Pen drive

 Small and portable storage device


 Connect by using a USB Type
 The way flash drives work is similar to solid-
state drives, or SSDs.
SDD

 Stores data in microchips that contain flash


memories, which are interconnected.

 Increased durability due to no moving parts.


 Faster data transfer rates
 More reliable long-term storage

 HDD
RAID

 RAID (redundant array of independent


disks):
 Way of storing the same data in different places
on multiple hard disks or SSDs to protect data in
the case of a drive failure.
Flash Memory

 A flash memory card (sometimes called a storage


card) is a small storage device that uses
nonvolatile semiconductor.

 Flash memory is a solid-state electronic memory


 2 types of flash memory.
 NAND flash memory is usually used for general-
purpose data storage and transfer.
 NOR flash memory is typically used for storing
digital configuration data
Overview of Mass Storage

 Magnetic Disks
 Magnetic Tapes
Magnetic disks

 It provide the bulk of secondary storage for


modern computer systems.
 Conceptually, disks are relatively simple
 Each disk platter has a flat circular shape, like a
CD.
 Common platter diameters range from 1.8 to 5.25
inches.
 The two surfaces of a platter are covered with a
magnetic material.
 We store information by recording it magnetically
on the platters.
Moving-head Disk
Mechanism
 The heads are attached to a disk arm that moves
all the heads as a unit.
 The surface of a platter is logically divided into
circular tracks, which are subdivided into sectors.
 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 common disk drives is
measured in gigabytes.
 Disk speed has two parts.
 The transfer rate is the rate at which data flow
between the drive and the computer.
 The Seek time is the time for the disk arm to
move the heads to the cylinder containing the
desired sector.
 Rotational latency is the time for the desired
sector to rotate to the disk head.
Magnetic Tapes

 It used as a medium for transferring information


from one system to another.
 Typically, they store from 20 GB to 200 GB.
 Some have built-in compression that can store
more than the double the effective storage.
 Tapes and their drivers are usually categorized by
width, including 4, 8, and 19 millimeters and 1/4
and 1/2 inch.
Disk Scheduling

 Used for schedule I/O requests arriving for the


disk.
 Disk scheduling is also known as I/O
scheduling.
 Multiple I/O requests may arrive by different
processes and only one I/O request can be served
at a time by the disk controller.
 Thus other I/O requests need to wait in the
waiting queue and need to be scheduled.
Disk Scheduling
Algorithms

 Used for disk scheduling.


 The purpose of disk scheduling algorithms is to
reduce the total seek time.

 Less rotational latency.


 The drive controllers have small buffers and can
manage a queue of I/O requests
 Several algorithms exist to schedule the servicing
of disk I/O requests
 FCFS
 SSTF
 SCAN
 C-SCAN
 LOOK
 C-LOOK
FCFS

 Entertains requests in the order they arrive in the


disk queue.
 It is the simplest disk scheduling algorithm.
Advantages-
 It is simple, easy to understand and implement.
 It does not cause starvation to any request.
Disadvantages-
 It results in increased total seek time.
 It is inefficient.
Ex: FCFS
 Consider a disk queue with requests for I/O to blocks on cylinders
98, 183, 41, 122, 14, 124, 65, 67.
 The head is initially at cylinder number 53.
 The cylinders are numbered from 0 to 199.
 The total head movement (in number of cylinders) incurred while
servicing these requests is _______.
 Total head movements incurred while servicing these
requests

(98 – 53) + (183 – 98) + (183 – 41)


=
+ (122 – 41) + (122 – 14) + (124 –
14) + (124 – 65) + (67 – 65)
=632
SSTF
 Shortest Seek Time First.
 This algorithm services that request next which requires least
number of head movements from its current position regardless of
the direction.
 It breaks the tie in the direction of head movement.
Advantages-
 It reduces the total seek time as compared to FCFS.
 It provides increased throughput.
 It provides less average response time and waiting time.
Disadvantages-
 There is an overhead of finding out the closest request.
 The requests which are far from the head might starve for the CPU.
 It provides high variance in response time and waiting time.
 Switching the direction of head frequently slows down the algorithm.
 Total head movements incurred while servicing
these requests = (65 – 53) + (67 – 65) + (67 – 41)
+ (41 – 14) + (98 – 14) + (122 – 98) + (124 – 122)
+ (183 – 124)
 = 236
 In following sequence-
4, 34, 10, 7, 19, 73, 2, 15, 6, 20
 Currently at cylinder 50, what is the time
taken to satisfy all requests if it takes 1 ms to
move from one cylinder to adjacent one and
shortest seek time first policy is used?

Total head movements incurred while servicing


these requests= (50 – 34) + (34 – 20) + (20 –
19) + (19 – 15) + (15 – 10) + (10 – 7) + (7 – 6)
+ (6 – 4) + (4 – 2) + (73 – 2)
= 119
Time taken for one head movement = 1 msec.
So,
SCAN Disk Scheduling

 Scans all the cylinders of the disk back and


forward.
 Head starts from one end of the disk and move
towards the other end servicing all the requests in
between.
 After reaching the other end, head reverses its
direction and move towards the starting end
servicing all the requests in between.
 The same process repeats.
SCAN

 SCAN Algorithm is also called as Elevator Algorithm.


Advantages-
 It is simple, easy to understand and implement.
 It does not lead to starvation.
 It provides low variance in response time and
waiting time.
Disadvantages-
 It causes long waiting time for the cylinders just
visited by the head.
 It causes the head to move till the end of the disk
even if there are no requests to be serviced.
Ex: SCAN
 98, 183, 41, 122, 14, 124, 65, 67

 Total head movements


incurred while servicing
these requests
= (65 – 53) + (67 – 65) + (98 – 67) +
(122 – 98) + (124 – 122) + (183 –
124) + (199 – 183) + (199 – 41) + (41
– 14) = 331
Alternatively,
 Total head movements incurred
while servicing these requests

= (199 – 53) + (199 – 14)


= 146 + 185
= 331
C-SCAN

 Circular-SCAN is improved version of the SCAN.


 Head starts from one end of the disk and move
towards the other end servicing all the requests in
between.
 After reaching the other end, head reverses its
direction.
 It then returns to the starting end without
servicing any request in between.
 The same process repeats.
Advantages-
 The waiting time for the cylinders just visited by
the head is reduced as compared to the SCAN
Algorithm.
 It provides uniform waiting time.
 It provides better response time.
Disadvantages-
 It causes more seek movements as compared to
SCAN Algorithm.
 It causes the head to move till the end of the disk
even if there are no requests to be serviced.
Ex: C-SCAN
 98, 183, 41, 122, 14, 124, 65, 67

 Total head movements


incurred while servicing
these requests
=(65–53)+(67–65)+(98–67) +(122–
98)+(124–122)+(183 –124)+(199–
183)+(199–0) +(14–0)+(41–14)= 386
 98, 183, 41, 122, 14, 124, 65, 67

 Alternatively,
Total head movements
incurred while servicing
these requests
= (199 – 53) + (199 – 0) +
(41 – 0)
= 146 + 199 + 41= 386
LOOK Scheduling

 LOOK Algorithm is an improved version of the


SCAN Algorithm.
 Head starts from the first request at one end of
the disk and moves towards the last request at
the other end servicing all the requests in
between.
 After reaching the last request at the other end,
head reverses its direction.
 It then returns to the first request at the starting
end servicing all the requests in between.
 The same process repeats.
LOOK Scheduling

Advantages-
 It does not causes the head to move till the ends of the disk
when there are no requests to be serviced.
 It provides better performance as compared to SCAN
Algorithm.
 It does not lead to starvation.
 It provides low variance in response time and waiting time.

Disadvantages-

 There is an overhead of finding the end requests.


 It causes long waiting time for the cylinders just visited by
the head.
Ex: LOOK
 98, 183, 41, 122, 14, 124, 65, 67

 Total head movements


incurred while servicing
these requests=(65 – 53) +
(67 – 65) + (98 – 67) + (122 – 98) +
(124 – 122) + (183 – 124) + (183 –
41) + (41 – 14)= 299
Circular-LOOK Scheduling

 An improved version of the LOOK Algorithm.


 Head starts from the first request at one end of
the disk and moves towards the last request at
the other end servicing all the requests in
between.
 After reaching the last request at the other end,
head reverses its direction.
 It then returns to the first request at the starting
end without servicing any request in between.
 The same process repeats.
C-Look

Advantages-
 It does not causes the head to move till the ends of the
disk when there are no requests to be serviced.
 It reduces the waiting time for the cylinders just visited by
the head.
 It provides better performance as compared to LOOK
Algorithm.
 It does not lead to starvation.
 It provides low variance in response time and waiting time.

Disadvantages-
 There is an overhead of finding the end requests.
Ex:C- LOOK
 98, 183, 41, 122, 14, 124, 65, 67

 Total head movements


incurred while servicing
these requests=(183 –
53) + (183 – 14) + (41 –
14)
= 326
Ex:C- LOOK
 47, 38, 121, 191, 87, 11, 92, 10
 Total head movements
incurred while servicing
these requests=(87–
63)+(92–87)+(121–
92)+(191–121)+(191 –
10)+(11–10)+(38–
11)+(47–38) = 346
SCAN Vs LOOK

 SCAN Algorithm scans all the cylinders of the disk


starting from one end to the other end even if
there are no requests at the ends.

 LOOK Algorithm scans all the cylinders of the disk


starting from the first request at one end to the
last request at the other end.
 SSTF and LOOK will be the most efficient
algorithm.
Ex:
 Consider the following disk request sequence for a
disk with 100 tracks
 45, 21, 67, 90, 4, 89, 52, 61, 87, 25.
 Head pointer starting at 50. Find the number of
head movements in cylinders using all
scheduling.

You might also like