Last Class: File System Abstraction. Protection

Similar documents
Price/performance Modern Memory Hierarchy

Part III Storage Management. Chapter 11: File System Implementation

1 File Management. 1.1 Naming. COMP 242 Class Notes Section 6: File Management

COS 318: Operating Systems. File Layout and Directories. Topics. File System Components. Steps to Open A File

Memory Allocation. Static Allocation. Dynamic Allocation. Memory Management. Dynamic Allocation. Dynamic Storage Allocation

& Data Processing 2. Exercise 2: File Systems. Dipl.-Ing. Bogdan Marin. Universität Duisburg-Essen

Storage in Database Systems. CMPSCI 445 Fall 2010

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

Devices and Device Controllers

File System Management

FAT32 vs. NTFS Jason Capriotti CS384, Section 1 Winter Dr. Barnicki January 28, 2000

Lecture 16: Storage Devices

The Linux Virtual Filesystem

University of Dublin Trinity College. Storage Hardware.

Record Storage and Primary File Organization

Chapter 12 File Management

Chapter 11: File System Implementation. Chapter 11: File System Implementation. Objectives. File-System Structure

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer.

Topics in Computer System Performance and Reliability: Storage Systems!

Filing Systems. Filing Systems

Secondary Storage. Any modern computer system will incorporate (at least) two levels of storage: magnetic disk/optical devices/tape systems

Chapter 12 File Management

Chapter 12 File Management. Roadmap

File-System Implementation

Operating System Concepts. Operating System 資 訊 工 程 學 系 袁 賢 銘 老 師

Solid State Drive Architecture

Physical Data Organization

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Robert Wagner

Sistemas Operativos: Input/Output Disks

I/O Management. General Computer Architecture. Goals for I/O. Levels of I/O. Naming. I/O Management. COMP755 Advanced Operating Systems 1

Storage and File Systems. Chester Rebeiro IIT Madras

Operating Systems CSE 410, Spring File Management. Stephen Wagner Michigan State University

COS 318: Operating Systems. Storage Devices. Kai Li Computer Science Department Princeton University. (

Quiz for Chapter 6 Storage and Other I/O Topics 3.10

Types Of Storage Device

System Architecture. CS143: Disks and Files. Magnetic disk vs SSD. Structure of a Platter CPU. Disk Controller...

COS 318: Operating Systems. Storage Devices. Kai Li and Andy Bavier Computer Science Department Princeton University

Prof. Dr. Ing. Axel Hunger Dipl.-Ing. Bogdan Marin. Operation Systems and Computer Networks Betriebssysteme und Computer Netzwerke

Platter. Track. Index Mark. Disk Storage. PHY 406F - Microprocessor Interfacing Techniques

Chapter 12: Secondary-Storage Structure

Chapter 9: Peripheral Devices: Magnetic Disks

Introduction to I/O and Disk Management

Storing Data: Disks and Files. Disks and Files. Why Not Store Everything in Main Memory? Chapter 7

William Stallings Computer Organization and Architecture 7 th Edition. Chapter 6 External Memory

Two Parts. Filesystem Interface. Filesystem design. Interface the user sees. Implementing the interface

Chapter 10: Mass-Storage Systems

William Stallings Computer Organization and Architecture 8 th Edition. External Memory

Chapter 11: File System Implementation. Operating System Concepts with Java 8 th Edition

Chapter 11: File System Implementation. Operating System Concepts 8 th Edition

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 13-1

File System & Device Drive. Overview of Mass Storage Structure. Moving head Disk Mechanism. HDD Pictures 11/13/2014. CS341: Operating System

TELE 301 Lecture 7: Linux/Unix file

Maximizing VMware ESX Performance Through Defragmentation of Guest Systems. Presented by

Chapter 13 Disk Storage, Basic File Structures, and Hashing.

Chapter 8: Structures for Files. Truong Quynh Chi Spring- 2013

INTRODUCTION The collection of data that makes up a computerized database must be stored physically on some computer storage medium.

OPERATING SYSTEMS FILE SYSTEMS

Lesson Plan. Preparation

Communicating with devices

CS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen

CS 153 Design of Operating Systems Spring 2015

Outline. CS 245: Database System Principles. Notes 02: Hardware. Hardware DBMS Data Storage

File Systems Management and Examples

CHAPTER 17: File Management

Disk Geometry: How Data is Organized on a Hard Disk Drive

Agenda. Enterprise Application Performance Factors. Current form of Enterprise Applications. Factors to Application Performance.

Outline. mass storage hash functions. logical key values nested tables. storing information between executions using DBM files

Chapter 13. Disk Storage, Basic File Structures, and Hashing

Operating Systems CS-384. File Systems. NTFS and FAT32. Submitted To: Dr. Chris Taylor. Submitted By: Aditya Sitani

Storing Data: Disks and Files

The Classical Architecture. Storage 1 / 36

Mass Storage Structure

Data Storage and Backup. Sanjay Goel School of Business University at Albany, SUNY

1. Computer System Structure and Components

Chapter 12: Mass-Storage Systems

Chapter 13. Chapter Outline. Disk Storage, Basic File Structures, and Hashing

Chapter 11 I/O Management and Disk Scheduling

Operating Systems, 6 th ed. Test Bank Chapter 7

COSC 6374 Parallel Computation. Parallel I/O (I) I/O basics. Concept of a clusters

Overview of I/O Performance and RAID in an RDBMS Environment. By: Edward Whalen Performance Tuning Corporation

COSC 6374 Parallel Computation. Parallel I/O (I) I/O basics. Concept of a clusters

CS5460: Operating Systems

Chapter 3 Operating-System Structures

Incident Response and Computer Forensics

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Computer-System Architecture

CSCA0102 IT & Business Applications. Foundation in Business Information Technology School of Engineering & Computing Sciences FTMS College Global

Distributed File Systems

How A V3 Appliance Employs Superior VDI Architecture to Reduce Latency and Increase Performance

1 Storage Devices Summary

Chapter 11 I/O Management and Disk Scheduling

Writing Assignment #2 due Today (5:00pm) - Post on your CSC101 webpage - Ask if you have questions! Lab #2 Today. Quiz #1 Tomorrow (Lectures 1-7)

OPERATING SYSTEM - MEMORY MANAGEMENT

Case for storage. Outline. Magnetic disks. CS2410: Computer Architecture. Storage systems. Sangyeun Cho

Data Storage - I: Memory Hierarchies & Disks

OPTIMIZING VIRTUAL TAPE PERFORMANCE: IMPROVING EFFICIENCY WITH DISK STORAGE SYSTEMS

Memory management basics (1) Requirements (1) Objectives. Operating Systems Part of E1.9 - Principles of Computers and Software Engineering

Data Storage Solutions

Transcription:

Last Class: File System Abstraction Naming Protection Persistence Fast access Lecture 17, page 1 Protection The OS must allow users to control sharing of their files => control access to files Grant or deny access to file operations depending on protection information Access lists and groups (Windows NT) Keep an access list for each file with user name and type of access Lists can become large and tedious to maintain Access control bits (UNIX) Three categories of users (owner, group, world) Three types of access privileges (read, write, execute) Maintain a bit for each combination (111101000 = rwxr-x---) Lecture 16, page 2

Today: File System Implementation Disk management Brief review of how disks work. How to organize data on disks. Lecture 17, page 3 How Disks Work The disk surface is circular and is coated with a magnetic material. The disk is always spinning (like a CD). Tracks are concentric rings on disk with bits laid out serially on tracks. Each track is split into sectors or blocks, the minimum unit of transfer from the disk. Lecture 16, page 4

How Disks Work CDs come individually, but disks come organized in disk pack consisting of a stack of platters. Disk packs use both sides of the platters, except on the ends. Comb has 2 read/write head assemblies at the end of each arm. Cylinders are matching sectors on each surface. Disk operations are in terms of radial coordinates. Move arm to correct track, waiting for the disk to rotate under the head. Select and transfer the correct sector as it spins by Lecture 17, page 5 Disk Overheads Overhead: time the CPU takes to start a disk operation Positioning time: the time to initiate a disk transfer of 1 byte to memory. Seek time: time to position the head over the correct cylinder Rotational time: the time for the correct sector to rotate under the head Transfer rate: once a transfer is initiated, the rate of I/O transfer (bandwidth) Lecture 16, page 6

File Organization on Disk The information we need: fileid 0, Block 0 Platter 0, cylinder 0, sector 0 fileid 0, Block 1 Platter 4, cylinder 3, sector 8... Key performance issues: 1. We need to support sequential and random access. 2. What is the right data structure in which to maintain file location information? 3. How do we lay out the files on the physical disk? Lecture 17, page 7 File Organization: On-Disk Data Structures The structure used to describe where the file is on the disk and the attributes of the file is the file descriptor (FileDesc). File descriptors have to be stored on disks just like files. Most systems fit the following profile: 1. Most files are small. 2. Most disk space is taken up by large files. 3. I/O operations target both small and large files. => The per-file cost must be low, but large files must also have good performance. Lecture 17, page 8

Contiguous Allocation OS maintains an ordered list of free disk blocks OS allocates a contiguous chunk of free blocks when it creates a file. Need to store only the start location and size in the file descriptor Advantages Simple Access time? Number of seeks? (sequential and random access) Disadvantages Changing file sizes Fragmentation? Disk management? Examples: IBM OS/360, write-once disks, early personal computers Lecture 17, page 9 Linked files Keep a list of all the free sectors/blocks. In the file descriptor, keep a pointer to the first sector/block. In each sector, keep a pointer to the next sector. Lecture 17, page 10

Linked files Advantages: Fragmentation? File size changes? Efficiently supports which type of access? Disadvantages: Does not support which type of access? Why? Number of seeks? Examples: FAT, MS-DOS Lecture 17, page 11 Indexed files OS keeps an array of block pointers for each file. The user or OS must declare the maximum length of the file when it is created. OS allocates an array to hold the pointers to all the blocks when it creates the file, but allocates the blocks only on demand. OS fills in the pointers as it allocates blocks. Lecture 17, page 12

Indexed files Advantages Not much wasted space for files Both sequential and random accesses are easy. Disadvantages Wasted space in file descriptors Sets a maximum file size Lots of seeks because data is not contiguous. Lecture 17, page 13 Multilevel indexed files Each file descriptor contains (for example) 14 block pointers. First 12 pointers point to data blocks. 13 th pointer points to a block of 1024 pointers to 1024 more data blocks. (One indirection) 14 th pointer points to a block of pointers to indirect blocks. (Two indirections) Lecture 17, page 14

Multilevel indexed files Advantages Supports incremental file growth Small files? Disadvantages Indirect access is inefficient for random access to very large files. Lots of seeks because data is not contiguous. What could the OS do to get more contiguous access and fewer seeks? Examples: BSD Unix 4.3 Lecture 17, page 15 Free-Space Management Need a free-space list to keep track of which disk blocks are free (just as we need a free-space list for main memory) Need to be able to find free space quickly and release space quickly => use a bitmap The bitmap has one bit for each block on the disk. If the bit is 1, the block is free. If the bit is 0, the block is allocated. Can quickly determine if any page in the next 32 is free, by comparing the word to 0. If it is 0, all the pages are in use. Otherwise, you can use bit operations to find an empty block. 110000100100011111110... Marking a block as freed is simple since the block number can be used to index into the bitmap to set a single bit. Lecture 17, page 16

Free-Space Management Problem: Bitmap might be too big to keep in memory for a large disk. A 2 TB disk with 512 byte sectors requires a bitmap with 4,000,000,000 entries (500,000,000 bytes = 500 MB). If most of the disk is in use, it will be expensive to find free blocks with a bitmap. An alternative implementation is to link together the free blocks. The head of the list is cached in kernel memory. Each block contains a pointer to the next free block. How expensive is it to allocate a block? How expensive is it to free a block? How expensive is it to allocate consecutive blocks? Lecture 17, page 17 Summary Many of the concerns and implementations of file system implementations are similar to those of virtual memory implementations. Contiguous allocation is simple, but suffers from external fragmentation, the need for compaction, and the need to move files as they grow. Indexed allocation is very similar to page tables. A table maps from logical file blocks to physical disk blocks. Free space can be managed using a bitmap or a linked list. Lecture 17, page 18