File-System Management

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

FILE SYSTEM IMPLEMENTATION
Chapter 10: File-System Interface
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
Chapter 11: File System Implementation
File System Implementation
File System Implementation
Chapter 12: File System Implementation
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
Chapter 12: File System Implementation
04/05/2004CSCI 315 Operating Systems Design1 File System Implementation.
File System Implementation
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
ICS Principles of Operating Systems Lectures 14 and 15 - FileSystem Interface and Implementation Prof. Nalini Venkatasubramanian
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
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.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
Dr. T. Doom 11.1 CEG 433/633 - Operating Systems I Chapter 11: File-System Implementation File structure –Logical storage unit –Collection of related information.
Free Space Management.
Silberschatz and Galvin  Operating System Concepts File-System Implementation File-System Structure Allocation Methods Free-Space Management.
Page 111/15/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  Allocation methods: Contiguous, Linked, Indexed,
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
File System Implementation
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.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 11: File-System Interface File Concept Access Methods Directory Structure.
12.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 12: File System Implementation Chapter 12: File System Implementation.
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.
10.1 CSE Department MAITSandeep Tayal 10 :File-System Implementation File-System Structure Allocation Methods Free-Space Management Directory Implementation.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 11 File-System Implementation Slide 1 Chapter 11: File-System Implementation.
Page 112/7/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  File system structure – layered, block based.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System 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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure 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.
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
FILE SYSTEM IMPLEMENTATION 1. 2 File-System Structure File structure Logical storage unit Collection of related information File system resides on secondary.
ICS Principles of Operating Systems Lectures 14 and 15 - FileSystem Interface and Implementation Prof. Nalini Venkatasubramanian
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 12: File System Implementation.
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 Implementation
File-System Implementation
Chapter 11: File System Implementation
Chapter 11: File-System Interface
File System Implementation
Chapter 11: File System Implementation
Operating Systems (CS 340 D)
Operating Systems (CS 340 D)
Subject Name: Operating Systems Subject Code:10CS53
File Sharing Sharing of files on multi-user systems is desirable
Chapter 11: File System Implementation
Chapter 11: File-System Interface
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.
Outline Allocation Free space management Memory mapped files
O.S Lecture 14 File Management.
Overview: File system implementation (cont)
File-System Structure
Files Management – The interfacing
File-System Interface
Chapter 14: File-System Implementation
Chapter 11: File System Implementation
File System Implementation
Lecture 4: File-System Interface
Presentation transcript:

File-System Management Chapter IV

File-System Interface Computers can store information on several different storage media, such as magnetic disks, magnetic tapes, and optical disks. File Attributes Name: Identifier: Type: Location: Size: Protection: Time, date, and user identification: File Operations - Creating a file ,Writing a file: , Reading a file: Repositioning within a file: ,Deleting a file: ,Truncating a file

File Types

Access Methods Sequential Access Direct Access Directory Structure

Directory . . Single-Level Directory Two-Level Directory

Directory . . Acyclic-Graph Directories General-Graph Directories

File-System Mounting Just as a file must be opened before it is used . File system must be mounted before it can be available to processes on the system. Mount Point

File Sharing Multiple Users – To implement sharing and protection, the system must maintain more file and directory attributes than on a single-user system. file/directory owner (or user) and group user identifiers (user IDS) in linux , Security ID (SID) in Windows Remote File Systems FTP , DFS ( Distributed File System ) - remote directories are visible from the local machine

File Protection When information is kept in a computer system, we want to keep it safe from physical damage (reliability) and improper access (protection). Reliability is generally provided by duplicate copies of files. File systems can be damaged by hardware problems (such as errors in reading or writing), power surges or failures, head crashes, dirt, temperature extremes, and vandalism.

File Protection . . . File access : - Several different types of operations may be controlled: Read: Read from the file. Write: Write or rewrite the file. Execute: Load the file into memory and execute it. Append: Write new information at the end of the file. Delete: Delete the file and free its space for possible reuse. List: List the name and attributes of the file.

FILE-SYSTEM IMPLEMENTATION Operating systems implement open and close systems calls for processes to request access to file contents. Several on-disk and in-memory structures are used to implement a file system. on-disk structures include - boot control block , partition control block . in-memory structures - memory partition table , system-wide open-file table , per-process open-file table

FILE-SY STEM IMPLEMENTATION . . .

Directory Implementation Selection of directory-allocation and directory-management algorithms has a large effect on the efficiency, performance, and reliability of the file system. Linear List – Simplest method of implementing a directory is to use a linear list of file names with pointers to the data blocks . A linear list of directory entries requires a linear search to find a particular entry.

Directory Implementation . . . This method is simple to program but time-consuming to execute. To create a new file, we must first search the directory to be sure that no existing file has the same name. To delete a file, we search the directory for the named file, then release the space allocated to it. Disadvantage of a linear list of directory entries is the linear search to find a file. software cache to store the most recently used directory information

Directory Implementation . . . Hash Table – In this method, a linear list stores the directory entries, but a hash data structure is also used. The hash table takes a value computed from the file name and returns a pointer to the file name in the linear list. Therefore, it can greatly decrease the directory search time. The major difficulties with a hash table are its generally fixed size and the dependence of the hash function on that size.

Allocation Methods Contiguous Allocation – Three major methods of allocating disk space are in wide use: contiguous, linked, and indexed. Contiguous Allocation – contiguous-allocation method requires each file to occupy a set of contiguous blocks on the disk. Contiguous allocation of a file is defined by the disk address and length (in block units) of the first block.

Allocation Methods . . .

Allocation Methods . . . Linked Allocation Linked allocation solves all problems of contiguous allocation. The directory contains a pointer to the first and last blocks of the file. These pointers are not made available to the user.

Allocation Methods . . . Linked allocation of disk space.

Allocation Methods . . . Indexed Allocation Linked allocation solves the external-fragmentation and size- declaration problems of contiguous allocation. In the absence of a FAT, linked allocation cannot support efficient direct access, since the pointers to the blocks are scattered with the blocks themselves all over the disk and need to be retrieved in order. Indexed allocation solves this problem by bringing all the pointers together into one location: the index block.

Allocation Methods . . .

Free-Space Management Since disk space is limited, we need to reuse the space from deleted files for new files, if possible. To keep track of free disk space, the system maintains a free- space list. The free-space list records all free disk blocks-those not allocated to some file or directory. To create a file, we search the free-space list for the required amount of space, and allocate that space to the new file.

Free-Space Management . . . Bit Vector - Frequently, the free-space list is implemented as a bit map or bit vector. Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0. For example, consider a disk where blocks 2, 3,4,5, 8, 9, 10, 11, 12, 13, 17, 18, 25, 26, and 27 are free, and the rest of the blocks are allocated. 001111001111110001100000011100000

Free-Space Management …. Linked List - Another approach to free-space management is to link together all the free disk blocks keeping a pointer to the first free block in a special location on the disk and caching it in memory This first block contains a pointer to the next free disk block, and so on.. However, this scheme is not efficient; to traverse the list, we must read each block – lots of I/O time required.

Free-Space Management ….

Free-Space Management …. Grouping – Modification of the free-list approach is to store the addresses of n free blocks in the first free block. The first n-1 of these blocks are actually free. The last block contains the addresses of another n free blocks, and so on. Counting – Rather than keeping a list of n free disk addresses, we can keep the address of the first free block and the number n of free contiguous blocks that follow the first block.

File Recovery Efficiency -The efficient use of disk space is heavily dependent on the disk allocation and directory algorithms in use. Files and directories are kept both in main memory and on disk, care must taken to ensure that system failure does not result in loss of data. Consistency Checking - Consistency checker compares the data in the directory structure with the data blocks on disk, and tries to fix any inconsistencies it finds.

File Recovery . . . Backup and Restore – Because magnetic disks sometimes fail, care must be taken to ensure that the data are not lost forever. To this end, system programs can be used to Back up data from disk to another storage device, such as a floppy disk, magnetic tape, or optical disk. Recovery from the loss of an individual file, or of an entire disk, may then be a matter of restoring the data from backup.

File Recovery . . . A typical backup schedule may then be as follows: Day 1: Copy to a backup medium all files from the disk. This is called a full backup. Day 2: Copy to another medium all files changed since day 1. This is an incremental backup. Day 3: Copy to another medium all files changed since day 2. Day N: Copy to another medium all files changed since day N- 1. Then go back to Day 1.