Naming and Directories

Slides:



Advertisements
Similar presentations
File Systems.
Advertisements

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.
Chapter 13 – File and Database Systems
File Systems Implementation
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
File Systems (1). Readings r Silbershatz et al: 10.1,10.2,
Suggested Exercise 9 Sarah Diesburg Operating Systems CS 3430.
Naming and Directories. Recall from the last time… File system components Disk management organizes disk blocks into files. Many disk blocks management.
File Systems and Disk Management. File system Interface between applications and the mass storage/devices Provide abstraction for the mass storage and.
File Implementation. File System Abstraction How to Organize Files on Disk Goals: –Maximize sequential performance –Easy random access to file –Easy.
Chapter pages1 File Management Chapter 12.
Chapter 8 File Management Understanding Operating Systems, Fourth Edition.
File System Management File system management encompasses the provision of a way to store your data in a computer, as well as a way for you to find and.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
CSCI-375 Operating Systems Lecture Note: Many slides and/or pictures in the following are adapted from: slides ©2005 Silberschatz, Galvin, and Gagne Some.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
10/28/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam.
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.
Module 4.0: File Systems File is a contiguous logical address space.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
CE Operating Systems Lecture 17 File systems – interface and implementation.
I MPLEMENTING FILES. Contiguous Allocation:  The simplest allocation scheme is to store each file as a contiguous run of disk blocks (a 50-KB file would.
Fall 2000M.B. Ibáñez Lecture 24 File-System III File System Implementation.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
W4118 Operating Systems Instructor: Junfeng Yang.
COMP 3500 Introduction to Operating Systems Directory Structures Block Management Dr. Xiao Qin Auburn University
File Systems and Disk Management
Sarah Diesburg Operating Systems COP 4610
Chapter 11: File System Implementation
Chapter 11: File System Implementation
Operating Systems (CS 340 D)
Operating Systems (CS 340 D)
Filesystems.
The UNIX File System Jerry Breecher Contains sections on:
Naming and Directories
Multimedia Information Retrieval
Advanced File Systems Issues
EECE.4810/EECE.5730 Operating Systems
Design IV Chapter 18 11/14/2018 Crowley OS Chap. 18.
Chapter 11: File System Implementation
File Systems and Disk Management
Naming and Directories
File Systems: Fundamentals.
Naming and Directories
CS Introduction to Operating Systems
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
File Systems and Disk Management
File Systems and Disk Management
Andy Wang Operating Systems COP 4610 / CGS 5765
File Systems and Disk Management
File System Implementation
Andy Wang Operating Systems COP 4610 / CGS 5765
Advanced File Systems Issues
File Systems and Disk Management
File Systems and Disk Management
File Systems and Disk Management
Chapter 11: File System Implementation
Sarah Diesburg Operating Systems CS 3430
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Department of Computer Science
SE350: Operating Systems Lecture 12: File Systems.
Andy Wang Operating Systems COP 4610 / CGS 5765
Lecture 4: File-System Interface
CSE 451: Operating Systems Winter Module 15 BSD UNIX Fast File System
Chapter 5 File Systems -Compiled for MCA, PU
File Systems CSE 2431: Introduction to Operating Systems
Presentation transcript:

Naming and Directories Andy Wang Operating Systems COP 4610 / CGS 5675

Recall from the last time… A file header associates the file with its data blocks

File Header Storage Under UNIX, a file header is stored in a data structure called i-node For early UNIX systems I-nodes are stored in a special array Fixed number of array entries Maximum number of files fixed Not stored near data blocks on disk Reading a small file involves One disk seek to get the i-node Other disk seek(s) to get file blocks

Reasons for Separate Allocations Reliability Data corruptions are unlikely to affect i-nodes Reduced fragmentation File headers are smaller than a whole block By packing them in an array, multiple headers can be fetched from disk File headers are accessed more often e.g., ls Grouping file headers improves disk efficiency

For BSD 4.2… Portions of file header array stored on each cylinder For small directories All file headers and data stored in the same cylinder Reduce seek time

Naming Remember that odd moment when your computer asks you for name the first file? Naming: allows users to issue file names instead of i-node numbers - Users tend to come up with poor names e.g., test - Many file are difficult to name…

How do you name these photos?

Directories A table of file names and their i-node numbers Under many file systems Directories are implemented as normal files Containing file names and i_node numbers Only the OS is permitted to modify directories

Name Space Flat name space Hierarchical naming Relational name space Contextual naming Content-based naming

Flat Name Space All files are stored in a single directory + Easy to implement - Not scalable for large directories Name collisions: multiple files with the same names

Hierarchical Naming Uses multiple levels of directories Most popular name space organization + Conceptual model maps well into the human model of organizing things A file cabinet contains many files + Scalable The probability of name collisions decreases + Spatial locality Store all files under a directory within a cylinder to avoid disk seeks

More on Hierarchical Naming Absolute path name: consisting the path from the root directory ‘/’ to the file e.g., /pets/cat.jpg root directory sub directory file name

Drawbacks of Hierarchical Naming - Not all files can fit into the hierarchical model - Accessing a file may involve many levels of directory lookups, or a path resolution before getting to the file content pets ? pests ?

An Example of Path Resolution To access the data content of /pets/cat.jpg The system needs to perform the following disk I/Os

An Example of Path Resolution To access the data content of /pets/cat.jpg The system needs to perform the following disk I/Os 1. Read in the file header for the root directory ‘/’ Stored at a fixed location on disk /

An Example of Path Resolution To access the data content of /pets/cat.jpg The system needs to perform the following disk I/Os 2. Read the first data block for the root directory Lookup the directory entry for pets / pets

An Example of Path Resolution To access the data content of /pets/cat.jpg The system needs to perform the following disk I/Os 3. Read the file header for pets / pets pets

An Example of Path Resolution To access the data content of /pets/cat.jpg The system needs to perform the following disk I/Os 4. Read the first data block for the pet directory Lookup the directory entry for cat.jpg / pets pets cat

An Example of Path Resolution To access the data content of /pets/cat.jpg The system needs to perform the following disk I/Os 5. Read the file header for cat.jpg / pets cat pets cat

An Example of Path Resolution To access the data content of /pets/cat.jpg The system needs to perform the following disk I/Os 6. Read the data block for cat.jpg / pets cat pets cat

Some Performance Optimizations… Top-level directories are usually cached A user inside a directory (e.g., /pets) Can issue relative path names (e.g., cat.jpg) to refer files within the current directory

Relational Name Space Hierarchical naming model is largely a tree One step beyond is the relational naming model, which allows the construction of general graphs A file can belong to multiple folders According to its attributes Files can be accessed in a manner similar to relational databases e.g., keywords: cats and blinds

Pros and Cons of Relational Name Space + More flexible than hierarchical naming - May require a long list of attributes to name a single piece of data e.g., this lecture Keywords: operating systems, file systems, naming, PowerPoint XP - Who will create those attributes?

Contextual Naming Takes advantage of the observation that certain attributes can be added automatically e.g., when you try to open a file by Word, a system will search only the file types supported by Word (.doc, .txt, .html) + Avoids a long list of attributes - A user may not remember the file name

Content-Based Naming Searches a file by its content instead of names File contents are extracted automatically e.g., I want a photo of a cat taken five years ago The system returns all files satisfying the criteria

Content-Based Naming - Requires advanced information processing techniques e.g., image recognition Many existing systems use manual indexing Automated content-based naming is still an active area of research

Example: The “Internet File System” Can be viewed as a worldwide file system What is the naming scheme for the Internet file system?

The “Internet File System” Contains shades of various naming schemes Flat name space: Each URL provides a unique name Hierarchical name space: Within individual websites Relational name space Can search the Internet via search engines Contextual name space: Page ranked according to relevance Content-based name space: You can find your information without knowing the exact file names

Example: Plan 9 Modern UNIX has a deep-rooted influence from the Plan 9 OS Developed by Bell lab Major design philosophy: everything is a file A single hierarchical name space for Processes (e.g., /proc) Files IPC (e.g., pipe) Devices (e.g., /dev/fd0) Use open/close/read/write for everything e.g., /dev/mem