58
1 Chapter 12 Chapter 12 File Management File Management Systems Systems

1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

Embed Size (px)

Citation preview

Page 1: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

1

Chapter 12Chapter 12

File Management File Management SystemsSystems

Page 2: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

2

Systems Architecture Chapter 12

Page 3: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

3

Systems Architecture Chapter 12

File Management SystemsFile Management Systems

Logical and Physical Storage Views File Content and Type

Page 4: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

4

Systems Architecture Chapter 12

File Management SystemsFile Management Systems

A File Management System (FMS) is implement in layers:– Command layer or application program– File control– Storage I/O control– Storage devices

Page 5: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

5

Systems Architecture Chapter 12

Page 6: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

6

Systems Architecture Chapter 12

File Management SystemsFile Management Systems

Storage devices – interact with the bus and with operating system device drivers to transfer data between storage devices and memory.

Storage I/O control – accesses storage locations and manages data movement between storage devices and memory.

Page 7: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

7

Systems Architecture Chapter 12

File Management SystemsFile Management Systems

File Control – provides a set of service functions for manipulating files and directories.

Command layer or application program – users perform common file management functions such as copying, moving and renaming.

Page 8: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

8

Systems Architecture Chapter 12

File Management SystemsFile 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.

Page 9: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

9

Systems Architecture Chapter 12

File Management SystemsFile Management Systems

Page 10: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

10

Systems Architecture Chapter 12

Page 11: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

11

Systems Architecture Chapter 12

File Management SystemsFile 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.

Page 12: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

12

Systems Architecture Chapter 12

File Management SystemsFile Management Systems

File Content and 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.

Page 13: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

13

Systems Architecture Chapter 12

File Management SystemsFile Management Systems

Page 14: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

14

Systems Architecture Chapter 12

Page 15: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

15

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructure

Hierarchical Directory Structure Graph Directory Structure

Page 16: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

16

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructureHierarchical Directory Structure

A directory contains information about files and other directories.

Typical directory contents include:– Name Size Time stamp– File Type Ownership– Location Access controls

Page 17: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

17

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructure Typical file ownership permissions are:

– List– Read– Modify– Change

Page 18: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

18

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructure 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

Page 19: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

19

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructure

Page 20: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

20

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructureHierarchical Directory Structure

Directories can contain other directories. Directories can not have more than one

parent. Sometimes called a tree structure.

Page 21: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

21

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructure

Page 22: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

22

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructureGraph Directory Structure

Files and subdirectories can be contained within multiple directories.

Directory links can form a cycle.

Page 23: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

23

Systems Architecture Chapter 12

Directory Content and Directory Content and StructureStructure

Page 24: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

24

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Allocation Units Storage Allocation Tables Blocking and Buffering

Page 25: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

25

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Allocation Units

An allocation unit is the smallest number of secondary storage bytes that can be allocated to a file.

Allocation units can not be smaller than the unit of data transfer between the storage device and controller, which is normally called a block.

Page 26: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

26

Systems Architecture Chapter 12

Storage AllocationStorage 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.

Page 27: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

27

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Storage Allocation Tables

A storage allocation table is a data structure that records which allocation units are free and which belong to files.

Page 28: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

28

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Page 29: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

29

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Page 30: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

30

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Page 31: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

31

Systems Architecture Chapter 12

Storage AllocationStorage 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.

Page 32: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

32

Systems Architecture Chapter 12

Storage AllocationStorage 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.

Page 33: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

33

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Page 34: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

34

Systems Architecture Chapter 12

Storage AllocationStorage 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.

Page 35: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

35

Systems Architecture Chapter 12

Storage AllocationStorage Allocation

Page 36: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

36

Systems Architecture Chapter 12

File ManipulationFile Manipulation

File Open and Close Operations Delete and Undelete Operations

Page 37: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

37

Systems Architecture Chapter 12

File ManipulationFile 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 file’s contents.

Page 38: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

38

Systems Architecture Chapter 12

File ManipulationFile Manipulation

File Open Operation:

1. Locates the file within the directory structure and reads its directory entry.

2. Searches an internal table of open files to see if the file already is open.

3. Ensures that process has sufficient privileges to access the files.

4. Allocates one or more buffers.5. Updates an internal table of open files.

Page 39: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

39

Systems Architecture Chapter 12

File ManipulationFile Manipulation

File Close Operation:

1. Flushing the program’s file I/O buffers to secondary storage.

2. Deallocating buffer memory.

3. Updating the file’s directory entry time stamps.

4. Updating the open file table.

Page 40: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

40

Systems Architecture Chapter 12

File ManipulationFile Manipulation

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.

Page 41: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

41

Systems Architecture Chapter 12

Access ControlsAccess 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.

Page 42: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

42

Systems Architecture Chapter 12

Access ControlsAccess Controls

For Example:

UNIX defines three access control types: Read Write Execute

Page 43: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

43

Systems Architecture Chapter 12

Technology Focus – Windows Technology Focus – Windows NTFSNTFS

Page 44: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

44

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecovery File Migration File Backup Transaction Logging File Recovery Fault Tolerance Mirroring

Page 45: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

45

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecovery

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.

Page 46: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

46

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecoveryFile Migration

Page 47: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

47

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecoveryFile Backup:

Full Backup

Incremental Backup

Differential Backup

Page 48: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

48

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecovery 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.

Page 49: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

49

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecoveryTransaction Logging

A form of automated file backup. A transaction is any single change to file

contents or attributes. Transaction logging provides a high degree of

protection against data loss due to program or hardware failure.

Page 50: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

50

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecoveryFile 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.

Page 51: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

51

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecoveryFault Tolerance

Describes methods of securing file content against hardware failure.

File backup, recovery, and transaction logging are forms or protection against disk failure.

Page 52: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

52

Systems Architecture Chapter 12

File Migration, Backup and File Migration, Backup and RecoveryRecoveryMirroring

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.

Page 53: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

53

Systems Architecture Chapter 12

Technology FocusTechnology Focus

Page 54: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

54

Systems Architecture Chapter 12

Technology FocusTechnology Focus

Page 55: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

55

Systems Architecture Chapter 12

Technology FocusTechnology Focus

Page 56: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

56

Systems Architecture Chapter 12

SummarySummary

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.

Page 57: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

57

Systems Architecture Chapter 12

SummarySummary

Secondary storage units are divided into allocation units, which are typically a few kilobytes in size.

The FMS allocates buffers to support program file I/O.

Page 58: 1 Chapter 12 File Management Systems. 2 Systems Architecture Chapter 12

58

Systems Architecture Chapter 12

SummarySummary

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.