File System Interface Rahul Ajit Khin Zayar Htay.

Slides:



Advertisements
Similar presentations
File-System Interface
Advertisements

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 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
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, 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.
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.
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.
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.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 10: File-System Interface File Concept Access Methods Directory.
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.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 10.4 File System Mounting A file system must be mounted before it can be accessed.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
XE33OSA Chapter 10: File-System Interface. 10.2XE33OSA Silberschatz, Galvin and Gagne ©2005 Chapter 10: File-System Interface File Concept Access Methods.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
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.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 10: File-System Interface.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
CENG334 Introduction to Operating Systems Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
Chapter 10: File-System Interface Hung Q. Ngo KyungHee University Spring 2009
Chapter 10: File-System Interface File Concept Contiguous logical address space Types: Data  numeric  character  binary Program.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
It consists of two parts: collection of files – stores related data directory structure – organizes & provides information Some file systems may have.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: 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.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
Module 10: File-System Interface
Chapter 11: File-System Interface
Chapter 10: File-System Interface
Module 10: File-System Interface
Lecture 4: File-System Interface
Presentation transcript:

File System Interface Rahul Ajit Khin Zayar Htay

File Concept  Files are logical storage units mapped on to physical secondary storage, usually nonvolatile such as magnetic disks, magnetic tapes and optical disks.  Types:  Data  Numeric, alphabetic, alphanumeric, or binary  Program  Source and object forms

File Attributes  Name - Only information kept in human- readable form.  Identifier – Unique tag, usually a number that identifies the file within the file system.  Type – Needed for systems that support different types.  Location – Pointer to file location on device.

File Attributes (Cont’d)  Size – Current file size.  Protection – Access-control who can write, read, execute and so on.  Time, date and user identification – Data for protection, security and usage monitoring.  Volatility – Frequency with which additions and deletions are made to the file.

File Operations  A file is an abstract data type. To define a file, we need to consider the operations that can be performed on the file.  Creating a file - Allocate space for the file, entry for the file in the directory.  Writing a file - Make a system call specifying both the name of the file and the information to be written to the file. System keeps a write pointer.

File Operations (Cont’d)  Reading a file - Make a system call specifying both the name of the file and where the next block of file should be put. System keeps a read pointer.  Repositioning within a file – Also known as file seek. The directory is searched for the appropriate entry, and the current file- position-pointer is repositioned to a given value.

File Operations (Cont’d)  Deleting a file – Release all file space and erase the directory entry.  Truncating a file – Deletes contents and resets length to 0 but directory entry and all file attributes except file length remains unchanged.  Opening/closing a file - When a file operation is requested, the file is specified via an index into open-file table usually after an open() system call.

File Operations (Cont’d)  Information associated with open file  File pointer - If no file offset in read()/write() system calls are included.  File-open count - The number of processes have opened the file. When the count reaches 0 the entry is deleted from open-file table.  Disk location of the file  Access rights - Per process access mode information.

File Locks  File locks allow one process to lock a file and prevent other processes from gaining access to it.  Mandatory file locks - Once a process acquires an exclusive lock, the operating system will prevent any other process from accessing the locked file.  Advisory file locks – Is up to software developers to ensure that locks are appropriately acquired and released.

Common file types

File Structure  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. Operating system or program can establish file structure. Can simulate last two with first method by inserting appropriate control characters. Operating system or program can establish file structure.

File Structure (Cont’d)  File type may indicate internal structure of file (e.g., source or object).  IBM mainframe systems, for example, support a very wide range of access methods.  UNIX, MS-DOS, others, support only a minimal number of file structures. (UNIX files are sequence of 8-bit bytes)

File Structure (Cont’d)  Macintosh resource fork and data fork.  The logical record size, physical block size, and packing technique determine how many logical records are in each physical block. The packing can be done either by the user's application program or by the operating system.

Access Methods  Sequential access – Information in the file is processed in order, one record after the other.  read next  Write next  Reset or skip n

Access Methods (Cont’d)  Direct access – Or relative access is based on a disk model of a file, since disks allow random access to any file block.  Read n, write n  Read next, write next, position file to n where n is the relative block number.

Access Methods (Cont’d)  Other access methods – Index and relative files.

Directory Structure  Storage structure – A collection of nodes containing information of all files. Resides on disk, along with the files.

Directory Operations  Search for a file.  Create a file.  Delete a file.  List a directory.  Rename a file.  Traverse the file system usually for back up purposes.

Single-Level Directory  All files are contained in the same directory. Simple to support and use. But difficult when the number of files increase and system has more than one user.

Two-Level Directory  Each user has own user file directory (UFD).  Master file directory (MFD) holds pointers to UFDs.  Disadvantage: Isolation.

Tree-Structured Directory  Natural generalization of two-level directories. Contains a set of files and sub- directories with the same internal format.  The current directory should contain most of the files that are of current interest to the process.  Special system calls are used to create and delete directories. To change directories a system call that takes a directory name as a parameter and uses it to redefine current directory.  Efficient searching and group capability.

Tree-Structured Directory (Cont’d)

Acyclic-Graph Directory  A graph with no cycles, allows directories to share subdirectories and files.

Acyclic-Graph Directory (Cont’d)  One way of implementation is by creating a new directory called link, which is a pointer to another file or sub directory.  An alternative approach is to duplicate all information in both sharing directories.  Deleting a file could involve the approach of leaving the links dangling or the approach where file is preserved until all references to it are deleted.

General Graph Directory  We have to guarantee no cycles are formed by making sure that  We allow only links to files and not sub directories  Garbage collection  Every time a new link is added use a cycle detection algorithm to determine if it is okay.

General Graph Directory (Cont’d)

File-System Mounting  The process of incorporating a file system into the existing directory structure.  A file system must be mounted before it can be accessible to system processes.  A file system is mounted at mount point (empty directory).  mount -t iso9660 /dev/hdc /cdrom

File-System Mounting (Cont’d)  Mounting Process, OS  Name of device  Mount point  File system type  Verify device contains valid file system.  File system is mounted at specified mount point.

File-System Mounting (Cont’d)  Unix  Mount /dev/dsk/c1t4d0s0 under Solaris UNIX at /data2, enter:  mkdir /data2  mount /dev/dsk/c1t4d0s0 /data2  To remove mount point run:  umount /data2

File-System Mounting (Cont’d)

 System impose semantics to clarify functionality. System may  Disallow a mount over a directory that contain files  A mount over that directory and directory’s existing files are hidden and inaccessible  Allow same file system to be mounted repeatedly at different mount points  Allow one mount per file system

File-System Mounting (Cont’d)  Mac OS

File-System Mounting (Cont’d)  Windows OS

File Sharing  Sharing of file among users and systems is desirable.  File Sharing through removable media, computer network, Web and etc  File Sharing through protection such as access control

File Sharing : Multiple Users  Owner, who can change attributes and grant access and have most control over the files  Group, who can share access to the files or execute one subset of file operations  User ID identifies user and permitting requested operations on files  Group ID allows user to be in a group and permitting group access right

File Sharing : Remote File Systems  Network communication among remote computes now become possible  Networking allows sharing of file system among different systems  FTP: manually transferring files between hosts  DFS: accessing files from multiple hosts via network  WWW: A browser gains access to the remote files and separate operations for file transfer.

File Sharing : Remote File Systems (Cont’d)  Client-Server model allows client to mount one or more file systems from servers  A server can serve multiple clients.  A client can access multiple servers.  Client identification is complex and unsecure authentication methods are most commonly used  UNIX and its NFS, authentication takes place via client network information by default  NFS is Unix File Sharing Protocol  CIFS and SMB are Window File Sharing Protocols

File Sharing : Remote File Systems (Cont’d)  Client-Server model file sharing  Once remote file system is mounted, client sends file operation requests to server via DFS  Server applies standard access checks to see if user has credentials to access the file in the mode requested  The request is either grant or deny  If access is granted, client performs requested operations  Client closes the file

File Sharing : Remote File Systems (Cont’d)  Distributed Information Systems provide unified access to the information needed for remote computing  DNS provides host-name-to-network-address translation for internet  Some DIS provides user name, password, user ID and group ID for distributed facility  UNIX employs a variety of distributed- information methods.  Sun Microsystems introduced NIS and NIS+  Microsoft CIFS, network information is used with user authentication for network login  Microsoft uses domain and active directory naming technology for distributed naming structures.  Lightweight directory-access protocol (LDAP)

File Sharing : Failure Modes  Local file system can fail for a variety of reasons  Disk failure, Directory structure or Disk- management information corruption, Disk- controller failure, cable failure, user or system administrator failure and etc  Remote file system have more failure modes.  Network interruption and etc  Recover from failure involves some kind of state information about remote request  NFS, which employs DFS stateless  NFS version 4 is stateful

File Sharing : Consistency Semantics  An important criterion  How modifications of data by one user will be observable by other users  Andrew file system implemented complex sharing semantics.

File Sharing : Consistency Semantics (Cont’d)  UNIX Semantics  Writes to an open file by a user are visible immediately to other users who have this file open  Supports a mode of sharing where users share pointer of current location into the file  Session Semantics (eg. AFS)  Writes to an open file by a user are not visible immediately to other users who have this file open  Once a file is closed, the changes are visible only in sessions starting later. Already open file instances doe not reflect changes.

File Sharing : Consistency Semantics (Cont’d)  Immutable-Shared-Files Semantics  Once a file is declared as shared by its creator, it cannot be modified.  Two properties: name and content are immutable  Simple implementation as read-only sharing

Protection  Keep information stored in system safe from physical damage and improper or unauthorized access  Protect files by limiting types of access to files and by whom

Protection : Access Types  Types of Access  Read  Write  Execute  Append  Delete  List

Protection : Access Control  Common approach is granting access based on the identity of user  Access-Control List  Specify user names and type of access allowed for each user  Associate access-control list with each file  Maintenance problems as its length and unknown size of system users  The variable size directory entry, resulting in more complicated space management.

Protection : Access Control (Cont’d)  Categories of access  Owner  Group  Universe  Maintenance of groups in the system are not connected with the specific file or directory  Each file has owner and group associated with it. Permissions are specified to each of them

Protection : Access Control (Cont’d)  Permission and access control lists must be controlled tightly  Examples in Unix System  File name: book, chapter1  Group name: text, owner  User name: visitor not in groups  -rwxrw-r-- 2 Sara text 2048 Sep book  Chmod text-w book  setfacl -m u:visitor:rx / chapter1

Protection : Access Control (Cont’d)  Windows

Protection : Others  Passwords  Associating a password with each file  Issues  Large number of passwords to remember  One password for all files is used, protection is on all-or-none basis  Some system allow user to associate a password with subdirectory rather than individual file.  MS-DOS and early version of Mac OS provide little in term of file protection.

References Operating System Concepts 8 th Edition by Operating System Concepts 8 th Edition by ABRAHAM SILBERSCHATZ, PETER BAER GALVIN and GREG GAGNE acos-x-dp2.ars/6 acos-x-dp2.ars/6 acos-x-dp2.ars/6 acos-x-dp2.ars/6 ons.html ons.html ons.html ons.html disks.html disks.html

Thank you