CHAPTER 17: File Management

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

File Management.
Chapter 14 The User View of Operating Systems
Chapter 4 : File Systems What is a file system?
File Management Lecture 3.
Allocation Methods - Contiguous
Chapter 10: File-System Interface
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
Chapter 11: File System Implementation
CHAPTER 17: File Management
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Chapter Chapter 13-2 Chapter 13 Data Modeling Introduction An Overview of Databases Steps in Creating a Database Using Rea Creating Database Tables.
Chapter 18 Three Operating Systems
File System Implementation
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File-System Interface.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
Ceng Operating Systems
1 File Management in Representative Operating Systems.
Lesson 4: Configuring File and Share Access
CHAPTER 9: Input / Output
5th Edition, Irv Englander
CHAPTER 2: Introduction to Systems Concepts and Systems Architecture
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Chapter 10 File System Interface
Objectives Learn what a file system does
Chapter 8 File Management
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design Copyright 2000 © John Wiley & Sons, Inc. All rights reserved. Slide 1 Systems.
Operating System Concepts and Techniques Lecture 17
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
1 File Management Chapter File Management n File management system consists of system utility programs that run as privileged applications n Concerned.
Copyright © 2000 John Wiley & Sons, Inc. All rights reserved
File Storage Organization The majority of space on a device is reserved for the storage of files. When files are created and modified physical blocks are.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Module 4.0: File Systems File is a contiguous logical address space.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
Chapter 16 File Management The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander John.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
Lecture 18 Windows – NT File System (NTFS)
KT6213 Lecture 14: Operating Systems – File Management & Internal OS Computer Organization and Architecture.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
Slide 6-1 Chapter 6 System Software Considerations Introduction to Information Systems Judith C. Simon.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
W4118 Operating Systems Instructor: Junfeng Yang.
File-System Management
CHAPTER 6: The Little Man Computer
Chapter 11: File System Implementation
Chapter 12: File System Implementation
File System Implementation
Chapter 11: File System Implementation
Chapter 12: File System Implementation
Chapter 11: File System Implementation
Chapter 11: File System Implementation
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
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.
Introduction to Operating Systems
Chapter 15 – Part 2 Networks The Internal Operating System
Chapter 16 File Management
Chapter 14 The User View of Operating Systems
Chapter 11: File System Implementation
Presentation transcript:

CHAPTER 17: File Management The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 5th Edition, Irv Englander John Wiley and Sons 2013 PowerPoint slides authored by Angela Clark, University of South Alabama PowerPoint slides for the 4th edition were authored by Wilson Wong, Bentley University

Introduction to Files Collection of (usually related) data Block Typically between 256 and 4096 bytes Files usually require a one-block minimum Cluster Groups of one or more blocks Blocks or clusters correspond to one or more sectors on a disk’s single track or cylinder File extension Name of file includes identification of what type of file it is File Association The file specifies which program it is to be used with Copyright 2013 John Wiley & Sons, Inc.

Terminology Noncontiguous Logical view Physical view Sequential access Contents and attributes of files viewed by the user Physical view The actual way a file is stored within the computer system Sequential access Data files whose records always have to be retrieved from the beginning Random or relative access Data files whose records can be retrieved from anywhere in the file in random sequence Contiguous The blocks that hold a particular file are stored together Noncontiguous The blocks that hold a particular file are scattered all over the device Copyright 2013 John Wiley & Sons, Inc.

Database File – Table Image Copyright 2013 John Wiley & Sons, Inc.

Database File – Form Image Copyright 2013 John Wiley & Sons, Inc.

Database File – Stream Image Closer to physical representation of file Example: YouTube video Copyright 2013 John Wiley & Sons, Inc.

Logical View vs. Physical View Copyright 2013 John Wiley & Sons, Inc.

File Management System Provides a logical view for the user and hides the physical implementation Consistent set of commands that are translated to a form appropriate for the device Consistent view of files regardless of file type, file characteristics, or device Supports manipulation of data within the file Manages directory structures that are presented in a logical view Command shell takes user file commands and program file requests and translates them for the file manager Requests data transfers from I/O device drivers File security and protection of file integrity Copyright 2013 John Wiley & Sons, Inc.

File Manager Request Handling Copyright 2013 John Wiley & Sons, Inc.

File Operations (1) File as a whole Copy, Move List, Print Load and execute a program Load file into memory Store file from memory Append data from memory to file Compile, assemble a file Copyright 2013 John Wiley & Sons, Inc.

File Operations (2) Within a file Open a file Read a number of bytes from file Write a number of bytes to a file Move the file pointer forward or backward Move file pointer to beginning of a file Close a file Copyright 2013 John Wiley & Sons, Inc.

File Operations (3) Record Storage Retrieve a record (read) Store a record (write) Add a record to a file Delete a record Modify contents of a record Copyright 2013 John Wiley & Sons, Inc.

File Directory Operations Create a new (empty) file Move a file from one directory to another Rename a file Append one file to another Delete a file Copyright 2013 John Wiley & Sons, Inc.

File Management and I/O Functions Separation between the two allows I/O devices to change while keeping the file system the same Simple redirection of data Copyright 2013 John Wiley & Sons, Inc.

File Access Methods Sequential Access Random Access Indexed Access File is read in sequence from beginning to end Majority of all files Program source and binary files Random Access Assumes file is made up of fixed length logical records Hashing is a common method used to calculate the location of an internal logical record Indexed Access Additional means for accessing and viewing records in a file Key indexes ISAM – indexed sequential access method Copyright 2013 John Wiley & Sons, Inc.

Physical File Storage Contiguous Non-contiguous Examples Linked Indexed Examples DOS/Windows FAT UNIX i-nodes Windows NTFS Free space management Copyright 2013 John Wiley & Sons, Inc.

Contiguous Storage Allocation Assign blocks (all in a row) to hold the file Access is simple for both sequential and random methods Disadvantages Space must be large enough Have to take into account file growth May need to be moved if it outgrows its space Fragmentation of disk Allocation strategies to minimize fragmentation First-fit, best-fit Eventually disk becomes fragmented Copyright 2013 John Wiley & Sons, Inc.

Linked Allocation Non-contiguous Each block contains a link to the next physical block Variant – links in both directions Advantages No fragmentation Adding to a file is easy Disadvantages Not usable for random access Additional disk head searching Overhead in storing the pointers Recovery of a defective block is difficult Copyright 2013 John Wiley & Sons, Inc.

File Allocation Contiguous Storage Allocation Linked Allocation Copyright 2013 John Wiley & Sons, Inc.

Windows FAT File Allocation Table (FAT) Disadvantages Linked allocation with links stored in a table Table contains the first block of each file on the disk or disk partition Successive blocks contain a link to the next block Disadvantages Requires a tremendous amount of space File integrity can be easily compromised Copyright 2013 John Wiley & Sons, Inc.

File Allocation Table Linked Allocation and File Allocation Table Copyright 2013 John Wiley & Sons, Inc.

Indexed Allocation Non-contiguous All link pointers for a file are stored together in a single block called the index block One index block per file Advantages No fragmentation Can be used for random access Disadvantage Slower due to additional access of the index block Additional disk head searching Recovery of a defective block is difficult Copyright 2013 John Wiley & Sons, Inc.

Indexed Allocation Index blocks for indexed allocation of linked files shown in File Allocation Table diagram, Figure 17.7 Copyright 2013 John Wiley & Sons, Inc.

Unix i-nodes Indexed file allocation Index block contains Advantages File attributes 10 direct blocks 1 single indirect 1 double indirect 1 triple indirect Advantages Fast for small blocks Can accommodate very large files—hundreds of gigabytes Copyright 2013 John Wiley & Sons, Inc.

Unix i-nodes Copyright 2013 John Wiley & Sons, Inc.

Windows NTFS Dynamically sized volumes Volumes may be a fraction of a disk or span many disks Master File Table (MFT) of 1KB records First 16 records are metadata files that describe the volume First record stores the MFT attributes Each file has an MFT entry File records made up of attributes, including file information and data Copyright 2013 John Wiley & Sons, Inc.

NTFS Volume Layout Copyright 2013 John Wiley & Sons, Inc.

Microsoft Resilient File System (ReFS) Copyright 2013 John Wiley & Sons, Inc.

Free Space Management Bit map method Linked list method One bit for each block to indicate if it is used or free Linked list method Pointer to first free block Each free block has a pointer to the next Blocks are allocated from the beginning Deleted files are placed at the end Copyright 2013 John Wiley & Sons, Inc.

Other Secondary Storage Allocation Tape Allocation Not practical to reallocate space in the middle of the tape Files that grow must be re-written Files are stored contiguously whenever possible Optical drives and flash drive file allocation Similar to that of hard disks UDF (Universal Data Format) supports up to two terabytes of data Hierarchical directory format Support for both HD-DVD and Blu-Ray DVD formats Copyright 2013 John Wiley & Sons, Inc.

Partitions, File Systems, Volumes, and Pools Copyright 2013 John Wiley & Sons, Inc.

Directory Structure Provides a means of organization so that files can be located easily and efficiently Hides the physical devices from the logical view of the files Partitions Independent subsections of a device Volume Directory structure for a particular partition Needs to be mounted to be incorporated into the overall file system structure Contains file attributes Copyright 2013 John Wiley & Sons, Inc.

Tree-Structure Directory Hierarchical with a top-level root directory from which all other directories stem All directories and files have names Separator Used to indicate subdirectories and files located in a directory / UNIX \ DOS, Windows Pathname Absolute – full pathname starting from the root directory Relative – pathname is created starting from the current directory Search Paths Directory locations that the operating system uses to locate files Copyright 2013 John Wiley & Sons, Inc.

Tree-Structure Directory For our examples, root is on disk device C: Pathname Examples: Absolute: C:\FINANCE\QUICKEN\Q.EXE Relative from the FINANCE directory: QUICKEN\Q.EXE Search Path: PATH=C:\DOS;C:\FINANCE\QUICKEN Now the programs in the two directories can be run by specifying the name of the program without the absolute or relative pathnames Copyright 2013 John Wiley & Sons, Inc.

Acyclic Directory Structures Tree-structure that permits links between separate branches of the tree Advantage Easy user access Disadvantages Cycles and dangling links Examples Windows shortcuts Unix hard and symbolic links MacIntosh aliases Copyright 2013 John Wiley & Sons, Inc.

An Acyclic-Graph Directory Copyright 2013 John Wiley & Sons, Inc.

Graph with a Cycle Copyright 2013 John Wiley & Sons, Inc.

Hard Links vs. Symbolic Links Copyright 2013 John Wiley & Sons, Inc.

Network File Access FTP Network file systems File Transfer Protocol Part of the TCP/IP protocol family Network file systems Windows Drive letters aliased to remote file systems UNIX Network File System (NFS) Remote Procedure Call (RPC) Copyright 2013 John Wiley & Sons, Inc.

Typical NFS Configuration Copyright 2013 John Wiley & Sons, Inc.

Data Storage Approaches Standard client server configuration Storage area network configuration Copyright 2013 John Wiley & Sons, Inc.

File Protection Logins and passwords Most systems provide three forms of protection on files Read protection Write protection Execution protection Access control list (ACL) List of users who may access the file for each of the forms of protection Tremendous overhead if there are a lot of users Owner/Group/Everyone protection method UNIX, Linux Copyright 2013 John Wiley & Sons, Inc.

File Directory Showing Protection ls –lF list files in directory using a long format and indicate file type 10-char code for file protection 1st char d for directory, - for file, s for symbolic link 2nd to 4th char permissions for the owner 5th to 7th char permissions for the group 8th to 10th char permissions for everyone r - read permission, w - write permission, x - execute permission Copyright 2013 John Wiley & Sons, Inc.

Journaling File Systems Log file records every system transaction that requires a write access to the file system Two levels of capability Protect the integrity of the file system structure only Example: Windows NTFS file system Also guarantees the integrity of data that has not yet been written to the disk Examples: Linux ext3 and ext4, IBM JFS Copyright 2013 John Wiley & Sons, Inc.

Copyright 2013 John Wiley & Sons All rights reserved. Reproduction or translation of this work beyond that permitted in section 117 of the 1976 United States Copyright Act without express permission of the copyright owner is unlawful. Request for further information should be addressed to the Permissions Department, John Wiley & Sons, Inc. The purchaser may make back-up copies for his/her own use only and not for distribution or resale. The Publisher assumes no responsibility for errors, omissions, or damages caused by the use of these programs or from the use of the information contained herein. Copyright 2013 John Wiley & Sons, Inc.