Please enable JavaScript.
Coggle requires JavaScript to display documents.
TOPIC 3 : FILE MANAGEMENT - Coggle Diagram
TOPIC 3 : FILE MANAGEMENT
PART 3
Access Control Matrix approach in protection problems
Protection problem
the most common approach to protection problem
make access dependent on the identity of user
(Different users may need different types of access to file or directory)
HOW?
Associate each file and directory to an access-control list (ACL) specifying user names and the types of access allowed for each user
ACCESS MATRIX
The access matrix model is the policy for user authentication, and has several implementations such as "Access Control List (ACL)" and "capabilities". It is used to describe which users have access to what objects.
The access matrix model consists of four major parts:
A list of objects
A list of subjects
A function T which returns an object's type
The matrix itself, with the objects making the columns and the subjectsmaking the rows
1 more item...
Using "condense the length of the access-control list.
In order to condense the length of the access-control list, three classifications of users are introduced
1 more item...
An access matrix has several standard operations associated with it:
Entry of right into a specified cell
Removal of right from a specified cell
Creation of a subject
Creation of an subject
1 more item...
CAPABILTY LIST
If we can represent the access matrix using access control lists, one per column of the matrix, we can also do the same thing using rows. Rows of the access matrix correspond to domains, but the dominant terminology used since the early 1970's describes each row of the access matrix as a capability list. Consider the same example acces matrix:
The corresponding capabilty list representation of this access matrix is:
Alice -- aaa:R/W, bbb:R, ccc:R
Bob -- aaa:R, bbb:R/W, ddd:R
Carol -- aaa:R, bbb:R, ccc:R/W, ddd:R
Dave -- bbb:R/W, ccc:R/W, ddd:R
Each pair consisting of an object name and the access rights to that object is called an access capability.
In their simplest form, capabilty lists are just a compact form of the access matrix, but just as was the case with access control lists, capability listxs depart from this simple interpretation as they are fully developed. The departure is quite different in form.
The techniques used to prevent data loss
Physical backup
Logical backup
PHYSICAL BACKUP
DEFINITION
This is an operating system backup
It saves the database data files onto tape or some other storage media.
This type of backup is often used to recover the database to the point of failure.
TYPES
the data files, redo log files and control files are saved on a backup media such as a tape storage system
The backup is accomplished by using both Windows NT operating system utilities and Oracle database utilities.
TWO DIFFERENT TYPE :
"COLD" backup
"HOT" backup
LOGICAL BACKUP
DEFINITION
uses the IMPORT/EXPORT utilities to create the backup copy of the database
will backup the contents of the database
can be used to recover the database to the last backup
Both methods (logical and physical) can be used to restore a database.
WHAT TO DO WHEN TABLESPACE DAMAGE?
Restoring the data from an IMPORT/EXPORT does not allow you to correct the damaged data file problem
To recover the database we must first restore the tablespace's data files
For these types of situations the backup strategy to use is the physical backup.
Protection in Operating System
When information is stored in a computer system , we want to keep it safe from Physical Damage( Realibility) & Improper Access (Protection)
Physical damage (Realibility)
File systems can be damaged :
by hardware problems (such as errors in reading or writing).
power surges or failures.
head crashes.
dirt
temperature extremes
vandalism
Files may be deleted accidentally.
File contents could be lost because of bugs in the file-system software.
To overcome this problem, we need
"BACKUP COPIES"
Improper Access (Protection)
Systems that DO NOT permit access to other users file,
DO NOT need protection.
But for general use, what we need is
“
controlled access
”
PART 2
Two free space management techniques
DEFINITION
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
For the required amount of space and allocate that space to the new file.
For the required amount of space and allocate that space to the new file
Its disk space is added , when a file is deleted
The two techniques:
Using bitmaps / bit vector
Using linked list
Using bitmaps / bit vector
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.
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.
The free-space bit map would be:
001111001111110001100000011100000 ...
Disadvantages
inefficient unless the entire vector is kept in main memory
written to disk occasionally for recovery needs
Advantages
simplicity and efficiency in finding the first free block
n consecutive free blocks on the disk
Bitmaps
requires extra space
Easy to get contiguous files
EXAMPLE
block size = 212 bytes
disk size = 230 bytes (1 gigabyte)
n = 230/212 = 218 bits (or 32K bytes)
Using Linked List
DEFINITION
to link together all the free disk blocks
keeping a pointer to the first free block in a special location on the disk
caching it in memory
EXAMPLE
This first block contains a pointer to the next free disk block, and so on.
Explanations of example:
This scheme is not efficient; to traverse the list
we must read each block, which requires substantial I/O time
traversing the free list is not a frequent action.
Advantage
No waste of space
Disadvantage
Cannot get contiguous space easily
Part 5: Allocation Method (of Direct Access Method)
Introduction: The direct-access nature of disks allows us flexibility in the implementation of files, in almost every case, many files are stored on the same disk.
Problem of direct access:
how to allocate space to these files so that disk space is utilized effectively and files can be accessed quickly.
:fountain_pen: An allocation method refers to how disk blocks are allocated for files.
:fountain_pen: There are three main method of allocation:
a) Contiguous allocation
b) Linked allocation
c) Indexed allocation
Contiguous Allocation - requires that each file occupy a set of contiguous blocks on the disk.
Disk addresses define a linear ordering on the disk. With this ordering, assuming that only one job is accessing the disk, accessing block b + 1 after block b normally requires no head movement.
When head movement is needed (from the last sector of one cylinder to the first sector of the next cylinder), the head need only move from one track to the next.
:check: number of disk seeks required is minimal,meaning seek time is available only when a seek is finally needed.
:pencil2: Accessing a file that has been allocated contiguously is easy.
:pencil2: For sequential access, the file system remembers the disk address of the last block referenced and, when necessary, reads the next block.
:pencil2: Contiguous allocation has some problems: finding space for a new file.
:pencil2: First fit and best fit are the most common strategies used to select a free hole from the set of available holes.
Linked Allocation - solves all problems of contiguous allocation
:star: Simple – need only starting address
:star: 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.
:star: A write to the file causes the free-space management system to find a free block, and this new block is written to and is linked to the end of the file.
:star: To read a file, we simply read blocks by following the pointers from block to block.
:star: There is no external fragmentation with linked allocation, and any free block on the free-space list can be used to satisfy a request.
:star: The size of a file need not be declared when that file is created.
File-Allocation Table
Problems:
effectively only for sequential-access files
Indexed Allocation- Provides solutions to problems of contiguous and linked allocation.
A index block is created having all pointers to files. Each file has its own index block which stores the addresses of disk space occupied by the file. Directory contains the addresses of index blocks of files.
:star: Each file has its own index block, which is an array of disk-block addresses.
:star: The i-th entry in the index block points to the i-th block of the file.
Problem: wasted space,
Part 6: Advantages & Disadvantages
Advantages & Disadvantages in Contiguous Allocation
Advantages
1) It is simple to implement.
2) We will get Excellent read performance.
3) Supports Random Access into files.
Disadvantages
1) The disk will become fragmented.
2) It may be difficult to have a file grow.
Advantages & Disadvantages in Indexed Allocation
Advantages
1) Supports direct access
2) A bad data block causes the lost of only that block.
Disadvantages
1) A bad index block could cause the lost of entire file.
2) Size of a file depends upon the number of pointers, a index block can hold
3) Having an index block for a small file is totally wastage.
Advantages & Disadvantages in Linked Allocation
Advantages
1)There is no external fragmentation with linked allocation.
2) Any free block can be utilized in order to satisfy the file block requests.
3) File can continue to grow as long as the free blocks are available.
Disadvantages -
1) Random Access is not provided.
2)Any of the pointers in the linked list must not be broken otherwise the file will get corrupted.
3) Pointers require some space in the disk blocks.