CSE 451: Operating Systems Autumn 2001 Module 16 File Systems

Slides:



Advertisements
Similar presentations
More on File Management
Advertisements

Chapter 10: File-System Interface
Chapter 10: File-System Interface
File System Interface CSCI 444/544 Operating Systems Fall 2008.
CS 104 Introduction to Computer Science and Graphics Problems Operating Systems (4) File Management & Input/Out Systems 10/14/2008 Yang Song (Prepared.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 10: File-System Objectives To discuss file-system design tradeoffs, including.
1 Friday, July 07, 2006 “Vision without action is a daydream, Action without a vision is a nightmare.” - Japanese Proverb.
1 Course Outline Processes & Threads CPU Scheduling Synchronization & Deadlock Memory Management File Systems & I/O Networks, Protection and Security.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
CSE 451: Operating Systems Winter 2010 Module 14 File Systems Mark Zbikowski Gary Kimura.
CS 153 Design of Operating Systems Spring 2015 Lecture 20: File Systems.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Computer Studies (AL) File Management File system interface.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Disks. Secondary Storage Secondary Storage Typically – Storage systems outside of “primary memory” – Cannot access data using load/store instructions.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
Lecture Topics: 11/29 File System Interface –Files and Directories –Access Methods –Protection –Consistency.
File Systems - Part I CS Introduction to Operating Systems.
CSE 451: Operating Systems Winter 2015 Module 15 File Systems Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska, Levy, Zahorjan.
W4118 Operating Systems Instructor: Junfeng Yang.
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 Interface CSSE 332 Operating Systems
Operating Systems ECE344 Lecture 11: File System Ding Yuan.
Chapter 11: File System Implementation
Chapter 12: File System Implementation
CSE 120 Principles of Operating
Operating System Structure
Filesystems.
File Management.
Subject Name: Operating Systems Subject Code:10CS53
File Sharing Sharing of files on multi-user systems is desirable
Operation System Program 4
Chapter 11: File System Implementation
CSE 451: Operating Systems Spring 2012 Module 15 File Systems
CSE 451: Operating Systems Spring 2013 Module 15 File Systems
CSE 153 Design of Operating Systems Winter 2018
CE Operating Systems Lecture 21
Chapter 2: System Structures
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Chapter 10: File-System Interface
CSE 451: Operating Systems Autumn 2004 File Systems
CSE 451: Operating Systems Winter 2007 Module 14 File Systems
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.
CSE 451: Operating Systems Autumn 2003 Lecture 13 File Systems
IT 344: Operating Systems Winter 2008 Module 14 File Systems
Secondary Storage Management Brian Bershad
Chapter 10: File-System Interface
Files Management – The interfacing
Chapter 16 File Management
CSE 542: Operating Systems
CSE 451: Operating Systems Winter 2009 Module 14 File Systems
CSE 451: Operating Systems Winter 2004 Module 14 File Systems
CSE 451: Operating Systems Winter 2003 Lecture 13 File Systems
CSE 153 Design of Operating Systems Winter 2019
Operating System File-System Interface
CSE 451: Operating Systems Spring 2008 Module 14 File Systems
Secondary Storage Management Hank Levy
CS703 - Advanced Operating Systems
Services for Non-Volatile Storage
Chapter 14: File System Implementation
CSE 451: Operating Systems Autumn 2009 Module 14 File Systems
CSE 451: Operating Systems Autumn 2010 Module 14 File Systems
Lecture 4: File-System Interface
CSE 451: Operating Systems Autumn 2001 Lecture 13 File Systems
Chapter 5 File Systems -Compiled for MCA, PU
Introduction to Operating Systems
File Systems CSE 2431: Introduction to Operating Systems
Presentation transcript:

CSE 451: Operating Systems Autumn 2001 Module 16 File Systems Mark Zbikowski and Gary Kimura 1

File Systems Once upon a time… The concept of a file system is simple Programmers left taped notes on a disk drive telling which tracks/platters they’d used. Crude, buggy, but effective The concept of a file system is simple the implementation of the abstraction for secondary storage “blocks” aren’t pretty abstraction = files logical organization of files into directories the directory hierarchy sharing of data between processes, people and machines access control, consistency, reliability… 11/13/2018

Files A file is a collection of data with some properties contents, size, owner, last read/write time, protection … These are “exposed on the outside” Files may also have “types” understood by I/O system only device, directory, symbolic link understood by other parts of OS or by runtime libraries executable, dll, source code, object code, text file, … Or by applications (Explorer, Internet Explorer) Type can be encoded in the file’s name or contents Windows/unix encodes type in name .com, .exe, .bat, .dll, .jpg, .mov, .mp3, … in content via magic numbers or initial characters (e.g., #!) 11/13/2018

Basic operations NT Unix CreateFile(name, CREATE) create(name) CreateFile(name, OPEN) ReadFile(handle, …) WriteFile(handle, …) FlushFileBuffers(handle, …) SetFilePointer(handle, …) CloseHandle(handle, …) DeleteFile(name) CopyFile(name) MoveFile(name) Unix create(name) open(name, mode) read(fd, buf, len) write(fd, buf, len) sync(fd) seek(fd, pos) close(fd) unlink(name) rename(old, new) 11/13/2018

File Access Methods Some file systems provide different access methods that specify ways the application will access data sequential access read bytes one at a time, in order direct access random access given a block/byte # record access file is array of fixed- or variable-sized records indexed access FS contains an index to a particular field of each record in a file apps can find a file based on value in that record (similar to DB) Why do we care about distinguishing sequential from direct access? what might the FS do differently in these cases? 11/13/2018

Directories Directories provide: a way for users to organize their files a convenient file name space for both users and FS’s dating to Multics (1960s) Most file systems support multi-level directories naming hierarchies (/, /usr, /usr/local, /usr/local/bin, …) Wide range of syntax: Multics: >System>Binaries>Dir, >Users>MarkZ>Projects>Linker.pl1 MTS: GBH1:ReadPW.asm Tops 20: <yale.cs.mark>SpaceSearch.lsp.5 Unix: /usr/local/bin/ls MSDOS: C:\DOS\ANSI.SYS Zero commonality, interchange extremely difficult 11/13/2018

Directories cont’d Most file systems support the notion of current directory absolute names: fully-qualified starting from root of FS bash$ cd /usr/local relative names: specified with respect to current directory bash$ cd /usr/local (absolute) bash$ cd bin (relative, equivalent to cd /usr/local/bin) 11/13/2018

Directory Internals A directory is (usually) just a file that happens to contain special metadata directory = list of (name of file, file attributes) attributes include such things as: size, protection, location on disk, creation time, access time, … the directory list may be unordered (effectively random) when you type “ls”, the “ls” command sorts the results for you O(n) lookup time the directory list may be sorted O(log n) lookup time Sorting for performance vs “locale sorting” 11/13/2018

Path Name Translation Let’s say you want to open “/one/two/three” fd = open(“/one/two/three”, O_RDWR); What goes on inside the file system? open directory “/” (well known, can always find) search the directory for “one”, get location of “one” open directory “one”, search for “two”, get location of “two” open directory “two”, search for “three”, get loc. of “three” open file “three” (of course, permissions are checked at each step) FS spends lots of time walking down directory paths this is why open is separate from read/write (session state) OS will cache prefix lookups to enhance performance /a/b, /a/bb, /a/bbb all share the “/a” prefix 11/13/2018

Windows vs Linux (*NIX) “Cracking” a path: two implementations LinuxVFS: namei() procedure that parses file name (on “/” boundaries) and calls open() on each intermediate object until no more Single syntax for path, enforced by system, path caching managed by system not architected for arbitrary extensibility Windows: each file system handles processing of name in a manner specific to the file system Possible duplication of code (FAT, NTFS, CDFS, UDF) Extensibility (Windows kernel designed to allow emulation of other OS environments) Antivirus applications very simple to write (i.e., “filtering” requests before file system gets control) 11/13/2018

Protection Systems FS must implement some kind of protection system to control who can access a file (user) to control how they can access it (e.g., read, write, or exec) More generally: generalize files to objects (the “what”) generalize users to principles (the “who”, user or program) generalize read/write to actions (the “how”, or operations) A protection system dictates whether a given action performed by a given subject on a given object should be allowed (and audited) e.g., you can read or write your files, but others cannot e.g., your can read /etc/motd but you cannot write to it 11/13/2018

Model for Representing Protection Two different ways of thinking about it: access control lists (ACLs) for each object, keep list of subjects and subj’s allowed actions capabilities for each subject, keep list of objects and subj’s allowed actions Both can be represented with the following matrix: objects /etc/passwd /home/gribble /home/guest root rw gribble r guest subjects capability ACL 11/13/2018

ACLs vs. Capabilities Capabilities are easy to transfer they are like keys: can hand them off they make sharing easy ACLs are easier to manage object-centric, easy to grant and revoke to revoke capability, need to keep track of subjects that have it hard to do, given that subjects can hand off capabilities (race conditions) ACLs grow large when object is heavily shared can simplify by using “groups” put users in groups, put groups in ACLs you are all in the “VMware powerusers” group on Win2K additional benefit change group membership, affects ALL objects that have this group in its ACL Multics had patterns in ACL’s (>Users>CS>Majors>*:read;write) 11/13/2018

What ELSE can file systems do? Content indexing Google/Live desktop search Separate daemons API for change notification API for “getting out of the way” Windows/Cairo indexing built into OFS file system Wildly efficient, extensibility problematic Remote access Same interface to OS (VFS, IRP) Different lower-level device (block driver vs network) Sharing/consistency issues Transactions All-or-nothing batching Coordination with other transaction-aware participants 11/13/2018

More about what file systems can do Naming is a crucial issue in operating systems What is being named? Devices, files, directories, semaphores, programs, machines, users How does one translate the name to a location? How to keep mapping between name and location when: New location is on same disk c:\newpath\file … different drive? D:\path\file … different machine? \\yourmachine\path\file … different network? ??? Unix: file system name space is everything (boot volume root) Windows: object space (relative to local machine) 11/13/2018