Operating System Concepts and Techniques Lecture 17

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

Chapter 4 : File Systems What is a file system?
Free Space and Allocation Issues
File Systems.
Operating Systems File Systems CNS 3060.
File System Implementation CSCI 444/544 Operating Systems Fall 2008.
File Systems Topics –File –Directory –File System Implementation Reference: Chapter 5: File Systems Operating Systems Design and Implementation (Second.
Ceng Operating Systems
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
1 File Management in Representative Operating Systems.
CS 333 Introduction to Operating Systems Class 17 - File Systems Jonathan Walpole Computer Science Portland State University.
1 Friday, July 07, 2006 “Vision without action is a daydream, Action without a vision is a nightmare.” - Japanese Proverb.
Chapter 4 File Systems Files Directories Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Chapter 5 Part 2 Secondary Storage Mgt. File Mgt. in Popular OSs
File Systems (1). Readings r Silbershatz et al: 10.1,10.2,
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Files CS Spring Overview Example: FAT File System File Organization File System Organization –File Directories and File Sharing –Record Blocking.
File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
NETW3005 File System Interface. Reading For this lecture, you should have read Chapter 10 (Sections 1-5) and Chapter 11 (Sections 1-4). NETW3005 (Operating.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved Chapter 5 File Management File Overview.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
CSCI-375 Operating Systems Lecture Note: Many slides and/or pictures in the following are adapted from: slides ©2005 Silberschatz, Galvin, and Gagne Some.
CS333 Intro to Operating Systems Jonathan Walpole.
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.
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.
Operating System Concepts and Techniques Lecture 18 Information management-2* FFS, UFS2, NTFS M. Naghibzadeh Reference M. Naghibzadeh, Operating System.
Some basic concepts and information on file systems Portions taken and modified from books by ANDREW S. TANENBAUM.
Chapter 16 File Management The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander John.
Why Do We Need Files? Must store large amounts of data. Information stored must survive the termination of the process using it - that is, be persistent.
File Systems. 2 What is a file? A repository for data Is long lasting (until explicitly deleted).
CS 333 Introduction to Operating Systems Class 17 - File Systems Jonathan Walpole Computer Science Portland State University.
Lecture 10 Page 1 CS 111 Summer 2013 File Systems Control Structures A file is a named collection of information Primary roles of file system: – To store.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems File systems.
File Systems cs550 Operating Systems David Monismith.
Chapter 6 File Systems. Essential requirements 1. Store very large amount of information 2. Must survive the termination of processes persistent 3. Concurrent.
Review CS File Systems - Partitions What is a hard disk partition?
File Systems - Part I CS Introduction to Operating Systems.
File Systems.  Issues for OS  Organize files  Directories structure  File types based on different accesses  Sequential, indexed sequential, indexed.
操作系统原理 OPERATING SYSTEMS Chapter 4 File Systems 文件系统.
1 Lecture 15: File System Interface  file system interface reasons for delegating storage management to OS file definition and operations on a file file.
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
W4118 Operating Systems Instructor: Junfeng Yang.
File-System Management
Chapter 11: File System Implementation
File System Structure How do I organize a disk into a file system?
Chapter 11: File System Implementation
Operating Systems (CS 340 D)
Filesystems.
Subject Name: Operating Systems Subject Code:10CS53
Chapter 11: File System Implementation
File Systems Kanwar Gill July 7, 2015.
File Structure 2018, Spring Pusan National University Joon-Seok Kim
CS510 Operating System Foundations
Chapter 11: File System Implementation
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
File System Implementation
Chapter 16 File Management
Chapter 14: File-System Implementation
Secondary Storage Management Hank Levy
Chapter 11: File System Implementation
Department of Computer Science
Lecture 4: File-System Interface
Chapter 5 File Systems -Compiled for MCA, PU
Presentation transcript:

Operating System Concepts and Techniques Lecture 17 Information management-1* Foundations and UNIX/Linux File System M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First ed., iUniverse Inc., 2011. To order: www.iUniverse.com, www.barnesandnoble.com, or www.amazon.com * Information management is not usually covered in the first university course of operating systems

Storage media Disk pack: An structured hardware consisting of Many plates, two surfaces per plate, many same capacity tracks on each surface, many same capacity sectors on each track Disk model Each partition Partition 1 Partition 2 .... Partition k Sector 1 Sector 1 Sector 2 … … … Sector mn ... Track 0 Track m-1

File An structure of vast amount of information to be stored on persistent media, could be Collection of bytes ASCII Binary Collection of records Tree structure File types Regular: user files Directories: meta data about files Special Files: for example, I/O files for printer Block special: files for tapes, disks

File Attributes/Data/operations/access Each file consists of: Attributes: owner, creator, password, Archive/system, Hidden, lock, temporary, random access, ASCII/Binary, time of last access, creation time, key length, key position, record length, max size, current size, time of last change etc. Data Valid operations are: create, delete, open, close, read, write, append, seek, get attributes, set attributes, rename File access: Sequential, random

Storage allocation Contiguous allocation: a file (or directory) is considered a chunk of data that must be stored in a contiguous data area of the storage device Size of each file is a multiple of blocks Block size is a power of two sectors Advantages: address calculation is simple For sequential access prefetch is possible Disadvantage External fragmentation May require frequent defragmentation Disk attributes, metadata, … File 1 File 2 … File i Unallocated area

Storage allocation... Chained allocation: Data blocks of a file need not take a contiguous area, but they are chained together Advantage No external fragmentation Disadvantages: Address calculation is difficult Random access is time consuming and needs excessive disk access Disk attributes, metadata, …

Storage allocation... Indexed allocation: any block of data can sit in any block frame of disk Index table(s), will make note of which block is stored where, it uses disk block numbers instead of the physical address of the block; options are: Only one table: like FAT One table for every file or directory: like UNIX Advantages: No external fragmentation index table is usually in the main memory thus rendering both sequential and random access to files and directories efficient

Other topics Free space management Bad block management Chained free pieces Bitmap Index table Bad block management Substitute sectors File of bad blocks

Directory tree/directory Directory tree: the organization of files and directories, on a volume, in the form of a tree Directory: a folder of files and subdirectories and their handles Figure 1 Directory operations: Create, delete, opendir, closedir, readdir, rename, link, unlink B C R S W X A D P Q L K Directory File

UNIX File System(USF) Structure of a partition is: Superblock has attributes and metadata of the file system itself; size in blocks of the file system; size in blocks of the i-node list, number of free blocks and i-nodes, free block list Indexed allocation is used to allocate available blocks to file and directory data. Every file or directory has its own index table The index table is a special one, called index-node (or i-node for short) The length of all i-nodes is the same, usually 64 bytes and the total number If total number of i-nodes is say 1024, then the space requirement for this area is 64*1024 bytes or 64 kilo bytes Boot block Superblock i-node list Data blocks

UNIX File System(USF)… Root does not have a name, instead its i-node is the first i-node of the i-node list At computer start/restart root directory becomes current directory The last 4 rows of I-node needs special attention File mode Flags for file type, execution, owner permissions, Group permissions, and other permissions Link count Number of links to this i-node OwnerID ID of the owner GroupID ID of the group of the owner of this file File size File size in bytes Last accessed Time of last access Last modified Time of last modification Inode modified Time of last i-node modification Direct addresses Ten direct addresses Single indirect addresses Pointer to a block of addresses Double indirect addresses Triple indirect addresses Some information of i-node

I-node In memory i-node is 64 bytes; the rest is on disk extensions Ten block address for the file data (3 bytes each) One single indirect One double indirect One triple indirect . Data blocks Table of pointers File or directory attributes 10 Direct pointers to data blocks Single indirect Double indirect Triple indirect

Largest file size Varies with: block sizes; assume 1K Size of disk addresses used; assume 4 bytes Direct addresses: total 10K Single indirect addresses: total 256K Double indirect addresses: total 256*256K Triple indirect addresses: total 256*256*256K Overall total:(10+256+256*256+256*256*256)K Not too big, but a larger block size allows a larger file

(b) Directory C’s data of Figure 1 Root directory’s data of Figure 1 Directory data 2 bytes 14 bytes Format of directory data records I-node number File name 1 00 5 A 8 B 6 C 4 D 6 1 00 12 S 9 R (b) Directory C’s data of Figure 1 Data block no 120 Root directory’s data of Figure 1 Data block no 100 Figure 2: The structure of directory data blocks

Looking for a file’s data How can the file Q’s data storage location be found? The operating system goes to current directory’s i-node and locates Q and its i-node number Suppose file Q is not in the current directory but its absolute path is say /C/S/Q The file system will access i-node number 1 and search for the root’s data location (data block no 100, Figure 2a) It looks for C and its i-node number which is 6; using i-node number six it looks for directory C’s data block (say no. 120) In this databblock (Figure 2b) the file system looks for S and its i-node number (say 12) It continues this process until Q’s i-node number is found; using this i-node the file system searches for Q’s data storage blocks.

Advantage/Disadvantage Advantages: i-nodes can be shared while in main memory, hence file sharing Fast processing Disadvantage: i-node updates are not instant, in memory i-node may be changed while on disk is something different

Summary Caches and main memories lose their contents as soon as the computer is turned off We must store persistent information on persistent devices The well thought out organization of information in secondary storage, especially in light of its vastness, is extremely crucial This responsibility lies with the file system Many file systems have been developed to address this task In this lecture, the design foundation of file systems was studied The design details of a major file systems, the UNIX File System (UFS) was thoroughly investigated

Find out The differences between Unix file system and Linux file system All the information that is stored in a 64 byte i-node Why the name of files and subdirectories of a directory should not be stored within the i-node of that directory and they have to be stored in data blocks? The difference between a file system and a file How can a file be organized to represent all bad blocks of a disk What is the usage of a substitute sector

Any questions?