Download presentation
1
File Management Systems
Chapter 12 File Management Systems
2
Chapter goals 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
3
Chapter goals cont. 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
4
File Management Systems
FMS is implemented in layers like the OS Command layer or application program File control Storage I/O control Storage devices
5
File Man. Systems Layers
6
FMS Layers Storage devices – corresponds with hardware layer of OS
Interacts with the bus and with operating system device drivers to transfer data between storage devices and memory
7
FMS layers Storage I/O control – accesses storage locations and manages data movement between storage devices and memory Part of OS kernel Its software modules include Device drivers for each storage device or device controller Interrupt handlers Buffers and cache managers
8
FMS layers cont. File Control – provides a set of service functions for manipulating files and directories Processes service calls from users and applications Maintains directory and storage allocation data structures used to locate files and their associated physical locations Command layer or application program – users perform common file management functions such as copying, moving and renaming
9
Logical vs. physical view
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
10
Logical vs. physical view
11
Logical vs. physical view of a file
File is subdivided into records Record usually contains information about a single customer, thing such as a product in inventory, or an event Records are divided into fields Fields are individual units of data
12
Logical vs. physical Logical file structure is independent of its physical implementation Logical file structure “ignores” Physical storage allocations – records can be stored in separate file locations Data access methods Data encoding methods
13
Logical structure of data file
14
File content and type A file is a collection of data created by an applications The format of that information is called the file 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
15
File type File type normally is declared when a file is created
In the UNIX file management system, the file type is stored within the directory. In the Windows file management system, the file type is declared through the extension
16
Registered Windows File Types
In windows the extension of a file can be associated (connected) to a specific application When you open a file associated with an application, that application is started and the file is opened in the associated application Show associated file types – control panel, folder options
17
Directory content and structure
Files are organized into directories Some directories are created and maintained by software Windows directories Directories associated with applications User can also create and maintain directories
18
Directory content Directories in windows are organized in a hierarchy
Directory information includes: Name File type Location Size Ownership Access controls Time stamp(s) Show directory information for C drive
19
Directory Content and Structure
Typical file ownership permissions are: Create Read Update delete Time stamps include: When the file was created When the file most recently was read When the file most recently was written When the file last was backed up
20
Hierarchical Directory Structure
Windows directory structure is hierarchical Directories can contain other directories (called sub-directories) Directories can not have more than one parent Sometimes called a tree structure (draw picture)
21
Hierarchical directory structures
22
Storage allocation Users and applications programs continually create and change files When files are created they must be given space in storage When files grow they must be given additional space When files shrink unneeded space must be released
23
Allocation units Allocation unit is smallest unit of space that can be allocated to a file Allocation units cannot be smaller than system data transfer unit Data transfer unit is called a block Block sizes range from 512 bytes to 4 KB in multiples of 512 bytes
24
Allocation units cont. Is a multiple of block size, i.e. equal to 4 blocks, 8 blocks, etc. Size of allocation unit is optimized to use space efficiently
25
Storage allocation tables
FMS maintains a table of storage allocation units Records which units belong to which file Records which units are available (free) In windows this table called File Allocation Table or FAT
26
Sample allocations of files
The next three slides show 3 files, how their storage is allocated, and how FMS records location of allocation units Storage units are said to be “chained together” using pointer Each unit contains reference (pointer) to next unit in the list
27
Directory listing of 3 files
28
Where 3 files are stored
29
How FMS finds files
30
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
31
Blocking and buffering
Most of the time the logical size of a record does not equal the physical allocation unit When several logical records are grouped within physical records that is called blocking Individual logical records grouped together into one unit called a block
32
Blocking and buffering cont.
Simplifies data transfer between drive and memory Then OS must extract individual records from the allocation unit block If a physical record contains just one logical record, then the file is said to be unblocked
33
Blocking records
34
Buffer Buffer is storage area in memory where blocks of records from drive are copies Buffer is used to extract individual records from a block
35
Using buffers
36
Operations on files There are setup requirements that need to be executed whenever a file is first requested by an application and when that file is not longer needed These operations are called File open File close
37
File open When an application requests a file, the FMS must do the follow: The file must be located on the storage device Ensure that application has right to access this file Allocates one or more buffers Updates internal table of open files
38
File close When application sends request to close a file, FMS does the following: Flushing the program’s I/O buffers to secondary storage De-allocate buffer memory Update directory entry time stamp Update file open table
39
Delete and Undelete Operations
In most file management systems, files are not removed immediately from secondary storage when they are deleted The file’s 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 Recyling bin in windows allows files to be undeleted
40
Access 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 id’s and passwords
41
Access control For Example:
UNIX defines three access control types: Read Write Execute Internet web sites – you can read pages but not change them (unless you are a hacker)
42
FMS Backup options 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
43
Windows backup Programs accessories system tools
44
Summary The file management system (FMS), 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
45
Summary cont. 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
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.