Chapter 3:File Management

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

More on File Management
Chapter 4 : File Systems What is a file system?
Chapter 10: File-System Interface
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.
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
Chapter 11: File System Implementation
File System Implementation
Chapter 13 – File and Database Systems
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.
1 Friday, July 07, 2006 “Vision without action is a daydream, Action without a vision is a nightmare.” - Japanese Proverb.
File System Implementation
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
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.
CSC 322 Operating Systems Concepts Lecture - 20: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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.
Silberschatz and Galvin  Operating System Concepts File-System Implementation File-System Structure Allocation Methods Free-Space Management.
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.
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.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
Secure Operating Systems Lesson F: Capability Based Systems.
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.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
W4118 Operating Systems Instructor: Junfeng Yang.
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 Systems and Disk Management
File-System Management
File System Implementation
PROTECTION.
File-System Implementation
Chapter 14: Protection Modified by Dr. Neerja Mhaskar for CS 3SH3.
CHP - 9 File Structures.
Chapter 11: File System Implementation
Chapter 11: File-System Interface
Operating Systems (CS 340 D)
File System Implementation
Chapter 11: File System Implementation
Operating Systems (CS 340 D)
File Management.
File Sharing Sharing of files on multi-user systems is desirable
Chapter 11: File System Implementation
File Systems Implementation
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.
Overview: File system implementation (cont)
Secondary Storage Management Brian Bershad
File-System Structure
Chapter 16 File Management
Chapter 14: File-System Implementation
Secondary Storage Management Hank Levy
Chapter 11: File System Implementation
File System Implementation
Chapter 5 File Systems -Compiled for MCA, PU
Presentation transcript:

Chapter 3:File Management

Contents 3.1 Concept of the file. 3.2 File access techniques: a. sequential b. direct c. indexed 3.3 Directory structure: a. Storage structure b. Directory structure c. Single-level directory d. Two-level directory

cont.. 3.4 Methods of file allocation (benefits & weaknesses): a. Contiguous file allocation b. Linked file allocation c. Indexed file allocation 3.5 Free space management techniques: a. using bit maps / bit vector b. using linked list

cont.. 3.6 Types of operations: a. Read d. Append b. Write e. Delete c. Execute f. List 3.7 Access Control Matrix approach: a. Access control list b. Capability list 3.8 Techniques used to prevent data loss: a. Physical backup b. Logical backup.

Concept of the file. A file system organizes files and manages access to data. File systems are responsible for: File management – providing the mechanisms for files to be stored, referenced, shared and secured. Auxiliary (supporting) storage management – allocating space for files on secondary or tertiary storage devices. File integrity mechanisms – ensuring that the information stored in a file is uncorrupted. Access methods – how the stored data can be accessed.

Cont.. Files are mapped , by the operating system, onto physical devices. A file is a named collection of related information that is recorded on secondary storage. Data cannot be written to secondary storage unless they are within a file Files represent programs and data. Data files ,may be numeric, alphabetic, alphanumeric, or binary File is a sequence of bits , bytes, lines or records, the meaning of which is defined by the file’s creator n user.

File Organization technique 1. SEQUENTIAL. Entries in a sequential file are arranged in the way they were entered One whose records are arranged in an order place records in a block one after another until there is no room for another complete record in the block. accessed one record at a time, from first to last, in order. Each record can be of varying length. To reach a particular record, all the preceding records must be read. Example device: Magnetic Tapes Figure: Records are arranged in an order

File Organization technique 2. INDEX SEQUENTIAL contains records ordered by a record key The single-level indexing structure is the simplest one where a file, whose records are pairs, contains a key pointer. This pointer is the position in the data file of the record with the given key. A subset of the records, which are evenly spaced along the data file, is indexed, in order to mark intervals of data records. Example device : Disk storage

File Organization technique 3. DIRECT direct or hashed access a portion of disk space is reserved and a “hashing” algorithm computes the record address. So there is additional space required for this kind of file in the store. Records are placed randomly through out the file. Records are accessed by addresses that specify their disc location. without going through a lot of records to get to the one(s) you are after. Also, this type of file organization requires a disk storage rather than tape. Example: Disk

STORAGE STRUCTURE As computer system has multiple storage devices that can be partitioned to hold file systems and can be extended. For example, a Linux OS system as follows:

DIRECTORY STRUCTURE

DIRECTORY STRUCTURE The device directory (commonly known as a directory) records information such as name, location, size and type for all files on that information. Single-level directory- all files are contained in a single directory, which is support and understand. number of files increase or system has more than one user, its has significant limitation. single user on a single level directory difficult to remember the names of all the files as the number files increase. Leads to confusion of files names between different user.

DIRECTORY STRUCTURE Two-level directory Each user has her own user file directory (UFD) Each UFD has a similar structure but lists is only the files of a single user. Master File directory – is indexed by user name or account number, and each entry point to the UFD for that user. Diadv. When the user want to cooperate on some task and to access one another’s files.- sometime system simply do not allow local user files to be access by other users

Methods of file allocation As files are allocated and freed, it is common for the space on secondary storage to become increasingly fragmented. This can cause performance problems. Thus, we will discuss about the 3 methods of file allocation: Contiguous file allocation Linked file allocation Index file allocation

Contiguous File Allocation File systems place data at contiguous address on storage device. The user specifies the amount of space needed to store the file in advance. If the desired amount of contiguous space is not available, the file CANNOT be created.

Contiguous file allocation Contiguous allocation All bytes together, in order Random access Must know file size Fragmentation Pros: Simple: state required per file is start block and size Performance: entire file can be read with one seek Fastest if no changes are to be made also easiest for random access file. Cons: Fragmentation: external is bigger problem Usability: user needs to know size of file It is often difficult to find free space for a new file External fragmentation problem Poor performances as files grow and shrink over time. Used in CDROMs, DVDs

Linked file allocation Each directory entry points to the first sector of a file on a moving-head storage device, ie: hard disk. Each file is a linked list of disk blocks; the disk blocks may be scattered anywhere on the disk. The directory contains a pointer to the first (and last) blocks of the file. Each block contains a pointer to the next block. To read a file, simply read blocks by following the pointers from block to block.

Cont. Each block points to the next block Index with address to first First word points to next block Can grow files dynamically Random Access is slow Internal Fragmentation Incomplete block sizes Unreliable: what if you lose one block in chain? Pros: simple=need only starting address, No waste of space, no external fragmentation Cons :size declaration problem.

Indexed file allocation Each file has its own index block, which is an array of disk block addresses. The entry in the index block points to the block of the file. The directory contains the address of the index block. To read the block, we use the pointer in the index block entry to find and read the desired block.

An index block contains pointer to many other blocks Associate each file with data structure: i-node table of file’s blocks Only need i-nodes in memory for open files set max # of open files Pros: no external fragmentation problem, solve the size declaration problem Cons: cannot support efficient direct access because the pointer to block are scattered anywhere.

Free space management techniques: using bit maps / bit vector using linked list

Free space management Using Bit map

Free space management Using Link list

Types of Operation that can be controlled Read – read from the file Write – write or re-write 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 files

File Access Control Access Control Matrix List all process and files in a matrix Each row is a process (“subject”) Each column is a file (“object”) Each matrix entry is the access rights that subject has for that object In an installation with a large number of users and a large number of files, this matrix generally would be large and sparse Inappropriate for most systems

Cont. TWO techniques for implementing file access control: Access control list Capability list

Access Control list ( ACL) Specifying the user name and the types of access allowed for each user. Three classification of user * Owner - user who created the file * Group – a set of users sharing the file and need similar access * Universe – all other users in the system User Request OS check Access list Allowed / denied

Capability List A capability is implemented as a data structure that contains: – Identifier: addresses or names. e.g. a segment of memory, an array, a file, a printer, or a message port. – Access right: read, write, execute, access, etc.   The capability concept was introduced by Dennis and Van Horn in 1966. ”A capability is a token, ticket, or key that gives the possessor permission to access an entity or object in a computer system”. Intuitive examples – A movie ticket is a capability to watch a movie. – A key is a capability to enter a house.

Example ( difference ): Alice wishes to keep all of her valuables in three safe deposit boxes in the bank. Occasionally, she would like one or more trustworthy friends to make deposits or withdrawals for her. There are two ways that the bank can control access to the box. • The bank maintains a list of people authorized to access each box. • The bank issues Carla one or more keys to each of the safe deposit boxes.

Cont. A Capability List for a domain is a list of objects together with the operations allowed on those objects. (i.e.: Hydra system, Cambridge CAP system).

Capability List Approach ACL Approach Capability List Approach – Authentication: The bank must authenticate. – Bank’s involvement: The bank must (i) store the list, (ii) verify users. – Forging access right: The bank must safeguard the list. – Add a new person: The owner must visit the bank. – Delegation: A friend cannot extend his or her privilege to someone else. – Revocation: If a friend becomes untrustworthy, the owner can remove his/her name. -Authentication: The bank does not need to authenticate. – Bank’s involvement: The bank need not be involved in any transactions – Forging access right: The key cannot be forged – Adding a new person: The owner can give the key to other people – Delegation: A friend can extend his or her privilege to someone else. – Revocation: The owner can ask for the key back, but it may not be possible to know whether or not the friend has made a copy.  

Techniques used to prevent data loss: Physical backup Logical backup

Prevent Data Loss Physical backup backups of the physical files used in storing and recovering your database, such as data files, control files, and archived redo logs is a copy of files storing database information to some other location, whether on disk or some offline storage such as tape.

Prevent Data Loss Logical backup contain logical data (for example, tables or stored procedures) exported from a database with an Oracle export utility and stored in a binary file, for later re-importing into a database using the corresponding Oracle import utility. Physical backups are the foundation of any sound backup and recovery strategy. Logical backups are a useful supplement to physical backups in many circumstances but are not sufficient protection against data loss without physical backups.

END