Chapter 9: File System Interface

Similar documents
CS3600 SYSTEMS AND NETWORKS

Part Four - Storage Management. Chapter 10: File-System Interface

Chapter 10: File-System Interface

Chapter 10: File-System Interface

Chapter 11: File-System Interface

Chapter 10: File-System Interface. Operating System Concepts with Java 8 th Edition

Chapter 7: File-System

Chapter 10: File-System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing Protection

Chapter 10: File-System Interface

Lecture 10 File Systems - Interface (chapter 10)

Chapter 10: File System

Chapter 6 Storage Management File-System Interface 11.1

Chapter 10: File-System Interface. Operating System Concepts 8 th Edition

Chapter 11: File-System Interface. File Concept. File Structure

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 10: FILE SYSTEM

Chapter 11: File-System Interface

Chapter 11: File-System Interface

Chapter 10: File System. Operating System Concepts 9 th Edition

Chapter 11: File-System Interface

UNIT V SECONDARY STORAGE MANAGEMENT

CS720 - Operating Systems

Chapter 11: File-System Interface

Virtual Memory cont d.; File System Interface. 03/30/2007 CSCI 315 Operating Systems Design 1

Chapter 11: File-System Interface. File Concept. File Structure

Chapter 11: File-System Interface. Long-term Information Storage. File Structure. File Structure. File Concept. File Attributes

Chapter 11: File-System Interface. Operating System Concepts 9 th Edition

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Chapter 11: File System Interface Capítulo 10 no livro adotado!

File Systems: Interface and Implementation

File Systems: Interface and Implementation

File Systems: Interface and Implementation

F 4. Both the directory structure and the files reside on disk Backups of these two structures are kept on tapes

File-System Interface. File Structure. File Concept. File Concept Access Methods Directory Structure File-System Mounting File Sharing Protection

File-System Interface

CMSC421: Principles of Operating Systems

Chapter 11: File System Interface

File System: Interface and Implmentation

File Concept Access Methods Directory and Disk Structure File-System Mounting File Sharing Protection

CSE325 Principles of Operating Systems. File Systems. David P. Duggan. March 21, 2013

File-System. File Concept. File Types Name, Extension. File Attributes. File Operations. Access Methods. CS307 Operating Systems

Operating System: Chap10 File System Interface. National Tsing-Hua University 2016, Fall Semester

DATA STRUCTURES USING C

ICS Principles of Operating Systems

Principles of Operating Systems

V. File System. SGG9: chapter 11. Files, directories, sharing FS layers, partitions, allocations, free space. TDIU11: Operating Systems

A file system is a clearly-defined method that the computer's operating system uses to store, catalog, and retrieve files.

Chapter 11: File-System Interface

Modulo V Sistema de Arquivos

There is a general need for long-term and shared data storage: Files meet these requirements The file manager or file system within the OS

File System Interface: Overview. Objective. File Concept UNIT-IV FILE SYSTEMS

Files and File Systems

File Management By : Kaushik Vaghani

Storage, part 1. Michael Brockway. November 3, 2015

Operating Systems. No. 9 ศร ณย อ นทโกส ม Sarun Intakosum

CMSC421: Principles of Operating Systems

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

File System (FS) Highlights

File Systems. CS170 Fall 2018

MODULE 4. FILE SYSTEM AND SECONDARY STORAGE

File Systems. CS 4410 Operating Systems

Chapter 11: File System Implementation. Objectives

Outlook. File-System Interface Allocation-Methods Free Space Management

Operating Systems: Lecture 12. File-System Interface and Implementation

File System Definition: file. File management: File attributes: Name: Type: Location: Size: Protection: Time, date and user identification:

File System & Device Drive Mass Storage. File Attributes (Meta Data) File Operations. Directory Structure. Operations Performed on Directory

TDDB68 Concurrent Programming and Operating Systems. Lecture: File systems

Advanced Operating Systems. File Systems Lecture 9

File System Management

Sharing may be done through a protection scheme. Network File System (NFS) is a common distributed file-sharing method

CHAPTER 10 AND 11 - FILE SYSTEM & IMPLEMENTING FILE- SYSTEMS

General Objective:To understand the file system management. Specific Objectives: At the end of the unit you should be able to:

CS370 Operating Systems

ELEC 377 Operating Systems. Week 8 Class 1

CS3600 SYSTEMS AND NETWORKS

File System Interface and Implementation

Introduction. Secondary Storage. File concept. File attributes

Secondary Storage (Chp. 5.4 disk hardware, Chp. 6 File Systems, Tanenbaum)

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

Files & I/O. Today. Comp 104: Operating Systems Concepts. Operating System An Abstract View. Files and Filestore Allocation

File System Interface. ICS332 Operating Systems

File System File Concept File Structure File Attributes Name Identifier Type Location Size Protection Time, date, and user identification

CSC 453 Operating Systems

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Operating System 1 (ECS-501)

FILE SYSTEMS. Tanzir Ahmed CSCE 313 Fall 2018

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

Long-term Information Storage Must store large amounts of data Information stored must survive the termination of the process using it Multiple proces

OPERATING SYSTEM. Chapter 12: File System Implementation

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Thanks for the feedback! Chapter 8: Filesystem Implementation. File system operations. Acyclic-Graph Directories. General Graph Directory

Chapter 11: Implementing File Systems

UNIT IV: FILE SYSTEMS PART A

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS)

CS370 Operating Systems

Directory Structure and File Allocation Methods

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Chapter 11: Implementing File

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files!

File System. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Transcription:

Chapter 9: File System Interface

File System Interface File Concept Computers store information on different [physical] media Flash Drives, Magnetic disk, Optical Disks, Magnetic Tapes OS provides a uniform view of stored info [for convenience] How? DOS directory, Windows directory, UNIX directory The OS takes an abstraction of the physical storage media & defines a logical storage unit: File Files are held in persistent storage on the physical device Sequence of bits, bytes, lines or records The OS maps the File to the Physical device A logical representation of how files are stored on the physical device Mapping varies from one OS to another File is an abstraction - To define the file, we need to examine/agree on some basic characteristics; - Attributes, Structure, Operations on File, Types, etc Operating Systems CS 33211 2

File Concept Common File Attributes File Attributes are dependent on the OS Name Symbolic file name is only information kept in human-readable form Identifier unique tag (number) identifies file within file system Used to locates the trailing file attributes Type needed for systems that support different types of files Location pointer to file location on device Size current file size Protection controls who can do reading, writing, executing Time, date, and user identification data for protection, security, and usage monitoring Information about files are kept in the directory structure, which is maintained on the disk Structure specifies entries for the name and identifier Operating Systems CS 33211 3

File Concept File Operations OS provides system calls to perform Basic Operations: Create Write Read Reposition within file (seek) Reposition to current file position pointer to a given value Delete Truncate Attributes are unchanged Open(F i ) search the directory structure on disk for entry F i, and move the content of entry to memory Updates a small table of open files; open-file-table Minimizes overhead of searching entire file system Close (F i ) move the content of entry F i in memory to directory structure on disk Remove entry from open-file-table Operating Systems CS 33211 4

File Concept File Type & File Structure Common File Types File Types OS may need to recognize file types To operate on files correctly Try printing a binary file type File Type Specs: Include file type as an extension of file name resume.doc, myprog.c The OS uses the extensions to indicate to user the type of file and valid operations on the file File Structure OS may require files to conform to structure understood by the OS File extensions provide an indication of the internal structure of the file Operating Systems CS 33211 5

Access Methods Sequential Access Information stored in the file is processed serially: one record at a time: Read Operation (read next) reads next portion of file and advances the file pointer Write Operation (write next) appends to end of file (eof) and advances file pointer to the new eof File Pointer tracks I/O location Allows File to be reset at the beginning Operating Systems CS 33211 6

Access Methods Direct Access Information stored in file is processed in any random order File is viewed as a numbered sequence of blocks (1, 2, 10,11,12..) Read Operation (read 12) reads block 12 Write Operation (write 10) write to block 10 Designed for access to large amounts of data items Database query Direct Access: Alternatively: read n write n position to n read next write next n = relative block number to start of file Operating Systems CS 33211 7

Access Methods Simulation of Sequential Access on a Direct Access File Define Variable cp that holds current position (cp) of file pointer Increment cp by 1 after each read/write operation Operating Systems CS 33211 8

File System Interface Directory Structure File Systems may contain info up to a million terabytes and more on a disk Directory Structure is scheme to manage the file systems A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Operating Systems CS 33211 9

File-System: Directory Storage Structure File-systems are stored on a disk (storage) Partitions: Multiple file-systems on different parts of a disk Volume: Combinations of partitions to form a larger structure Operating Systems CS 33211 10

DirectoryStructure Operations Let s examine typical operations performed on directories ( Use Case Scenarios ) Search for a file Search for files using pattern matching of names Create a file Delete a file List a directory Rename a file Traverse the file system Operating Systems CS 33211 11

Directory Structure Single-Level Directory All files are in the same directory Limitations: File names must be unique Difficult to remember file names in a large file system Grouping problem Different users may encounter Name Collision Problem Create different dir for each user Operating Systems CS 33211 12

Directory Structure Two-Level Directory Each user has a User File Dir (UFD) UFDs have similar structure MFD contains the list of UFDs UFDs spawned at start-up via MFD Searches are local to UFDs Resolves name-collision problem Limitations: Users cannot cooperate across directories Access permission across Dir requires designation of full path names of files Grouping-problem not resolved Operating Systems CS 33211 13

Directory Structure Tree-structure Directories Generalization of Two-level Dir Resolves grouping Users can create subdirectories. mkdir < dir-name> rm <file name> Efficient searching Tree has root dir Unique path name for files Operating Systems CS 33211 14

Directory Structure Acyclic-Graph Directories Share Files and Share subdirectories Directory exist in two or more places at the same time new directory (link) is created in each user dir. Link then points to the sub dir or file More flexible than simple tree-structure Operating Systems CS 33211 15

Directory Structure Acyclic-Graph Directories Two different names (aliasing) If dict deletes list dangling pointer Solutions: Backpointers, so we can delete all pointers Variable size records a problem Backpointers using a daisy chain organization Entry-hold-count solution New directory entry type Link another name (pointer) to an existing file Resolve the link follow pointer to locate the file Operating Systems CS 33211 16

File System Mounting A file system must be mounted before it can be accessed Directory structure must be mounted to make them available within the File system To mount a File system, OS needs: Device name Location within existing file structure where file system is to be mounted (mount point): E.g., /home /usr /bin Given a file system /jane the dir structure is /home/jane /usr/jane /bin/jane if mounted under /home if mounted under /usr if mounted under /bin Operating Systems CS 33211 17

File System Mounting a) Existing File system structure With Mount Points: users, bill, fred and help b) Unmounted Partition resides on a media device (disk) Currently, only files in existing file system structure (a) can be accessed Operating Systems CS 33211 18

Mount Point Mount Location within existing file structure is: /users Now files in directory: sue, jane, prog and doc can be accessed Operating Systems CS 33211 19

File Sharing In Multi-User Systems Files may be shared by users OS mediates file sharing Sharing may be done through a protection scheme OS maintains additional file/directory attributes: Owner ID Group ID On distributed systems, files may be shared across a network ftp: anonymous and authenticated file exchange www: anonymous file exchange for the most part Network File System (NFS) is a common distributed file-sharing method Operating Systems CS 33211 20

File Sharing Additional File/Directory Attributes User IDs identify users, allowing permissions and protections to be per-user Group IDs allow users to be in groups, permitting group access rights Operating Systems CS 33211 21

File Sharing Remote File Systems Uses networking to allow file system access between systems Manually via programs like FTP Automatically, seamlessly using distributed file systems Semi automatically via the world wide web Client-server model allows clients to mount remote file systems from servers Server is machine containing the files: can serve multiple clients Client is machine seeking access to the files User-on-client identification is insecure or complicated IP address (can be spoofed) Encrypted keys for added security NFS is standard UNIX client-server file sharing protocol: User Id maintained on Client and Server must match Operating Systems CS 33211 22

Remote File Systems Sharing cont Distributed Information Systems: Provide unified access to remote computing DNS: Host name to IP address NIS: yellow pages concept - centralized repository for user attributes: E.g., User name + printer access on network + Failure Modes Remote file systems add new failure modes, due to network failure, server failure Recovery from failure can involve state information about status of each remote request Client and Server maintain knowledge of current activities and open files (states) Stateless protocols such as NFS include all information in each request, allowing easy recovery but less security Operating Systems CS 33211 23

Protection Mulituser File Systems We need Controlled Access to the File System File owner/creator should be able to control: what can be done by whom Types of common (primitive) access control Read - Read from file Write - Write or re-write the file Execute - Load file into memory and execute Append - Write new information at end of file Delete - Delete file and free its pace List - List names and file attributes How does the OS enforce control for: copying and renaming a file? Operating Systems CS 33211 24

Protection Common Solution to Protecting File/Directory Systems: Associate each file/directory with an Access-Control List (ACL) UID + Types/Mode of allowed access OS uses ACL to process user requests Challenge: Different users may have different types of access Difficult to construct a comprehensive list of access without prior knowledge of user needs Adopting Variable directory entry poses complex challenges Adopt a condensed ACL Owner: File owner Group: Set of user that share the file and require similar access as owner Universe Other users Operating Systems CS 33211 25

Access Lists and Groups UNIX File-system Mode of access: read, write, execute Three classes of users RWX a) owner access 7 1 1 1 RWX b) group access 6 1 1 0 RWX c) public access 1 0 0 1 Ask manager to create a group (unique name), say G, and add some users to the group. For a particular file (say game) or subdirectory, define an appropriate access. owner group public chmod 761 game Attach a group (G) to a file: chgrp G game Operating Systems CS 33211 26

A Sample UNIX Directory Listing Operating Systems CS 33211 27

File-system Interface Let s summarize The major task for OS is to map logical file concept onto physical storage device (magnetic tape, disks) Each device maintains a directory List of locations on device Single-level directory causes naming collision problems for multiple users Two-level directory structure resolve naming collision, but introduces exclusivity Tree-structured directory allows users to create subdirectories Acyclic allows users to share files and directory, but searching and deletion gets complicated File protection can be provided by password, ACL Controlled access for read, write, execute (common attributes) Combination of common and optional parameters (recent approach) Operating Systems CS 33211 28