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.

Slides:



Advertisements
Similar presentations
File-System Interface
Advertisements

Chapter 12: File System Implementation
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
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.
Chapter 10: File-System Interface
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
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.
04/05/2004CSCI 315 Operating Systems Design1 File System Implementation.
File System Implementation
File Concept l Contiguous logical address space l Types: Data: numeric, character, binary Program: source, object (load image) Documents.
04/07/2010CSCI 315 Operating Systems Design1 File System Implementation.
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.
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.
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.
Page 110/17/2015 CSE 30341: Operating Systems Principles Acyclic-Graph Directories  Have shared subdirectories and files.
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.
Page 110/19/2015 CSE 30341: Operating Systems Principles Chapter 10: File-System Interface  Objectives:  To explain the function of file systems  To.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
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.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
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.
Page 112/7/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  File system structure – layered, block based.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
File System Implementation
Chapter 13: File-System Interface
File-System Implementation
Chapter 11: File System Implementation
Module 10: File-System Interface
Chapter 10: File System.
Chapter 11: File-System Interface
File System Implementation
Chapter 11: File System Implementation
File Sharing Sharing of files on multi-user systems is desirable
Chapter 11: File-System Interface
Chapter 11: File System Implementation
Chapter 10: File-System Interface
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.
Chapter 11: File System Implementation
Module 10: File-System Interface
Lecture 4: File-System Interface
Presentation transcript:

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 files reside on disk Backups of these two structures are kept on tapes

A Typical File-system Organization

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

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, …)

Single-Level Directory A single directory for all users Naming problem Grouping problem

Two-Level Directory Separate directory for each user Path name Can have the same file name for different user Efficient searching No grouping capability

Tree-Structured Directories

Tree-Structured Directories (Cont) Efficient searching Grouping Capability Current directory (working directory) cd /spell/mail/prog type list

Tree-Structured Directories (Cont) 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 mail prog copy prt exp count Deleting “mail”  deleting the entire subtree rooted by “mail”

Acyclic-Graph Directories Have shared subdirectories and files

Acyclic-Graph Directories (Cont.) 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

General Graph Directory

General Graph Directory (Cont.) 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

File System Mounting A file system must be mounted before it can be accessed A unmounted file system (i.e. Fig. 11-11(b)) is mounted at a mount point

(a) Existing. (b) Unmounted Partition

Mount Point

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

File Sharing – Multiple Users User IDs identify users, allowing permissions and protections to be per-user Group IDs allow users to be in groups, permitting group access rights

File Sharing – Consistency Semantics Consistency semantics specify how multiple users are to access a shared file simultaneously Similar to Ch 7 process synchronization algorithms Tend to be less complex due to disk I/O and network latency (for remote file systems Andrew File System (AFS) implemented complex remote file sharing semantics Unix file system (UFS) implements: Writes to an open file visible immediately to other users of the same open file Sharing file pointer to allow multiple users to read and write concurrently AFS has session semantics Writes only visible to sessions starting after the file is closed

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

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

Windows XP Access-control List Management

A Sample UNIX Directory Listing

Chapter 11: File System Implementation File structure Logical storage unit Collection of related information File system resides on secondary storage (such as disks) Boot control block - information needed to boot Volume control block - information about volume/partitions (# blocks, size of blocks, free block count, free block pointers) Directory structure (inode) Per file control blocks File system organized into layers

Layered File System

A Typical File Control Block File control block – storage structure consisting of information about a file

In-Memory File System Structures

Virtual File Systems There are many different file systems available on any operating systems Windows: NTFS, FAT, FAT32 Linux: ext2/ext3, ufs, vfat, ramfs, tmpfs, reiserfs, xfs ... Virtual File Systems (VFS) provide an object-oriented way of implementing file systems VFS allows the same system call interface (the API) to be used for different types of file systems The API is to the VFS interface, rather than any specific type of file system

Schematic View of Virtual File System

Directory Implementation Directories hold information about files Linear list of file names with pointer to the data blocks. simple to program time-consuming to execute Hash Table – linear list with hash data structure. decreases directory search time collisions – situations where two file names hash to the same location fixed size

Allocation Methods An allocation method refers to how disk blocks are allocated for files: Contiguous allocation Linked allocation Indexed allocation

Contiguous Allocation Each file occupies a set of contiguous blocks on the disk Simple – only starting location (block #) and length (number of blocks) are required Random access Wasteful of space (dynamic storage-allocation problem) Files cannot grow

Contiguous Allocation of Disk Space

Extent-Based Systems Many newer file systems (I.e. Veritas File System) use a modified contiguous allocation scheme Extent-based file systems allocate disk blocks in extents An extent is a contiguous block of disks Extents are allocated for file allocation A file consists of one or more extents.

Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. Simple – need only starting address Free-space management system – no waste of space No random access pointer block =

Linked Allocation

File-Allocation Table (DOS FAT)

Indexed Allocation Brings all pointers together into the index block. Logical view. index table

Example of Indexed Allocation

Indexed Allocation (Cont.) Need index table Random access Dynamic access without external fragmentation, but have overhead of index block. Mapping from logical to physical in a file of maximum size of 256K words and block size of 512 words. We need only 1 block for index table.

Indexed Allocation – Mapping (Cont.)  outer-index index table file

Combined Scheme: UNIX (4K bytes per block)