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.
CS 6560: Operating Systems Design
Disk Scheduling Based on the slides supporting the text 1.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
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
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
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
04/21/2004CSCI 315 Operating Systems Design1 Disk Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Mass-Storage Systems Revised Tao Yang.
Operating Systems COMP 4850/CISG 5550 Disks, Part II Dr. James Money.
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.
1 Lecture 8: Secondary-Storage Structure 2 Disk Architecture Cylinder Track SectorDisk head rpm.
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.
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
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.
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
Chapter 11: File System Implementation
I/O System Chapter 5 Designed by .VAS.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 12: Mass-Storage Structure
I/O Resource Management: Software
Operating System I/O System Monday, August 11, 2008.
Disk Scheduling Algorithms
Mass-Storage Structure
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
Operating Systems (CS 340 D)
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 prepared and instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University January 2017 Mass Storage Structure

Mass Storage Structure Magnetic Disks Magnetic disks is the bulk of secondary storage. There are thousands of concentric cylinders. Each track contains hundreds of sectors. Common disk drives capacity is terabytes. Common drives spin at 5,400, 7,200, 10,000, and 15,000 RPM. Disk speed has two parts: Transfer rate, the rate at which data flow between the drive and the computer. Several MB/Sec. Positioning time, or random-access time, has two parts: January 2017 Mass Storage Structure

Moving-head disk mechanism. January 2017 Mass Storage Structure

Mass Storage Structure Seek time, time to move the disk arm to the desired cylinder, and rotational latency, time of desired sector to rotate to disk head. Several mSec. Disk drive is attached to computer by I/O bus (e.g. serial advanced technology attachment (SATA), universal serial bus (USB)). Host controller is the controller at the computer end of the bus. Disk controller is built into each disk drive. Computer places a command into the host controller, which sends the command via messages to the disk controller, operating the disk-drive. January 2017 Mass Storage Structure

Solid-State Disks (SSD) SSD is nonvolatile memory used like hard drive. More reliable (no moving parts), faster (no seek time or latency) and consume less power. More expensive per MB and shorter life spans. Since SSDs are much faster, hence standard bus interfaces limit throughput. Direct connection to system bus (e.g. PCI) is possible. Can replace disk drives, or used as a new cache between magnetic disks and main memory to optimize performance. January 2017 Mass Storage Structure

Mass Storage Structure Disk Scheduling Access time and bandwidth can be improved by managing order in which disk I/O requests are serviced. A process issues I/O service system call specifying: • Whether it is input or output • Disk address for the transfer • Memory address for the transfer • The number of sectors to be transferred If disk and controller are available, new request is serviced immediately. Otherwise, requests are queued. OS chooses which to service next. January 2017 Mass Storage Structure

Mass Storage Structure FCFS Scheduling Example: Requests for I/O to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, 67, disk head initially at cylinder 53. Total head movement of 640 cylinders. January 2017 Mass Storage Structure

Shortest-Seek-Time-First (SSTF) Scheduling SSTF service requests close to current head position before moving head far away to service other requests. Total head movement to 236 cylinders. January 2017 Mass Storage Structure

Mass Storage Structure SSTF is a form of shortest-job-first (SJF) scheduling, and like SJF may cause starvation. Suppose requests 14 and 186 in queue, and while 14 is being serviced, a new request near 14 arrives. This new will be serviced next, making 186 wait. Continual requests near one another could cause request for cylinder 186 waiting indefinitely. SSTF is not optimal. Moving head from 53 to 37, then to 14, before turning to service 65, 67, 98, 122, 124, and 183, yields total movement of 208 cylinders. January 2017 Mass Storage Structure

Mass Storage Structure SCAN Scheduling SCAN moves the disk arm forth and back from one end toward the other end, servicing requests as it reaches each cylinder. Scheduling requires knowing the direction of head movement in addition to head’s current position. Arm moving toward 0 with head positioned at 53, 98, 183, 37, 122, 14, 124, 65, 67, services 37 and 14, then reversed at 0, servicing 65, 67, 98, 122, 124, 183. Request arriving in the queue just in front of the head is serviced immediately, arriving just behind will wait. January 2017 Mass Storage Structure

Mass Storage Structure January 2017 Mass Storage Structure

Mass Storage Structure Assuming uniform distribution of requests for cylinders, when head reaches one end few requests are just in front. The heaviest density is at the other end of the disk, waited the longest. Circular SCAN (C-SCAN) scheduling is a variant providing more uniform wait time. Commonly the arm does not go to disk ends but only as far as the final request in each direction. Versions of SCAN and C-SCAN are called LOOK and C- LOOK scheduling. January 2017 Mass Storage Structure

Mass Storage Structure January 2017 Mass Storage Structure

Selection of Scheduling Algorithm SSTF is common and has a natural appeal because it increases performance over FCFS. SCAN and C-SCAN perform better for heavy disk load because less likely starvation. Requests for disk service are greatly influenced by file- allocation method. Program reading contiguously allocated file generates close requests, yielding limited head movement. Linked or indexed file may include blocks scattered on the disk, yielding greater head movement. January 2017 Mass Storage Structure

Mass Storage Structure The location of directories and index blocks is also important. Opening file requires searching the directory structure, the directories will be accessed frequently. Caching directories and index blocks in main memory helps reducing arm movement, mostly for read requests. Disk-scheduling algorithm is written as separate OS module, so it can be replaced if necessary. Rotational latency is as large as seek time, but difficult for OS to schedule for improved rotational latency. January 2017 Mass Storage Structure

Mass Storage Structure Manufacturers alleviate the problem by implementing scheduling algorithms in the disk drive controller HW. If the OS sends a batch of requests to the controller, queuing and schedule them to improve seek time and rotational latency. If I/O performance were the only consideration, OS would turn over scheduling responsibility to disk HW. OS however has other service scheduling constraints. Demand paging is prior over application I/O. Writes are prior over reads if memory is running out of free pages. January 2017 Mass Storage Structure

Disk Formatting and Boot Block Before disk can store data, it is divided into sectors, called low-level formatting, so controller can R/W. Low-level formatting fills the disk with a special data structure for each sector, comprising a header, data area (e.g. 512 bytes), and trailer. Header and trailer contain information for controller, such as a sector number and an ECC, calculated and updated at each normal I/O. The controller automatically does the ECC processing whenever a sector is read or written. January 2017 Mass Storage Structure

Mass Storage Structure Low-level formatting is done at factory, enabling test the disk and map from logical block numbers to defect-free sectors on the disk. Formatting with a larger sector size (e.g. 1024 bytes) means fewer sectors can fit on each track, also fewer headers and trailers overhead. Before using the disk to hold files, OS needs to record its own data structures on the disk, done in two steps. First partitions disk into groups of cylinders, treating partitions as separate disks. January 2017 Mass Storage Structure

Mass Storage Structure One partition holds a copy of the OS’s executable code, while another holds user files. Second step is logical formatting, creating of a file system, where OS stores the initial file-system data structures onto the disk. Data structures include maps of free and allocated space and an initial empty directory. The bootstrap program is stored in ROM, which cannot be infected by a computer virus. A problem is that changing this bootstrap code requires changing the ROM hardware chips. January 2017 Mass Storage Structure

Mass Storage Structure Most systems store tiny bootstrap loader program in the boot ROM, bringing in full bootstrap program from disk. A disk that has a boot partition is called a boot disk or system disk. The full bootstrap program loads the entire OS from disk and starts OS running. MS Windows divides hard disk into partitions, one identified as boot partition, containing OS and device drivers. Boot code is placed in the first sector on the hard disk, called master boot record (MBR). January 2017 Mass Storage Structure

Booting from disk in MS Windows. January 2017 Mass Storage Structure

Mass Storage Structure ROM’s boot directs the system to read the boot code from the MBR. MBR contains also a table listing the partitions for the hard disk and a flag indicating which partition the system is to be booted from. Once the system identifies the boot partition, it reads the first sector from that partition (called boot sector). It continues with the remainder of the boot process, which includes loading various subsystems and system services. January 2017 Mass Storage Structure

Swap-Space Management VM uses disk space as an extension of main memory. Swap-space management is low-level OS task, aiming at providing best throughput for VM. Swap space size varies from MBs to GBs, depending on the amount of physical memory, amount of VM it is backing, and the way VM is used. Overestimate is safer than underestimate, running out of swap space forces abort processes and even crash. Linux allows using multiple swap spaces, placed on separate disks, spreading over system’s I/O bandwidth. January 2017 Mass Storage Structure

Mass Storage Structure Swap space is usually a separate raw partition. No file system or directory structure is placed in it. A separate OS swap-space storage manager allocates and deallocates its blocks. It optimizes speed rather than storage efficiency, because swap space is accessed much more frequently than file system. Since swap space is reinitialized at boot time, any fragmentation is short-lived. In Linux each swap area consists of a series of 4-KB page slots, holding swapped pages. January 2017 Mass Storage Structure

Mass Storage Structure Associated with swap area is swap map, integer array, corresponding to page slots in the swap area. 0 indicates the corresponding page slot is available, 𝑐> 0 indicates swapped page is mapped to 𝑐 processes (occurs if page stores memory shared by 𝑐 processes). January 2017 Mass Storage Structure