File System Interface CSSE 332 Operating Systems

Slides:



Advertisements
Similar presentations
File-System Interface
Advertisements

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.
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.
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.
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.
Chapter 13: File-System Interface
Module 10: File-System Interface
Chapter 10: File System.
Chapter 11: File-System Interface
Chapter 11: File-System Interface
EECE.4810/EECE.5730 Operating Systems
Thrashing If a process does not have “enough” pages, the page-fault rate is very high. This leads to: low CPU utilization operating system thinks that.
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
File-System Interface
Module 10: File-System Interface
Lecture 4: File-System Interface
Chapter 10 File Systems: Interface
Presentation transcript:

File System Interface CSSE 332 Operating Systems Rose-Hulman Institute of Technology 1

Announcements Exam 1 is tomorrow Lab 4 is due on Thursday Milestone 1 is due on Monday

Why a file system There is a general need for long-term and shared data storage: need to store large amount of information persistent storage (outlives process and system reboots) concurrent sharing of information Files meet these requirements The file manager or file system within the OS Set of system software proving services to users and applications in use of files Files are accessed through file management system 3

Concept of a file A named collection of related data stored on secondary storage File extension may encode the file type in UNIX and Windows Abstraction presented to the user An ADT that specifies a minimal set of operations Common examples of File types Regular files, directories Executable files special files (block and character) Archives Files can store program or data: numeric data character data binary data 4

File structure (logical) None - sequence of words, bytes Simple record structure Lines, Fixed length, Variable length Complex Structures Formatted document, multi-media documents Who decides: Operating system Application DBMS 5

File Attributes Name – only information kept in human-readable form Identifier – unique tag (number) identifies file within file system 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 https://linux.die.net/man/2/stat e.g., stat 18-FileSystemInterface.pptx 6

File Operations File is an abstract data type Create Write Read Reposition within file Delete Truncate Open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory Close (Fi) – move the content of entry Fi in memory to directory structure on disk Opening a file moves the content of the file to a buffer in memory. Closing a file moves the buffered content of the file from memory to disk. How is truncating a file different from writing a file? Writing a file resets the file pointer to the start of the file, but truncating a file allows the user to specify the new size of the file. 7

Open Files Several pieces of data are needed to manage open files: File pointer: pointer to last read/write location, per process that has the file open File-open count: counter of number of times a file is open – to allow removal of data from open-file table when last processes closes it Disk location of the file: cache of data access information Access rights: per-process access mode information How is opening a file for reading different from opening a file for writing? – for writing, the content of the file is cleared and the file pointer points to the beginning of the file. 8

Examples of file types What other file types have you used that are not on this list? 9

Access Methods Sequential Access read next write next reset no read after last write (rewrite) Direct Access read n write n position to n rewrite n n = relative block number Examples of direct access files are directories, pricing tables, schedules, and name lists. 10

Sequential-access File 11

Simulation of Sequential Access on Direct-access File 12

Directory structure Directory contains a collection of nodes containing information about all files Both the directory structure and the files reside on disk Backups of these two structures were kept on tapes Directory Both the directory and the files are stored on disks. Of course, these can be backed up for reliability (to keep the disks safe from physical damage). Files F 1 F 2 F 3 F 4 F n 13

Disk Structure Disk can be subdivided into partitions Disks or partitions can be RAID protected against failure Disk or partition can be used raw – without a file system, or formatted with a file system Partitions also known as minidisks, slices Entity containing file system known as a volume Each volume containing file system also tracks that file system’s info in device directory or volume table of contents As well as general-purpose file systems there are many special-purpose file systems, frequently all within the same operating system or computer RAID (redundant array of independent disks) is a way of storing the same data in different places (thus, redundantly) on multiple hard disks. 14

A Typical File-system Organization My brother likes to burn and store music. He has 2 internal hard drives on his system. 15

Directory operations Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system Directory operations in LINUX find ~/ -name '.svn’ -print Typically use a program to crate a file Delete a file with rm Use ls to list a directory Use mv to rename a file Use cd to traverse a file system 16

Information per file in a directory Name Type Address Current length Maximum length Date last accessed (for archival) Date last updated (for dump) Owner ID (who pays) Protection information (discuss later) All of this information is stored in a node per file stat <filename> 17

Organize the directory (logically) 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, …) 18

Single-level directory A single directory for all users. Naming problem: two users (or even one user) cannot have files of the same name. Grouping problem: cannot group all OS files together in a sub-directory. Naming problem Grouping problem 19

Two-level directory Separate directory for each user. Path name Each user has a directory, but all his/her files are stored in that one directory. A user cannot group files in directories. Path name Can have the same file name for different user Efficient searching No grouping capability 20

Tree-structured directories This is a directory-tree structure. Each directory entry points to a file or another directory. This is what LINUX and WINDOWS use. 21

Tree-structured directories (2) Efficient searching Grouping Capability Absolute or relative path name Current directory (working directory) cd /Users/faculty/defoe/Public/ type echo Creating a new file is done in current directory Creating a new subdirectory is done in current directory The type utility shall indicate how each argument would be interpreted if used as a command name. http://pwet.fr/man/linux/commandes/posix/type 22

Tree-structured directories (3) Absolute or relative path name 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 Your text discusses other directory structures (acyclic graph, general graph) but we will not discuss these in class Mounting file systems and File sharing are also important concepts, but we will not have time to discuss them in class. mail prog copy prt exp count Deleting mail  deletes the entire subtree rooted by mail 23

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

Access lists and groups Mode of access: read, write, execute Three classes of users RWX a) owner access 7  1 1 1 b) groups 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 particular file or subdirectory, define an appropriate access. game is a subdirectory. G is a group. owner group public chmod 761 game Attach a group to a file or directory chgrp G game 25

Windows XP Access-control List Management 26

A Sample UNIX Directory Listing If first char is a d, then it’s the listing for a subdirectory. As shown (from left to right): Owner, group, universe permissions Number of links to the file The owner’s name The group’s name The size of the file in bytes The date of last modification File name 27