secondary storage structure - · pdf filemagnetic disks provide bulk of secondary storage of...

42
Secondary Storage Structure By: Kaushik Vaghani Prepared By: Kaushik Vaghani

Upload: lehuong

Post on 06-Mar-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Secondary Storage Structure

By: Kaushik Vaghani

Prepared By: Kaushik Vaghani

Page 2: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Secondary-Storage Systems

• Overview of Mass Storage Structure

– Magnetic Disks

– Magnetic Tapes

• Disk Structure

• Disk Scheduling

• RAID Structure

Prepared By: Kaushik Vaghani

Page 3: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Objectives

• Describe the physical structure of secondary and tertiary storage devices and the resulting effects on the uses of the devices

• Explain the performance characteristics of mass-storage devices

• Discuss operating-system services provided for mass storage, including RAID

Prepared By: Kaushik Vaghani

Page 4: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Overview of Mass Storage Structure1. Magnetic disks provide bulk of secondary storage of modern computers

– Drives rotate at 60 to 200 times per second

– Transfer rate is rate at which data flow between drive and computer

– Positioning time (random-access time) is time to move disk arm to desired cylinder (seek time) and time for desired sector to rotate under the disk head (rotational latency)

– Head crash results from disk head making contact with the disk surface

• That’s bad

• Disks can be removable

• Drive attached to computer via I/O bus

– Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel, SCSI

– Host controller in computer uses bus to talk to disk controller built into drive or storage array

Prepared By: Kaushik Vaghani

Page 5: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Prepared By: Kaushik Vaghani

Page 6: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Moving-head Disk Mechanism

Prepared By: Kaushik Vaghani

Page 7: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Overview of Mass Storage Structure (Cont.)

2. Magnetic tape

– Was early secondary-storage medium

– Relatively permanent and holds large quantities of data

– Access time slow

– Random access ~1000 times slower than disk

– Mainly used for backup, storage of infrequently-used data, transfer medium between systems

– Kept in spool and wound or rewound past read-write head

– Once data under head, transfer rates comparable to disk

– 20-200GB typical storage

– Common technologies are 4mm, 8mm, 19mm, LTO-2 and SDLT

Prepared By: Kaushik Vaghani

Page 8: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Overview of Mass Storage Structure (Cont.)

Magnetic tape

Prepared By: Kaushik Vaghani

Page 9: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Disk Structure• Disk drives are addressed as large 1-dimensional arrays

of logical blocks, where the logical block is the smallest unit of transfer

• The 1-dimensional array of logical blocks is mapped into the sectors of the disk sequentially

– Sector 0 is the first sector of the first track on the outermost cylinder

– Mapping proceeds in order through that track, then the rest of the tracks in that cylinder, and then through the rest of the cylinders from outermost to innermost

Prepared By: Kaushik Vaghani

Page 10: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Disk Attachment

• Host-attached storage accessed through I/O ports talking to I/O busses

• SCSI itself is a bus, up to 16 devices on one cable, SCSI initiator requests operation and SCSI targets perform tasks

– Each target can have up to 8 logical units (disks attached to device controller

• FC is high-speed serial architecture

– Can be switched fabric with 24-bit address space – the basis of storage area networks (SANs) in which many hosts attach to many storage units

– Can be arbitrated loop (FC-AL) of 126 devices

Prepared By: Kaushik Vaghani

Page 11: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Network-Attached Storage• Network-attached storage (NAS) is storage made available over a

network rather than over a local connection (such as a bus)

• NFS and CIFS are common protocols

• Implemented via remote procedure calls (RPCs) between host and storage

• New iSCSI protocol uses IP network to carry the SCSI protocol

Prepared By: Kaushik Vaghani

Page 12: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Storage Area Network• Common in large storage environments (and becoming

more common)

• Multiple hosts attached to multiple storage arrays -flexible

Prepared By: Kaushik Vaghani

Page 13: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Disk Scheduling• The operating system is responsible for using hardware

efficiently — for the disk drives, this means having a fast accesstime and disk bandwidth

• Access time has three major components

– Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector

– Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head

– Transmission time is time to transfer information once it is under the head.

• For most disks, the seek time dominates the other two times, so reducing the mean seek time can improve system performance substantially. Prepared By: Kaushik Vaghani

Page 14: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Disk Scheduling (Cont.)• Seek time seek distance

• Disk bandwidth is the total number of bytes transferred, divided bythe total time between the first request for service and thecompletion of the last transfer

Types of disk arm scheduling algorithms:

1. FCSC (First come first serve)

2. SSTF (Shorted seek time first)

3. SCAN (Elevator)

4. C-SCAN

5. LOOK

6. C-LOOKPrepared By: Kaushik Vaghani

Page 15: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Disk Scheduling (Cont.)

• Several algorithms exist to schedule the servicing of disk I/O requests

• We illustrate them with a request queue (0-199)

98, 183, 37, 122, 14, 124, 65, 67

Head pointer 53

Prepared By: Kaushik Vaghani

Page 16: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

FCFS (First come first serve)• Here requests are served in the order of their arrival.

• Illustration shows total head movement of 640 cylinders

• (98-53)+(183-98)+(183-37)+(122-37)+(122-14)+(124-14)+(124-65)+(67-65) = 640 Prepared By: Kaushik Vaghani

Page 17: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

SSTF (Shortest seek time first)• Closest cylinder next Scheduling

• Selects the request with the minimum seek time fromthe current head position

• SSTF scheduling is a form of SJF scheduling; may causestarvation of some requests

• Illustration shows total head movement of 236cylinders

Prepared By: Kaushik Vaghani

Page 18: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

SSTF (Cont.)

• (65-53)+(67-65)+(67-37)+(37-14)+(98-14)+(122-98)+(124-122)+(183-124) = 236 Prepared By: Kaushik Vaghani

Page 19: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

SCAN

• The disk arm starts at one end of the disk, and movestoward the other end, servicing requests until it getsto the other end of the disk, where the headmovement is reversed and servicing continues.

• SCAN algorithm Sometimes called the elevatoralgorithm

• Illustration shows total head movement of 208cylinders

Prepared By: Kaushik Vaghani

Page 20: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

SCAN (Cont.)

Prepared By: Kaushik Vaghani

Page 21: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

C-SCAN

• Circular-SCAN Scheduling

• Provides a more uniform wait time than SCAN

• The head moves from one end of the disk to the other,servicing requests as it goes

– When it reaches the other end, however, itimmediately returns to the beginning of the disk,without servicing any requests on the return trip

• Treats disk as if it were circular with the last trackadjacent to the first one

• Always goes in one directionPrepared By: Kaushik Vaghani

Page 22: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

C-SCAN (Cont.)

Prepared By: Kaushik Vaghani

Page 23: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

LOOK

• Version of SCAN

• Arm only goes as far as the last request in eachdirection, then reverses direction immediately,without first going all the way to the end of thedisk.

• Keep moving in the same direction until there are no more outstanding requests pending in that direction, then algorithm switches the direction.

• After switching the direction the arm will move to handle any request on the way.

Prepared By: Kaushik Vaghani

Page 24: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

LOOK

As per LOOK request will be satisfied in order 11, 12, 16, 34, 36, 9, 1.Total cylinder movement: (12-11) + (16-12) + (34-16) + (36-34) + (36-9) + (9-1)=60

disk with 51 cylinders

Current head position : 111, 36, 16, 34, 9, and 12

Prepared By: Kaushik Vaghani

Page 25: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

C-LOOK

• Version of C-SCAN

• Arm only goes as far as the last request ineach direction, then reverses directionimmediately, without first going all the wayto the end of the disk

Prepared By: Kaushik Vaghani

Page 26: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

C-LOOK (Cont.)

Prepared By: Kaushik Vaghani

Page 27: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Example:

Consider an imaginary disk with 51 cylinders. A request comes in to read ablock on cylinder 11. While the seek to cylinder 11 is in progress, newrequests come in for cylinders 1, 36, 16, 34, 9, and 12, in that order.

Starting from the current head position, what is the total distance (incylinders) that the disk arm moves to satisfy all the pending requests, for eachof the following disk scheduling Algorithms?

1. FCSC (First come first serve)

2. SSTF (Shorted seek time first)

3. SCAN

4. C-SCAN

5. LOOK

6. C-LOOK

Prepared By: Kaushik Vaghani

Page 28: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

FCSC (First come first serve) Scheduling

Here requests are served in the order of their arrival.

In given example disk movement will be 11, 1, 36, 16, 34, 9 and 12 as first come firstserved.

Total cylinder movement: (11-1)+ (36-1)+ (36-16) + (34-16) +(34-9)+(12-9) = 111

cylinders 1, 36, 16, 34, 9, and 12

Prepared By: Kaushik Vaghani

Page 29: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

SSTF (Shortest seek time first)

We can minimize the disk movement by serving the request closest to the currentposition of the head.

In given example starting head position is 11, closest to 11 is 12, closest to 12 is 9, andso on.

As per SSTF request will be satisfied in order 11, 12, 9, 16, 1, 34, 36.

Total cylinder movement: (12-11) + (12-9) + (16-9) + (16-1) + (34-1) + (36-34) = 61

cylinders 1, 36, 16, 34, 9, and 12

Prepared By: Kaushik Vaghani

Page 30: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

LOOK disk arm scheduling

As per LOOK request will be satisfied in order 11, 12, 16, 34, 36, 9, 1.

Total cylinder movement: (12-11) + (16-12) + (34-16) + (36-34) + (36-9) + (9-1)=60

cylinders 1, 36, 16, 34, 9, and 12

Prepared By: Kaushik Vaghani

Page 31: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

C-LOOK

As per CLOOK requests will be satisfied in order 11, 12, 16, 34, 36, 1, 9

Total cylinder movement: (12-11) + (16-12) + (34-16) + (36-34) +(36-1)+(9-1)=68

cylinders 1, 36, 16, 34, 9, and 12

Prepared By: Kaushik Vaghani

Page 32: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

SCAN

As per SCAN request will be satisfied in order: 11, 12, 16, 34, 36, 50, 9, 1

Total cylinder movement: (12-11) + (16-12) + (34-16) +(36-34) +(50-36) + (50-9) + (9-1)= 88

cylinders 1, 36, 16, 34, 9, and 12

Prepared By: Kaushik Vaghani

Page 33: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

CSCAN

As per SCAN request will be satisfied in order: 11, 12, 16, 34, 36, 50, 0, 1,9

Total cylinder movement: (12-11) + (16-12) + (34-16) +(36-34) +(50-36) + (50-0) + (1-0)+(9-1) = 98

cylinders 1, 36, 16, 34, 9, and 12

Prepared By: Kaushik Vaghani

Page 34: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Selecting a Disk-Scheduling Algorithm

• SSTF is common and has a natural appeal

• SCAN and C-SCAN perform better for systems that place a heavyload on the disk

• Performance depends on the number and types of requests

• Requests for disk service can be influenced by the file-allocationmethod

• The disk-scheduling algorithm should be written as a separatemodule of the operating system, allowing it to be replaced witha different algorithm if necessary

• Either SSTF or LOOK is a reasonable choice for the defaultalgorithm

Prepared By: Kaushik Vaghani

Page 35: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

RAID Structure• Disk drives have continued to get smaller and cheaper, so it is

now economically feasible to attach many disks to a computersystem.

• Having a large number of disks in a system presentsopportunities for improving the rate at which data can be reador written, if the disks are operated in parallel.

• Furthermore, this setup offers the potential for improving thereliability of data storage, because redundant information canbe stored on multiple disks. Thus, failure of one disk does notlead to loss of data.

• A variety of disk-organization techniques, collectively calledredundant array of independent disks (RAIDs), are commonlyused to address the performance and reliability issues.Prepared By: Kaushik Vaghani

Page 36: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

RAID Structure• RAID – multiple disk drives provides reliability via

redundancy

• All RAID have the property that the data are distributedover drives, to allow parallel operation.

• RAID is arranged into six different levels

Prepared By: Kaushik Vaghani

Page 37: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

RAID (Cont.)• Several improvements in disk-use techniques involve the use of

multiple disks working cooperatively

• Disk striping uses a group of disks as one storage unit

• RAID schemes improve performance and improve the reliability ofthe storage system by storing redundant data

– Mirroring or shadowing (RAID 1) keeps duplicate of each disk

– Striped mirrors (RAID 1+0) or mirrored stripes (RAID 0+1)provides high performance and high reliability

– Block interleaved parity (RAID 4, 5, 6) uses much lessredundancy

Prepared By: Kaushik Vaghani

Page 38: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

RAID Levels

Prepared By: Kaushik Vaghani

Page 39: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

RAID Levels

Prepared By: Kaushik Vaghani

Page 40: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

RAID Levels

Prepared By: Kaushik Vaghani

Page 41: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

RAID (0 + 1) and (1 + 0)

Prepared By: Kaushik Vaghani

Page 42: Secondary Storage Structure - · PDF fileMagnetic disks provide bulk of secondary storage of modern computers ... Example: Consider an ... of the following disk scheduling Algorithms?

Thank You

Prepared By: Kaushik Vaghani