Title: File Management Systems
1File Management Systems
2Objectives
- Describe the components and functions of a file
management system - Compare the logical and physical organization of
files and directories - Explain how secondary storage locations are
allocated to files and describe the data
structures used to record those allocations - Describe file manipulation operations, including
open, close, read, delete, and undelete
operations - List access controls that can be applied to files
and directories - Describe security, backup, recovery, and fault
tolerance methods and procedures
3Chapter Topics
4File Management Systems
- A File Management System (FMS) is
- implemented in layers
- Command layer or application program
- File control
- Storage I/O control
- Secondary storage devices
5File Management Systems
6File Management Systems
- Logical and Physical Storage Views
- Logical Storage Views viewed by users are a
collection of files organized within directories
and storage volumes - Physical Storage Views a collection of physical
storage locations organized as a linear address
space
7File Management Systems
8File Management Systems
9File Management Systems
- File Content and Type
- A file can store many different data types
including text, numbers, complex data structures,
and executable instructions - Modern file management systems provide a
framework to support additional file types
10File Management Systems
11File Management Systems
12Directory Content and Structure
- Typical directory contents include
- Name Size Time stamp
- File Type Ownership
- Location Access controls
13Directory Content and Structure
- Hierarchical Directory Structure
- Directories can contain other directories
- Directories can not have more than one parent
- Sometimes called a tree structure
14Directory Content and Structure
15Directory Content and Structure
- Graph Directory Structure
- Files and subdirectories can be contained within
multiple directories - Directory links can form a cycle
16Directory Content and Structure
17Storage Allocation
- Allocation Units
- the smallest number of secondary storage bytes
that can be allocated to a file - can not be smaller than the unit of data transfer
between the storage device and controller, which
is normally called a block
18Storage Allocation
- Allocation unit size is usually a
- Tradeoff among
- Efficient use of secondary storage space for
files. - Size of storage allocation data structures.
- Efficiency of storage allocation procedures.
19Storage Allocation
- Storage Allocation Tables
- A storage allocation table is a data structure
that records which allocation units are free and
which belong to files.
20Storage Allocation
21Storage Allocation
22Storage Allocation
23Storage Allocation
- Blocking and Buffering
- A logical record is a collection of data items,
or fields, that is accessed by an application
program as a single unit - A physical record is the unit of storage
transferred between the device controller and
memory in a single operation
24Storage Allocation
- Blocking and Buffering
- Logical record grouping within physical records
is called blocking - If a physical record contains just one logical
record, then the file is said to be unblocked
25Storage Allocation
26Storage Allocation
- Blocking and Buffering
- A FMS uses buffers in primary storage to store
data temporarily as it moves between programs and
secondary storage devices - A buffer is a scratchpad for extracting logical
records from physical records
27Storage Allocation
28File Manipulation
- File Open and Close Operations
- The FMS must perform several tasks, collectively
called a file open operation, before an
application program can read or write a files
contents.
29File Manipulation
- File Open Operation
- Locates the file within the directory structure
and reads its directory entry. - Searches an internal table of open files to see
if the file already is open. - Ensures that process has sufficient privileges to
access the files. - Allocates one or more buffers.
- Updates an internal table of open files.
30File Manipulation
- File Close Operation
- Flushing the programs file I/O buffers to
secondary storage. - Deallocating buffer memory.
- Updating the files directory entry time stamps.
- Updating the open file table.
31File Manipulation
- Delete and Undelete Operations
- In most file management systems, files are not
removed immediately from secondary storage when
they are deleted. - The files storage allocation units are marked as
free and its directory entry is marked as unused. - A user might be able to use the undelete
operation to recover the file.
32Access Controls
- A File Management System helps prevent loss,
corruption and unauthorized access to files. - The operating system is used to identify and
authenticate users and their processes. - The file access is authenticated through ids and
passwords.
33Access Controls
- UNIX defines three access control types
- Read
- Write
- Execute
34Technology Focus
35File Migration, Backup, and Recovery
- File Migration management technique for
secondary storage in which older versions of a
file are moved automatically to less costly
storage media or devices such as magnetic tape.
36File Migration, Backup, and Recovery
37File Migration, Backup, and Recovery
- File Backup
- Full Backup the FMS copies all files and
directories for an entire storage volume - Incremental Backup only the files that have
been modified are archived - Differential Backup only the changed portions
of the files are archived
38File Migration, Backup, and Recovery
- File Recovery
- The file management system maintains backup logs
to aid in locating backup copies of lost or
damages files. - The recovery utility reconstructs as much of the
directory and storage allocation data structures
as possible and makes a consistency check.
39File Migration, Backup, and Recovery
- Fault Tolerance
- Describes methods of securing file content
against hardware failure. - File backup, recovery, and transaction logging
are forms or protection against disk failure.
40File Migration, Backup, and Recovery
- Mirroring
- A fault tolerance technique in which all disk
write operations are made simultaneously or
concurrently to two different storage devices. - Disk mirroring provides a high degree of
protection against data loss with no performance
penalty if implemented in hardware.
41Technology Focus
42Technology Focus
43Technology Focus
44Summary
- The file management system (FMS) is usually a
part of the operating system, manages all aspects
of user and program access to secondary storage. - With directories, users can organize the
thousands of files stored in a typical computer
system. - Secondary storage units are divided into
allocation units, which are typically a few
kilobytes in size.
45Summary
- The FMS allocates buffers to support program file
I/O. - The FMS enforces access controls when accessing
files on behalf of a user or program. - FMSs provide utilities to make backup copies of
files and directories and to recover them if
needed.