Understanding Operating Systems Seventh Edition Chapter 8 File Management.

Slides:



Advertisements
Similar presentations
Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Advertisements

Chapter 4 : File Systems What is a file system?
Understanding Operating Systems Sixth Edition
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.
Chapter 10: File-System Interface
Understanding Operating Systems Fifth Edition
1 Chapter 11: File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection  Chapter.
Chapter Eight : File Management
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
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.
Chapter 11: File System Implementation
Chapter 12 File Management
Chapter 12 File Management
Connecting with Computer Science, 2e
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.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
METU Department of Computer Eng Ceng 302 Introduction to DBMS Disk Storage, Basic File Structures, and Hashing by Pinar Senkul resources: mostly froom.
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
1 File Management Chapter File Management File management system consists of system utility programs that run as privileged applications Input to.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 13 Disk Storage, Basic File Structures, and Hashing.
File Management Chapter 12.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Chapter 8 File Management
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
Objectives Learn what a file system does
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.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 10-1: File Systems Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 17 Disk Storage, Basic File Structures, and Hashing.
Understanding Operating Systems Seventh Edition
Chapter pages1 File Management Chapter 12.
Understanding Operating Systems 1 Chapter Eight : File Management The File Manager Interacting With File Manager File Organization Physical Storage Allocation.
Understanding Operating Systems Fifth Edition Chapter 8 File Management.
Chapter 8 File Management Understanding Operating Systems, Fourth Edition.
1 Chapter 17 Disk Storage, Basic File Structures, and Hashing Chapter 18 Index Structures for Files.
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.
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.
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.
File Management The File Manager Interacting With File Manager
Understanding Operating Systems Seventh Edition
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.
File Structures. 2 Chapter - Objectives Disk Storage Devices Files of Records Operations on Files Unordered Files Ordered Files Hashed Files Dynamic and.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
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.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally FILE SYSTEM.
Chapter 5 Record Storage and Primary File Organizations
W4118 Operating Systems Instructor: Junfeng Yang.
SVBIT SUBJECT:- Operating System TOPICS:- File Management
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.
File-System Management
Understanding Operating Systems Seventh Edition
Chapter 11: File System Implementation
Chapter 11: File-System Interface
File Management.
Chapter 11: File System Implementation
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
Files Management – The interfacing
Chapter 16 File Management
Lecture 4: File-System Interface
Presentation transcript:

Understanding Operating Systems Seventh Edition Chapter 8 File Management

Understanding Operating Systems,7e Learning Objectives The fundamentals of file management File-naming conventions, including the role of extensions The difference between fixed-length and variable- length record format The advantages and disadvantages of several file storage techniques Comparisons of sequential and direct file access Access control techniques and how they compare The role of data compression in file storage 2

Understanding Operating Systems,7e The File Manager File management system –Software File access responsibilities –Creating, deleting, modifying, controlling File Manager’s efficiency directly affected by: –How the system’s files are organized –How files are stored –How each file’s records are structured –How user access to all files is protected 3

Understanding Operating Systems,7e Responsibilities of the File Manager Four tasks –File storage tracking –Policy implementation Determine where and how files are stored Efficiently use available storage space Provide efficient file access –File allocation if user access cleared Record file use –File deallocation Return file to storage Communicate file availability 4

Understanding Operating Systems,7e Responsibilities of the File Manager (cont'd.) Policy determines: –File storage location –System and user access Uses device-independent commands Access to material –Two factors Factor 1: flexibility of access to information –Share files –Provide distributed access –Allow users to browse public directories 5

Understanding Operating Systems,7e Responsibilities of the File Manager (cont'd.) Factor 2: subsequent protection –Prevent system malfunctions –Security checks Account numbers and passwords File allocation –Activate secondary storage device, load file into memory, and update records File deallocation –Update file tables, rewrite file (if revised), and notify waiting processes of file availability 6

Understanding Operating Systems,7e Definitions Field Record File –Program files –Data files Flat Files Database Directories (folders) 7

Understanding Operating Systems,7e Interacting with the File Manager Most common user commands –OPEN, DELETE, RENAME, COPY Or Linux Command Line –cd, cp, rm, mkdir, rmdir, etc 8 (figure 8.2) Typical menu of file options. © Cengage Learning 2014

Understanding Operating Systems,7e Interacting with the File Manager Device-independent –Physical location: knowledge not needed Cylinder, surface, sector –Device medium: knowledge not needed Tape, magnetic disk, optical disc, flash storage –Network knowledge: not needed 9

Understanding Operating Systems,7e Interacting with the File Manager (cont'd.) Logical commands –Broken into lower-level signals –Example: READ Move read/write heads to record cylinder Wait for rotational delay (sector containing record passes under read/write head) Activate appropriate read/write head and read record Transfer record to main memory Send flag indicating free device for another request System monitors for error conditions 10

Understanding Operating Systems,7e Typical Volume Configuration Volume –Secondary storage unit (removable, nonremovable) –Multi-file volume Contains many files –Multi-volume files Extremely large files spread across several volumes 11

Understanding Operating Systems,7e Typical Volume Configuration (cont'd.) 12 (figure 8.3) The volume descriptor, which is stored at the beginning of each volume, includes this vital information about the storage unit. © Cengage Learning 2014

Understanding Operating Systems,7e Typical Volume Configuration (cont'd.) Master file directory (MFD) Stored immediately after volume descriptor Lists –Names and characteristics of every file in volume File names (program files, data files, system files) –Subdirectories If supported by file manager –Remainder of volume Used for file storage 13

Understanding Operating Systems,7e Volume Configuration Evolution Single directory per volume Master File Directory linking to Sub-directories Users allowed to create own sub-directories –Symbolic links allow alternate directory paths 14

Understanding Operating Systems,7e15 (figure 8.4) File directory tree structure. The “root” is the MFD shown at the top, each node is a directory file, and each branch is a directory entry pointing to either another directory or to a real file. All program and data files subsequently added to the tree are the leaves, represented by circles. © Cengage Learning 2014

Understanding Operating Systems,7e Introducing Subdirectories (cont'd.) File descriptor –Filename: each must be unique (within directory) –File type: organization and usage System dependent - (file extensions in Windows) –File size: for convenience –File location Identifies first physical block (or all blocks) –Date and time of creation –Owner –Protection information: access restrictions –Record size: fixed size, maximum size 16

Understanding Operating Systems,7e17 (table 8.1) File name parameters for several operating systems. © Cengage Learning 2014

Understanding Operating Systems,7e File Organization Arrangement of records within files All files composed of records Modify command –Request to access record within a file 18

Understanding Operating Systems,7e Record Format (cont'd.) 19 (figure 8.5) Data stored in fixed length fields (top) that extends beyond the field limit is truncated. Data stored in variable length fields (bottom) is not truncated. © Cengage Learning 2014

Physical File Organizations Sequential record organization –Records stored and retrieved serially One after the other –Easiest to implement –File search: beginning until record found –Optimization features may be built into system Select key field from record and sort before storage Complicates maintenance algorithms Preserve original order when records added, deleted –Advantages and disadvantages? Understanding Operating Systems,7e20

Physical File Organizations Direct record organization –Direct access files –Requires direct access storage device Random organization in random access files –Relative address record identification Known as logical addresses Computed when records stored and retrieved –Hashing algorithms Transform each key into a number –Advantages and Disadvantages? Understanding Operating Systems,7e21

Understanding Operating Systems,7e22 (figure 8.6) The hashing algorithm causes a collision. Using a combination of street address and postal code, it generates the same logical address ( ) for three different records. © Cengage Learning 2014

Physical File Organizations Indexed sequential record organization –Advantages and Disadvantages Database Variant –B-tree Index files with Heap organized tables –Advantages and Disadvantages Understanding Operating Systems,7e23

Understanding Operating Systems,7e Physical Storage Allocation File manager works with files –As whole units –As logical units or records Within file –Records must have same format –Record lengths may vary Records subdivided into fields –Application programs manage record structure File storage –Refers to record storage 24

Understanding Operating Systems,7e25 (figure 8.7) Every record in a file must have the same format but can be of different sizes, as shown in these five examples of the most common record formats. The supplementary information in (b), (c), (d), and (e) is provided by the File Manager, when the record is stored. © Cengage Learning 2014

Contiguous Storage Records stored one after another –Advantages Any record found once starting address, size known Easy direct access –Disadvantages Difficult file expansion; fragmentation Understanding Operating Systems,7e26 (figure 8.8) With contiguous file storage, File A can’t be expanded without being rewritten to a larger storage area. File B can be expanded, by only one record replacing the free space preceding File C. © Cengage Learning 2014

Understanding Operating Systems,7e27 (figure 8.9) Noncontiguous file storage with linking taking place at the storage level. File 1 starts in address 2 and continues in addresses 8, 20, and 18. The directory lists the file’s starting address, ending address, and the number of extents it uses. Each block of storage includes its address and a pointer to the next block for the file, as well as the data itself. © Cengage Learning 2014

Understanding Operating Systems,7e28 (figure 8.10) Noncontiguous storage allocation with linking taking place at the directory level for the files shown in Figure 8.9. © Cengage Learning 2014

Understanding Operating Systems,7e Indexed Storage Allows direct record access –Index block Brings pointers together linking every extent file Every file has own index block –Disk sector addresses for file –Lists entry in order sectors linked Supports sequential and direct access Does not necessarily improve storage space use Larger files experience several index levels 29

Understanding Operating Systems,7e30 (figure 8.11) Indexed storage allocation with a one- level index, allowing direct access to each record for the files shown in Figures 8.9 and © Cengage Learning 2014

Access Methods Dictated by a file organization Most flexibility: indexed sequential files Least flexible: sequential files Sequential file organization –Supports only sequential access Records: fixed or variable length –Access next sequential record Use address of last byte read –Current byte address (CBA) Updated every time record accessed Understanding Operating Systems,7e31

Understanding Operating Systems,7e32 (figure 8.12) Fixed- versus variable-length records. (a) Fixed-length records have the same number of bytes, so record length (RL) is the constant x. (b) With variable- length records, RL isn’t a constant. Therefore, it’s recorded on the sequential media immediately preceding each record. © Cengage Learning 2014

Understanding Operating Systems,7e Access Methods Direct File Organization –Fixed-length records (RN: desired record number) CBA = (RN – 1) * RL –Variable-length records Virtually impossible Indexed Sequential File Organization –Accessed sequentially or directly –Index file searched for pointer to data block 33

Understanding Operating Systems,7e Levels in a File Management System 34 (figure 8.13) Typical modules of a file management system showing how information is passed from the File Manager to the Device Manager. © Cengage Learning 2014

Access Control Verification Module File sharing –Data files, user-owned program files, system files –Advantages Save space, synchronized updates, resource efficiency –Disadvantage Need to protect file integrity –File actions READ only, WRITE only, EXECUTE only, DELETE only, or a combination Understanding Operating Systems,7e35

Understanding Operating Systems,7e Access Control Matrix Advantages –Easy to implement –Works well in system with few files, users 36 (table 8.3) The access control matrix showing access rights for each user for each file. © Cengage Learning 2014

Understanding Operating Systems,7e Access Control Matrix (cont'd.) Disadvantages –As files and/or users increase, matrix increases Possibly beyond main memory capacity –Wasted space: due to null entries 37 (table 8.4) The five access codes for User 2 from Table 8.3. The resulting code for each file is created by assigning a 1 for each checkmark, and a 0 for each blank space. © Cengage Learning 2014

Access Control Lists Modification of access control matrix technique Understanding Operating Systems,7e38 (table 8.5) An access control list showing which users are allowed to access each of the five files. This method uses storage space more efficiently than an access control matrix. © Cengage Learning 2014

Understanding Operating Systems,7e Access Control Lists (cont'd.) Contains user names granted file access –User denied access grouped under “WORLD” Shorten list by categorizing users –SYSTEM (ADMIN) Personnel with unlimited access to all files –OWNER (USER) Absolute control over all files created in own account –GROUP All users belonging to appropriate group have access –WORLD All other users in system 39

Understanding Operating Systems,7e Capability Lists Lists every user and respective file access Can control access to devices as well as to files Most common 40 (table 8.6) A capability list shows files for each user and requires less storage space than an access control matrix. © Cengage Learning 2014

Data Compression Saves space in files Two algorithm types –Lossless: retains all data in the file Text or arithmetic files applications –Lossy: removes some data without compromising file quality Image and sound file applications Understanding Operating Systems,7e41

Text Compression Records with repeated characters –Repeated characters are replaced with a code Repeated terms –Compressed using symbols to represent most commonly used words –University student database common words Student, course, grade, department each are represented with single character Front-end compression –Entry takes given number of characters from previous entry that they have in common Understanding Operating Systems,7e42

Understanding Operating Systems,7e Image and Sound Compression Lossy compression –Irreversible: original file cannot be reconstructed Compression algorithm highly dependent on file type –JPEG: still images –MPEG: video images International Organization for Standardization (ISO) –World’s leading developer of international standards 43

Understanding Operating Systems,7e Conclusion File manager –Controls every file and processes user commands –Manages access control procedures Maintain file integrity and security –File organizations Sequential, direct, indexed sequential –Physical storage allocation schemes Contiguous, noncontiguous, indexed –Record types Fixed-length versus variable-length records Access control methods Data compression techniques 44