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

Similar documents
UNIT V SECONDARY STORAGE MANAGEMENT

Chapter 11: File-System Interface

Chapter 10: File-System Interface

Chapter 11: File-System Interface

CS720 - Operating Systems

Chapter 10: File-System Interface

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

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

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

CS3600 SYSTEMS AND NETWORKS

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

CMSC421: Principles of Operating Systems

File Systems: Interface and Implementation

File Systems: Interface and Implementation

Chapter 7: File-System

Principles of Operating Systems

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

Chapter 6 Storage Management File-System Interface 11.1

File Management By : Kaushik Vaghani

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

ICS Principles of Operating Systems

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

Chapter 10: File System

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

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

CMSC421: Principles of Operating Systems

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

Chapter 11: File-System Interface

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

File System: Interface and Implmentation

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

Lecture 10 File Systems - Interface (chapter 10)

Chapter 10: File-System Interface

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

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

Chapter 9: File System Interface

Chapter 11: File-System Interface

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

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

Chapter 11: File-System Interface

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

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

File-System Interface

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

File Systems. CS170 Fall 2018

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

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

CS370 Operating Systems

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

Chapter 11: File-System Interface

TDDB68 Concurrent Programming and Operating Systems. Lecture: File systems

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

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

Chapter 11: File System Interface

Modulo V Sistema de Arquivos

Chapter 14: File-System Implementation

Files and File Systems

Chapter 11: File System Implementation. Objectives

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

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

CS3600 SYSTEMS AND NETWORKS

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

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

Advanced Operating Systems. File Systems Lecture 9

File-System Structure. Allocation Methods. Free-Space Management. Directory Implementation. Efficiency and Performance. Recovery

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

DATA STRUCTURES USING C

Chapter 12: File System Implementation

File Systems. CS 4410 Operating Systems

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

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

CSE 4/521 Introduction to Operating Systems. Lecture 23 File System Implementation II (Allocation Methods, Free-Space Management) Summer 2018

CS307 Operating Systems Main Memory

File Directories Associated with any file management system and collection of files is a file directories The directory contains information about

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

CS307: Operating Systems

e-pg Pathshala Subject: Computer Science Paper: Operating Systems Module 35: File Allocation Methods Module No: CS/OS/35 Quadrant 1 e-text

CS370 Operating Systems

UNIT IV: FILE SYSTEMS PART A

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

Mass Storage. 2. What are the difference between Primary storage and secondary storage devices? Primary Storage is Devices. Secondary Storage devices

Chapter 12: File System Implementation

CS 143A - Principles of Operating Systems

File System Management

File System (FS) Highlights

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

Chapter 11: File System Implementation

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

OPERATING SYSTEMS: Lesson 11: Files

Chapter 11: Implementing File Systems

CS6401- Operating System QUESTION BANK UNIT-IV

File System CS170 Discussion Week 9. *Some slides taken from TextBook Author s Presentation

UNIX File System. UNIX File System. The UNIX file system has a hierarchical tree structure with the top in root.

File System Implementation

File System Internals. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

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

File System Implementation. Sunu Wibirama

File System Internals. Jo, Heeseung

OPERATING SYSTEM. Chapter 12: File System Implementation

Transcription:

CS307 File Concept A file is a named collection of related information that is recorded on secondary storage. File-System Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2016 Types: Text Source/object programs Executable programs Database records Graphic images Multimedia 2 File Types Name, Extension File Attributes Name 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 3 5 File Operations Access Methods Create Write Read Reposition within file Delete Truncate Sequential Access read next write next reset no read after last write (rewrite) The other operations can be implemented by the primitive ones. Direct Access n = relative block number read n write n position to n read next write next rewrite n 6 9 1

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 RWX c) public access 1 0 0 1 Ask administrator 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 10 11 A Sample UNIX Directory Listing Windows XP Access-Control List Management 12 13 A Typical File-system Organization Single-Level Directory A single directory for all users Efficiency problem Naming problem Protection of users private files Grouping problem 15 18 2

Two-Level Directory Tree-Structured Directories Separate directory for each user Can have the same file name for different user A little bit more efficient searching Path name No grouping capability 19 20 Tree-Structured Directories (Cont.) Acyclic-Graph Directories Efficient searching Have shared subdirectories and files Grouping Capability Current directory (working directory) Change directory: cd /spell/mail/prog Directory/file sharing? 21 22 Acyclic-Graph Directories (Cont.) General Graph Directory Two different names (aliasing) New directory entry type Link another name (pointer) to an existing file Resolve the link follow pointer to locate the file If dict deletes count dangling pointer Solutions: Backpointers, so we can delete all pointers Entry-hold-count solution 23 24 3

File Allocation Methods Contiguous Allocation An allocation method refers to how disk blocks are allocated for files Contiguous allocation Linked allocation Contiguous allocation each file occupies set of contiguous blocks Simple only starting location (block #) and length (number of blocks) are required Best performance in most cases Problems include finding space for file, knowing file size, external fragmentation, need for compaction off-line (downtime) or on-line Indexed allocation 33 34 Contiguous Allocation of Disk Space Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk 35 37 Linked Allocation (Cont.) Linked Allocation (Cont.) Linked allocation each file is a linked list of blocks File ends at nil pointer No external fragmentation Each block contains pointer to next block No compaction, external fragmentation Free space management system called when new block needed Improve efficiency by clustering blocks into groups but increases internal fragmentation Reliability can be a problem Locating a block can take many I/Os and disk seeks 38 39 4

File-Allocation Table (FAT) Indexed Allocation FAT (File Allocation Table) variation Beginning of volume has a table, indexed by block number Much like a linked list, but faster on disk and cacheable New block allocation simple DOS / Windows Indexed allocation Each file has its own index block(s) of pointers to its data blocks Logical view index table 40 41 Example of Indexed Allocation Indexed Allocation Mapping (Cont.) outer-index index table blocks Multilevel Index 42 43 Indexed Allocation Mapping (Cont.) I-node Example Combined Scheme with UNIX I-node 44 Suppose a file system is constructed using blocks of 32 bytes. A pointer needs 4 bytes. The I-node structure is as follows (word, value): 0 Permission word 1 File Size 2 Direct block 3 Direct block 4 Direct block 5 Direct block 6 Single-indirect 7 Double-indirect Assume that free blocks are allocated in logical order starting with block 11. Also it has been determined that blocks 17 and 32 are bad and cannot be allocated. Draw a block diagram showing the structure of the I-node and the blocks that are allocated for Original file size of 3 blocks Adding 4 blocks Adding 17 blocks 45 5

Indexed Allocation (Cont.) Random access Without external fragmentation Need index table Pop Quiz Suppose a file system is constructed using blocks of 32 bytes. A pointer needs 4 bytes. The I-node structure is as follows (word, value): 0 Permission word 1 File Size 2 Direct block 3 Direct block 4 Direct block 5 Single-indirect 6 Double-indirect 7 Triple-indirect Assume that free blocks are allocated in logical order starting with block 100. Also it has been determined that blocks 107, 108, 109, and 112 are bad and cannot be allocated. Draw a block diagram showing the structure of the I-node and the blocks that are allocated for Original file size of 3 blocks Adding 7 blocks Adding 24 blocks Adding 64 blocks 46 47 Homework Reading Chapter 10 and 11 49 6