Chapter 11: File-System Interface

Slides:



Advertisements
Similar presentations
File-System Interface
Advertisements

Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface Chapter Outline File Concept Access Methods Directory.
Chapter 10: File-System Interface
1 Chapter 11: File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection  Chapter.
Chapter 10: File-System Interface
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Chapter 10: File-System Interface
File System Interface CSCI 444/544 Operating Systems Fall 2008.
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
1 File Management (a). 2 File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection.
04/02/2004CSCI 315 Operating Systems Design1 File System Interface.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File-System Interface.
04/05/2010CSCI 315 Operating Systems Design1 Virtual Memory Wrap-up; File System Interface.
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
Chapter 10: File-System Interface
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 10: File-System Objectives To discuss file-system design tradeoffs, including.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
A. Frank - P. Weisberg Operating Systems File-System Interface.
File Concept l Contiguous logical address space l Types: Data: numeric, character, binary Program: source, object (load image) Documents.
Os111 Chapter 11 File-System Interface. os112 Outline File Concept Access Methods Directory Structure File System Mounting File Sharing Protection.
03/30/2007CSCI 315 Operating Systems Design1 Virtual Memory cont’d.; File System Interface.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
Chapter 10 File System Interface
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 10: File-System Interface.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 10 Operating Systems.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 10-1: File Systems Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Silberschatz, Galvin and Gagne  Operating System Concepts File Concept Contiguous logical address space Smallest user allocation Non-volatile.
Chap 10 File-System Interface. Objectives To explain the function of file systems To describe the interfaces to file systems To discuss file-system design.
11.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure File-System.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
Chapter 10: File-System Interface 10.1 Silberschatz, Galvin and Gagne ©2011 Operating System Concepts – 8 th Edition 2014.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Page 110/19/2015 CSE 30341: Operating Systems Principles Chapter 10: File-System Interface  Objectives:  To explain the function of file systems  To.
File-System. Overview File system is the visible aspect of an OS. It provides mechanism for on-line storage of and access to both data and programs of.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 11: File-System Interface Modified.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
10.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 10: File-System Interface.
Module 4.0: File Systems File is a contiguous logical address space.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 11: File-System Interface File Concept Access Methods Directory Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 18: File-System Interface (Ch 10)
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
Silberschatz and Galvin  Operating System Concepts Module 10: File-System Interface File Concept Access :Methods Directory Structure Protection.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
Access Methods File store information When it is used it is accessed & read into memory Some systems provide only one access method IBM support many access.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems File System Interface.
CSE Operating System Principles File Systems.
Lecture : chapter 9 and 10 file system 1. File Concept A file is a collection of related information defined by its creator. Contiguous logical address.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 10: File-System 10.1 File Concept 10.2 Access Methods 10.3 Directory Structure.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
File System Interface CSSE 332 Operating Systems
Chapter 13: File-System Interface
Module 10: File-System Interface
Chapter 11: File-System Interface
Chapter 10: File-System Interface
Directory Structure A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Both the directory structure and the.
Chapter 10: File-System Interface
Module 10: File-System Interface
Lecture 4: File-System Interface
Presentation transcript:

Chapter 11: File-System Interface File Concept Access Methods Directory Structure File System Mounting File Sharing Protection Annotated for use with Silberschatz’s book used during CS350, Fall 03 Instructor's annotation in Blue Last updated 4/25/03, 11/30/03 Operating System Concepts

File Concept Type or extension usually indicates meaning of contents: Collection of related data Contiguous logical address space – mapped onto physical device by OS, but presents a view (interface) to an application which is independent of any device usually non-volatile Users view: smallest allotment of logical secondary storage. From a user viewpoint: data cannot be written to secondary storage unless it is in a file Sequence of bytes, bits, lines, or records … file has a structure defined by file type … interpretation depends on OS and/or application Type or extension usually indicates meaning of contents: Data numeric character, ex: rat.txt - text file binary, ex: rat.xls - spread sheet, application supported Program, ex: rat.exe - executable module, OS supported Operating System Concepts

File Structure The internal representation of the data None - sequence of words, bytes Simple record structure Lines Fixed length Variable length Complex Structures Formatted document Relocatable load file Can simulate last two with first method by inserting appropriate control characters - ex: MS Word documents. Who decides (you mean support? - see previous slide): Operating system Program Operating System Concepts

File Attributes Name – only information kept in human-readable form. Identifier - a machine readable “field” corresponding to the name - typically a number Type – needed for systems that support different types. 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. Operating System Concepts

File Operations File is an abstract data type - operation are associated with file type, p. 373 Operations (usually from within a program, ie., function calls): Create Write Read Reposition within file – file seek Delete Truncate Open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory - to the open file table, attributes of file is pointed to by a file descriptor or “handle” returned by open call. The open file table is not searched it is directly accessed via the file descriptor. Open file table is like a cache for the directory. Close (Fi) – move the content of entry Fi in memory to directory structure on disk (if modified?). Operating System Concepts

File Types – Name, Extension Big questions: Who supports file extensions (types)? … support is shared by OS and the application … varies according to the OS Also who supports the file structure (internal format, logical records, etc: OS or application? OS minimally supports executable files. UNIX provides only minimal OS support. Internal file structure: Mapping the logical record size to the physical block (sector) is the problem here. See sect 11.1.5 Operating System Concepts

Access Methods Sequential Access - Tape model: must sequentially move thru file - … no insertion of records, append at end - can read anywhere by searching from beginning for record - Current position (cp) pointer indicates next record to be accessed - write append to end of file read next , cp++ write next , cp++ reset , cp = 0; no read after last write (beyond EOF) Direct Access - Disk model: random access of fixed blocks - File is seen as numbered series of fixed length logical blocks or records that allow programs to read/write records in no particular order. - R/W records in no particular order read n write n position to n read next //simulation of sequential write next rewrite n n = relative block number Operating System Concepts

Sequential-access File Operating System Concepts

Simulation of Sequential Access on a Direct-access File … simulation of direct access on sequential more difficult Operating System Concepts

Example of Index access methods and Relative Files - Build on top of direct access - must search index and then directly access via disk pointer (or convert relative block number to a physical disk address) - index written on disk and copied to memory (cache ) - can have multilevel index tables, index the index table - sound familiar? - Index will get you to a physical block containing the logical record (relatively small logical records packed in a larger physical block (ex: sector) - FAT access method (used on PC) related to this idea, and ISAM on IBM mainframes. Operating System Concepts

Directory Structure A collection of nodes containing information about all files. A way of locating files on the disk- by name IBM mainframe buzz word: Volume Table of Contents (VTOC) Contains access information about the file such as name, location, size, type, etc. Example: do ls -l -a on UNIX Directory This example shows the one minimal feature of a directory, namely relating file names to their locations. Files F 1 F 2 F 3 F 4 F n Both the directory structure and the files reside on disk. Backups of these two structures are kept on tapes. Operating System Concepts

A Typical File-system Organization Organize disk into partitions (minidisks as per IBM mainframes) - Each with its own directory - files and directories stored in partitions - Partitions appear as a logical disk to user - may be larger that a disk for multiple disk systems (Ex: RAID) - Ideally user is oblivious to partition management and sees only disk drives. Typical for PC’s Example for a RAID system Operating System Concepts

Information in a Device (say disk) Directory Name Type Address … pointer to, or indicator of physical location of file – generally not visible to the user – the main guts of the entry. Current length Maximum length Date last accessed (for archival) Date last updated (for dump) Owner ID (who pays) Protection information (discuss later) Check this stuff on UNIX doing ls -l -a Must minimally have name and address Operating System Concepts

Operations Performed on Directory Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system Operating System Concepts

Organize the Directory (Logically) to Obtain Efficiency – locating a file quickly. Naming – convenient to users. Two users can have same name for different files. The same file can have several different names. Grouping – logical grouping of files by properties, (e.g., all Java programs, all games, …) Operating System Concepts

Single-Level Directory- some history Directories originally set up for multi-user systems A single directory for all users. Cat,bo, … are file names <--Actual data for files Naming problem Just a list of all user’s files: names must be unique - problem with duplicate names Grouping problem – difficult to organize files Operating System Concepts

Two-Level Directory-some modern history Separate directory for each user - solves duplicate name problem. Example: IBM VM system - each user (on a different virtual machine) had a single level directory Path name Can have the same file name for different user Efficient searching No grouping capability Operating System Concepts

Tree-Structured Directories - what we have today Does it all: introduces the concept of a “folder” - can have “folders” within “folders” (folders is a Windows buzz word) names in the directory entry are file names OR the names of other directories - the idea is from UNIX Operating System Concepts

Tree-Structured Directories (Cont.) Efficient searching -can quickly skip to desired subdirectory before searching for data files Grouping Capability – easy to organize files Current directory (working directory) cd /spell/mail/prog type list Operating System Concepts

Tree-Structured Directories (Cont.) Absolute (from root) or relative (from current directory) path name suppose your home directory on UNIX is: /u0/users/0/cs350, and inder cs350 you have a subdirctory project containing an executable rw. Executing rw from cs350 can be done as: /u0/users/0/cs350/project/rw - specify absolute path or . /project/rw - use relative path (“.” means current dirctory) Creating a new file is done in current directory. Delete a file rm <file-name> Creating a new subdirectory is done in current directory. mkdir <dir-name> Example: if in current directory /mail mkdir count mail prog copy prt exp count Deleting “mail”  deleting the entire subtree rooted by “mail”. In UNIX rm -rf mail … recursively clears all subdirectories - a dangerous command! Operating System Concepts

Acyclic-Graph Directories Have shared subdirectories and files <== key idea. In UNIX this is the symbolic link - powerful method for sharing files among large groups of users over a network. Uses path name to shared file. Can have distinct different file names for same file – alias Must ensure that there are no cycles in the graph Operating System Concepts

Acyclic-Graph Directories (Cont.) Shared file may have two different names (aliasing) When could a shared file be deleted? If dict deletes list  dangling pointer (see prev. slide). Solutions: Backpointers, so we can delete all pointers. Variable size records a problem. Backpointers using a daisy chain organization. Entry-hold-count solution. - remove file only when all references to it are gone - increment/decrement count. Two problems to avoid in acyclic graphs: dangling pointers - UNIX: if shared file deleted, leave all symbolic links - leave it up to the user to handles these links avoid cycles when adding links - cycles detection. Operating System Concepts

General Graph Directory >>>omit<<< Operating System Concepts

General Graph Directory (Cont.) >>>omit<<< How do we guarantee no cycles? Allow only links to file not subdirectories. Garbage collection. Every time a new link is added use a cycle detection algorithm to determine whether it is OK. Operating System Concepts

File System Mounting Mounting: Associating data (or file) on a device to a directory to a directory/file system in user space. Make “raw” files on a device part of a directory tree. A file system must be mounted before it can be accessed. The directory structure can be built out of multiple partitions/disks (or from multiple devices, or remote networked machines), which must be “mounted” to make them available within the file system name space A unmounted file system is mounted at a mount point within the directory tree. Operating System Concepts

Existing. (b) Unmounted Partition Operating System Concepts

Mount Point New FS mounted over previous directory subtree at “users” and would obscure previous tree. Better create another subdirectory under users to be the mount point. See pp 394-395. Operating System Concepts

File Sharing Sharing of files on multi-user systems is desirable. Sharing may be done through a protection scheme. On distributed systems, files may be shared across a network. Network File System (NFS) is a common distributed file-sharing method. On UNIX - remote file systems would be mounted Operating System Concepts

Protection File owner/creator should be able to control: what can be done by whom Types of access Read Write Execute Append Delete List Operating System Concepts

Access Lists and Groups 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 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 to a file chgrp G game Operating System Concepts