Mass-Storage Structure

Slides:



Advertisements
Similar presentations
Overview of Mass Storage Structure
Advertisements

Silberschatz, Galvin and Gagne Operating System Concepts Disk Scheduling Disk IO requests are for blocks, by number Block requests come in an.
Chapter 12: Secondary-Storage Structure. Outline n Cover n (Magnetic) Disk Structure n Disk Attachment n Disk Scheduling Algorithms l FCFS,
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
CS 6560: Operating Systems Design
Disk Scheduling Based on the slides supporting the text 1.
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Chapter 12: Mass-Storage Structures
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Mass-Storage Structure
Based on the slides supporting the text
Chapter 12: Secondary-Storage Structure Silberschatz, Galvin and Gagne ©2005 Operating System Principles 12.1 Overview of Mass Storage Structure.
Disks.
1 Disk Scheduling Chapter 14 Based on the slides supporting the text.
Disks CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
12.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 12: Mass-Storage Systems.
Disk and I/O Management
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
1 Operating Systems Part VI: Mass- Storage Structure.
Operating Systems CMPSC 473 I/O Management (4) December 09, Lecture 25 Instructor: Bhuvan Urgaonkar.
Mass-Storage Systems. Objectives  physical structure of secondary and tertiary storage devices  performance characteristics of mass-storage devices.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13+14: I/O Systems and Mass- Storage Structure I/O Hardware Application I/O.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 12: Mass-Storage Systems Overview of Mass.
Page 110/12/2015 CSE 30341: Operating Systems Principles Network-Attached Storage  Network-attached storage (NAS) is storage made available over a network.
Chapter 12: Mass-Storage Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 12: Mass-Storage.
1Fall 2008, Chapter 12 Disk Hardware Arm can move in and out Read / write head can access a ring of data as the disk rotates Disk consists of one or more.
CS 6502 Operating Systems Dr. J.. Garrido Device Management (Lecture 7b) CS5002 Operating Systems Dr. Jose M. Garrido.
CE Operating Systems Lecture 20 Disk I/O. Overview of lecture In this lecture we will look at: Disk Structure Disk Scheduling Disk Management Swap-Space.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 14: Mass-Storage Systems Disk Structure Disk Scheduling Disk Management Swap-Space.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1.  Disk Structure Disk Structure  Disk Scheduling Disk Scheduling  FCFS FCFS  SSTF SSTF  SCAN SCAN  C-SCAN C-SCAN  C-LOOK C-LOOK  Selecting a.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
Chapter 14: Mass-Storage
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
1 Chapter 13 Mass-Storage Structure. 2 Disk Structure Disk drives are addressed as large 1- dimensional arrays of logical blocks, where the logical block.
M ASS S TORAGE S TRUCTURES Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
Mass Storage Structure
Unit V part 2.
Chapter 10: Mass-Storage Systems
Chapter 12: Mass-Storage Systems
Chapter 10: Mass-Storage Systems
Operating System (013022) Dr. H. Iwidat
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Chapter 12: Mass-Storage Structure
Operating System I/O System Monday, August 11, 2008.
Disk Scheduling Algorithms
DISK SCHEDULING FCFS SSTF SCAN/ELEVATOR C-SCAN C-LOOK.
Lecture 45 Syed Mansoor Sarwar
Chapter 10: Mass-Storage Systems
Chapter 14 Based on the slides supporting the text
Chapter 12: Mass-Storage Systems
Overview of Mass Storage Structure
Operating Systems (CS 340 D)
Moving-head Disk Machanism
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Overview Continuation from Monday (File system implementation)
Mass-Storage Systems.
Chapter 12: Mass-Storage Structure
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Chapter 11: Mass-Storage Systems
Mass-Storage Systems (Disk Scheduling)
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

Mass-Storage Structure

Outline Disk Structure Disk Scheduling Disk Management Swap-Space Management RAID Structure Disk Attachment Stable-Storage Implementation Tertiary Storage Devices

Moving-head Disk Machanism

Overview of Mass Storage Structure 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

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  (Cylinder, Track, Sector) In practice, not always possible Defective Sectors # of tracks per cylinders is not a constant

Disk Scheduling

Overview OS is responsible for using hardware efficiently For disk drives  fast access time and disk bandwidth Access time has two major components Seek time is the time for the disk to move the heads to the cylinder containing the desired sector Seek time  seek distance Minimize seek time Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head Difficult for OS 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

Overview (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

Illustration shows total head movement of 640 cylinders. FCFS Illustration shows total head movement of 640 cylinders.

SSTF Shortest-Seek-Time First (SSTF) Selects the request with the minimum seek time from the current head position. SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests. Remember that requests may arrive at any time Not always optimal (how about 53371465…)

SSTF (Cont.) Illustration shows total head movement of 236 cylinders.

SCAN The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues. Sometimes called the elevator algorithm.

SCAN (Cont.) Say Head movement direction is towards 0 Illustration shows total head movement of 236 cylinders.

C-SCAN 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, it immediately returns to the beginning of the disk, without servicing any requests on the return trip. Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.

C-SCAN (Cont.) Say Head movement direction is towards 199

LOOK Scheduling Look Scheduling Similar with Scan scheduling, but the disk arm only goes as far as the final request in each direction For example, a disk queue with requests for I/O to sectors on cylinders

C-LOOK Version of C-SCAN Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.

C-LOOK (Cont.)

Selecting a Disk-Scheduling Algorithm SSTF is common and has a natural appeal SCAN and C-SCAN perform better for systems that place a heavy load on the disk Remove starvation problem Performance relies on the number and types of requests Requests for disk service can be influenced by the file-allocation method (Contiguous? Linked or Indexed?) Directory location and index blocks positions separate module of Disk Scheduling in the operating system, replaceable Either SSTF or LOOK is a reasonable choice for the default algorithm Scheduled by OS? Scheduled by disk controller?

Disk Management

Disk Formatting Low-level formatting, or physical formatting Divide a disk into sectors that the controller can read and write Special data structure for each sector: header – data (usually 512 bytes) – trailer Header and Trailer contains information used by disk controller, such as a sector number and an Error-correcting code (ECC) When the controller writes a sector of data, ECC is updated with a value calculated from all the bytes in the data area When the sector is read, ECC is recalculated and is compared with the stored value  verify the data is correct

Disk Partition To use a disk to hold files, OS still needs to record its own data structures on the disk. it does so in two steps Partition the disk into one or more groups of cylinders Each partition can be treated as a separate disk After partitioning , the second step is: Logical formatting or “making a file system” Store the initial file-system data structure onto the disk: Maps of free and allocated space (FAT or inode) Initial empty directory

A Typical File-System Organization

Boot Block Boot block initializes system Initialize CPU registers, device controllers, main memory Start OS A tiny bootstrap loader is stored in boot ROM Bring a full bootstrap program from disk Full bootstrap program is stored in boot blocks (fixed location) The boot ROM instructs the disk controller to read the boot blocks into memory, and then start executing the code to load the entire OS

MS-DOS Disk Layout

Bad Blocks IDE MS-DOS format : write a special value into the corresponding FAT entry for bad blocks MS-DOS chkdsk : search and lock bad blocks

Bad Blocks – SCSI(Small Computer System Interface) (Cont.) Controller maintains a list of bad blocks on the disk Low-level formatting  spare sectors (OS don’t know) Controller replaces each bad sector logically with one of the spare sectors (sector sparing, or forwarding) Invalidate optimization by OS’s disk scheduling Each cylinder has a few spare sectors

Bad Blocks – SCSI (Cont.) Typical bad-sector transaction OS tries to read logical block 87 Controller calculates ECC and finds that it is bad. Report to OS Reboot next time, a special command is run to tell the controller to replace the bad sector with a spare. Whenever the system requests block 87, it is translated into the replacement sector’s address by the controller Sector slipping: Ex. Let sector 17 defective and first spare follows sector 202 Spare  202  201  … 18  17

Exercise 95, 180, 34, 119, 11, 123, 62, 64 with the Read-write head initially at the track 50 and the tail track being at 199

FCFS Total head movement 640 tracks 95, 180, 34, 119, 11, 123, 62, 64 head initially at the track 50

SSTF Total head movement of 236 tracks 95, 180, 34, 119, 11, 123, 62, 64 head initially at the track 50

SCAN Total head movement of 230 tracks 95, 180, 34, 119, 11, 123, 62, 64 head initially at the track 50

C-SCAN Total head movement for this algorithm is only 187 track 95, 180, 34, 119, 11, 123, 62, 64 head initially at the track 50

C-LOOK Total head movement for this algorithm is 157 tracks 95, 180, 34, 119, 11, 123, 62, 64 head initially at the track 50

Swap-space Management

Swap-Space Use Part of memory used as virtual memory space More swap memory reserved, may waste the memory Less swap space may abort a process In Linux normally swap pace was kept double of the physical memory, but now days it is a topic of debate in Linux community

Swap-Space Location A swap space can reside in one of two locations: As a normal file system easy, but inefficient (time consuming) External fragmentation In a separate disk partition Swap space storage manager is used to allocate and deallocate the memory Designed to improve speed rather storage internal fragmentation Mixed scheme