Secondary Storage Management Hank Levy

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.
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.
1 Storing Data: Disks and Files Yanlei Diao UMass Amherst Feb 15, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Disk Drivers May 10, 2000 Instructor: Gary Kimura.
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.
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.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
Introduction to Database Systems 1 The Storage Hierarchy and Magnetic Disks Storage Technology: Topic 1.
Disk and I/O Management
CS 153 Design of Operating Systems Spring 2015 Lecture 20: File Systems.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
IT 344: Operating Systems Winter 2010 Module 13 Secondary Storage Chia-Chi Teng CTB 265.
1 Chapter 17 Disk Storage, Basic File Structures, and Hashing Chapter 18 Index Structures for Files.
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.
CSE 451: Operating Systems Winter 2012 Secondary Storage Mark Zbikowski Gary Kimura.
File Systems May 12, 2000 Instructor: Gary Kimura.
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.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Disks and Files.
Chapter 10: Mass-Storage Systems
CSE451 More File Systems Autumn 2002
Operating System (013022) Dr. H. Iwidat
Lecture 16: Data Storage Wednesday, November 6, 2006.
FileSystems.
Disks and RAID.
Database Management Systems (CS 564)
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
OPERATING SYSTEMS CS 3502 Fall 2017
Secondary Storage Secondary storage typically: Characteristics:
CS703 - Advanced Operating Systems
Oracle SQL*Loader
Operating System I/O System Monday, August 11, 2008.
Filesystems.
Disk Scheduling Algorithms
Mass-Storage Structure
IT 344: Operating Systems Winter 2008 Module 13 Secondary Storage
Lecture 45 Syed Mansoor Sarwar
Lecture 11: DMBS Internals
Chapter 11: File System Implementation
File Systems Kanwar Gill July 7, 2015.
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
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
Persistence: hard disk drive
CSE 451: Operating Systems Secondary Storage
File Storage and Indexing
File Storage and Indexing
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
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 2006 Module 14 From Physical to Logical: File Systems John Zahorjan Allen Center
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

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 CPU registers, L1 cache Each level acts as a cache of data from the level below. L2 cache primary memory disk storage (secondary memory) random access 3 tape or optical storage (tertiary memory) sequential access

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 #)

Physical Disk Structure ReadWrite heads 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 Platters Spindle Track Sector Rot Delay Seek Time

Some Typical Numbers Sector size: 512 bytes Cylinders per disk (tracks per platter): 6962 Platters: 3 - 12 Rotational speed: 10000 RPM Storage size: 4 - 18 GB Seek time: 5 - 12 ms Latency: 3 ms Transfer rate: 14 - 20 MB/sec

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.

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

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.

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)

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 .. 4K blockss 12 13 14 single indirect double indirect triple indirect 1024 indirect blocks 1024 indirect indirect blocks 1024 indirect indirect indirect blocks

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.

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.

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.

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 (this info may or may not be actually stored in the directory) 13

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

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.