Chapter 3
Chapter 3
OPERATING SYSTEM
• Disadvantage:
1)Several records with unique keys may generate same logical
address (collision)
3) Indexed sequential
• 1. Storage Structure
• Each extent points to next one in sequence
• Directory entry
• Filename, storage location of first extent, location of last
extent, total number of extents (not counting first)
• 2. Directory Structure
• Each extent listed with physical address, size, pointer to next
extent
• Null pointer indicates last one
Cont…
• 3. Single-level Directory
• 4. Two-level Directory
Advantage of Single-level
Directory and Two-level Directory
Single-level Directory Two-level Directory
• Advantages:
Simple – only starting location (block #) and length (number of
blocks) are required
Random access – faster data reading
• Disadvantages:
Wasteful of space – disk defragmentation
Files cannot grow.
Contiguous file allocation
(cont..)
2. Linked list non-contiguous (using
blocks)/ Linked file allocation
• Advantages:
Simple – need only starting address
Free-space management system – no waste of space
• Disadvantages:
Random access is slow
Mapping – if the link is lost rest of the file can’t be
located
Linked list non-contiguous
(disk blocks)
3. Linked list non-contiguous
(using index-node)
• Index node is associated with each file
• Given an index node it’s possible to find all blocks of the
file
• Index nodes are fixed in size
• Logical view.
Linked list non-contiguous
(using index-node)
• Advantages:
When a file is open only the corresponding index node
should be in memory
Random access
• Disadvantages:
Need index table
Example of Indexed Allocation
3) Linked list non-contiguous allocation
(using index)
• This is very inefficient since a disk access is required to look at each sector.
Example Using Free Lists
Free Space Management
Techniques
• 2. USING BITMAPS
• Each block is represented by a bit
• free space = bit 1
• allocate/occupied = bit 0
• A matrix may be
decomposed by columns,
yielding access control
lists
• The access control list
lists users and their
permitted access rights
Capability
Lists
• Decomposition
by rows yields
capability tickets
• A capability
ticket specifies
authorized
objects and
operations for a
user
Techniques Used To Prevent
Data Loss
• A backup is a copy of data from your raw device that
can be used to reconstruct that data. Backups can be
divided into physical backups and logical backups.
• PHYSICAL BACKUPS
• Physical backups is the movement of all data : used in storing
and recovering data from one raw device to another, in the
context of file system backup the source devices are disks and
destination devices may include disk, CD-ROM, floppy, ZIP
devices and tape.
Cont..Physical Backups
• Benefits:
• Simplicity – every bit from the source device is copied to the destination; the
format of the data is irrelevant to the backup procedure
• Fast speed – it is able to order the access to the media in whatever way is most
efficient
• Weaknesses:
• Necessary to restore the file system to disks that are the same size and
configuration as the originals
• Restoring a subset(single file which was accidently deleted is not very practical
• The file system must not be changing when the backup is performed
Logical Backups
• LOGICAL BACKUPS
• Logical backups contain logical data (for example, tables or stored
procedures) exported from a disk with the utility and stored in a binary file
• Benefits:
• User can backup a subset of a data in a file system which can save time
and media space
• If a user accidentally deletes a file, a logical restore can locate the file on
tape, and restore only that file
• Weaknesses:
• Only a person with root access to the filter can run restore