Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.

Slides:



Advertisements
Similar presentations
Storing Data: Disk Organization and I/O
Advertisements

Chapter 4 : File Systems What is a file system?
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
File Systems.
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
1 Storing Data: Disks and Files Yanlei Diao UMass Amherst Feb 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Lecture 17 I/O Optimization. Disk Organization Tracks: concentric rings around disk surface Sectors: arc of track, minimum unit of transfer Cylinder:
File System Implementation CSCI 444/544 Operating Systems Fall 2008.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
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.
Ceng Operating Systems
1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS Capacity & Cost Secondary Storage.
File System Internals Sunny Gleason COM S 414 November 29, 2001.
1 Outline File Systems Implementation How disks work How to organize data (files) on disks Data structures Placement of files on disk.
Disks.
1 File System Implementations. 2 Overview The Low Level –disks –caching –RAM disks –RAIDs –disk head scheduling The higher level –file systems –directories.
Secondary Storage CSCI 444/544 Operating Systems Fall 2008.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
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
CS 153 Design of Operating Systems Spring 2015 Lecture 20: File Systems.
File Systems (1). Readings r Silbershatz et al: 10.1,10.2,
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
IT 344: Operating Systems Winter 2010 Module 13 Secondary Storage Chia-Chi Teng CTB 265.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
1 Chapter 17 Disk Storage, Basic File Structures, and Hashing Chapter 18 Index Structures for Files.
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.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
OSes: 11. FS Impl. 1 Operating Systems v Objectives –discuss file storage and access on secondary storage (a hard disk) Certificate Program in Software.
Database Management Systems,Shri Prasad Sawant. 1 Storing Data: Disks and Files Unit 1 Mr.Prasad Sawant.
External Storage Primary Storage : Main Memory (RAM). Secondary Storage: Peripheral Devices –Disk Drives –Tape Drives Secondary storage is CHEAP. Secondary.
CS 153 Design of Operating Systems Spring 2015 Lecture 21: File Systems.
File system.
CSE 451: Operating Systems Winter 2015 Module 14 Secondary Storage Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska, Levy,
Chapter 12: Mass-Storage Systems
File Systems Topics Design criteria History of file systems Berkeley Fast File System Effect of file systems on programs fs.ppt CS 105 “Tour of the Black.
CSE 451: Operating Systems Winter 2012 Secondary Storage Mark Zbikowski Gary Kimura.
Lecture Topics: 11/22 HW 7 File systems –block allocation Unix and NT –disk scheduling –file caches –RAID.
File Systems May 12, 2000 Instructor: Gary Kimura.
W4118 Operating Systems Instructor: Junfeng Yang.
CSE 451: Operating Systems Spring 2006 Module 14 From Physical to Logical: File Systems John Zahorjan Allen Center 534.
CSE 451: Operating Systems Spring 2010 Module 12.5 Secondary Storage John Zahorjan Allen Center 534.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 11: File System Implementation.
FileSystems.
Disks and RAID.
Secondary Storage Secondary storage typically: Characteristics:
CS703 - Advanced Operating Systems
Disk Scheduling Algorithms
Mass-Storage Structure
IT 344: Operating Systems Winter 2008 Module 13 Secondary Storage
Lecture 45 Syed Mansoor Sarwar
File Systems Kanwar Gill July 7, 2015.
CSE 451: Operating Systems Winter 2006 Module 13 Secondary Storage
CSE 451: Operating Systems Autumn 2003 Lecture 12 Secondary Storage
CSE 451: Operating Systems Winter 2007 Module 13 Secondary Storage
CSE 451: Operating Systems Spring 2006 Module 13 Secondary Storage
Secondary Storage Management Brian Bershad
CSE 451: Operating Systems Secondary Storage
CSE 451: Operating Systems Winter 2003 Lecture 12 Secondary Storage
CSE 451: Operating Systems Winter 2009 Module 12 Secondary Storage
CSE 451: Operating Systems Spring 2005 Module 13 Secondary Storage
Secondary Storage Management Hank Levy
CSE451 File System Introduction and Disk Drivers Autumn 2002
CSE 451: Operating Systems Autumn 2004 Secondary Storage
CSE 451: Operating Systems Winter 2004 Module 13 Secondary Storage
CSE 451: Operating Systems Spring 2007 Module 11 Secondary Storage
Lecture Topics: 11/20 HW 7 What happens on a memory reference Traps
Presentation transcript:

Secondary Storage Management Hank Levy

8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that does not permit direct instruction execution or data fetch by load/store instructions –it’s large –it’s cheap –it’s non-volatile –it’s slow

The Memory Hierarchy • Memory is arranged as a hierarchy 3 CPU registers, L1 cache L2 cache primary memory disk storage (secondary memory) tape or optical storage (tertiary memory) random access sequential access Each level acts as a cache of data from the level below.

8/7/20154 Physical Disks • The OS must deal with the mess of physical devices: –errors –bad blocks –missed seeks • The job of the OS is to hide this mess from higher levels by: –providing low-level device control –providing higher-level abstractions: files, database,.... • The OS may provide different levels of disk access –physical disk block (surface, cylinder, sector) –disk logical block (disk block #) –file logical (file block, record, or byte #)

8/7/20155 Physical Disk Structure • Disk are made of metal platters with a read/write head flying over it. • To read from disk, we must specify: –cylinder # –surface # –sector # –transfer size –memory address • Transfer time includes: seek, latency, and transfer time ReadWrite heads Platters Spindle Track Sector Seek Time Rot Delay

8/7/20156 Some Typical Numbers • Sector size: 512 bytes • Cylinders per disk (tracks per platter): 6962 • Platters: • Rotational speed: RPM • Storage size: GB • Seek time: ms • Latency: 3 ms • Transfer rate: MB/sec

8/7/20157 Disk Structure • There is no structure to a disk except cylinders and sectors, anything else is up to the OS. • The OS imposes some structure on disks. • Each disk contains: –1. data: e.g., user files –2. meta-data: OS info describing the disk structure • For example, the free list is a data structure indicating which disk blocks are free. It is stored on disk (usually) as a bit map: each bit corresponds to one disk block. • The OS may keep the free list bit map in memory and write it back to disk from time to time.

8/7/20158 Dealing with Mechanical Latencies • Caches »locality in file access • RAM disk »cheap, slow, big memory on the disk. • RAID »parallelism • Clever layouts and scheduling algorithms »head scheduling »meta-information layout

8/7/20159 Meta-Data • How the meta-data is represented is an OS issue, e.g., the free list could be a bit map, or a linked list (each free block points to next one), or something else. • Disk storage (files) can be allocated in different ways: »contiguously on disk –it’s fast and simplifies directory access –it’s inflexible, causes fragmentation, needs compaction »linked structures –each block contains a pointer to the next –good only for sequential access »indexed structures –store index to all blocks in 1 index block –good for random access.

8/7/ Storing Files • Files can be allocated on disk in different ways, e.g.: »1. contiguous allocation –like memory –fast and simplifies directory access –inflexible, causes fragmentation, needs compaction »2. linked structure –each block points to next block, directory points to first –good for sequential access (bad otherwise) »3. indexed structure –an “index block” contains pointers to many other blocks –better for random access –may need multiple index blocks (linked together)

8/7/ Eg, UNIX Inodes • A UNIX Inode is the metainformation for UNIX files. • Contains control and allocation information. • Each inode contains 15 block pointers. »first 11 are direct blocks »then single, double, and triple indirect single indirect double indirect triple indirect indirect blocks 1024 indirect indirect blocks 1024 indirect indirect indirect blocks 4K blockss

8/7/ Disk Scheduling • Because disks are slow and seeks are long and depend on distance, we can schedule disk accesses, e.g.: –FCFS (do nothing) • ok when load is low • long waiting times for long request queue –SSTF (shortest seek time first) • always minimize arm movement. maximize throughput. • favors middle blocks –SCAN (elevator) -- continue in same direction until done, then reverse direction and service in that order –C-SCAN -- like scan, but go back to 0 at end • In general, unless there are request queues, it doesn’t matter • The OS (or database system) may locate files strategically for performance reasons.

8/7/ Bad Blocks • With increasing densities, all disks have some bad blocks, and some go bad as time goes on. • The OS can remove that block from its allocation map. • On some disks, each cylinder contains a set of replacement blocks that the device can remap to replace other “logical” blocks on the same cylinder that are bad.

8/7/ The File System • The file system supports the abstraction of file objects. It supports creation, deletion, access, naming, sharing, and protection. • A file is simply a named collection of data. • The structure and interpretation of that data is typically defined by its creator and unknown to the file system. • In some systems, though, the file type is known to the system, to prevent improper file manipulation.

8/7/ Directories • Directories support file naming and location. • Most systems (like unix) support multi-level directories, where a file name describes its path from a root through the directories to the file at the leaf. • Most systems have a current directory, from which names can be specified relatively, as opposed to absolutely from the root of the directory tree.

Directories • Conceptually, a directory describes the logical information about a file, e.g.: - file name - file type - file size - location on disk - current position of open file - protection - creation and last access time other stuff 13 (this info may or may not be actually stored in the directory)

8/7/ Protection • Files can be protected in different ways: –not at all (open system, single-user system) –protected access: read, write, execute, append, delete –complete access control list: list of users who have (or are denied) access, along with access allowed/denied –simple group schemes: owner, group, everyone

8/7/ Access Methods • Some file systems provide different access methods that specify the data to read in different ways: –sequential access: read bytes one at a time, in order –direct access: random access, given block/byte number –record access: file is array of fixed- or variable-length records, read/written sequentially or randomly by record number –indexed access: file system contains an index to a particular field of each record in a file. reads specify a value for that field, and the system finds the record through the index.