SlideShare ist ein Scribd-Unternehmen logo
1 von 54
1. Explain file management in operating
system
1. Identify the basic function of file system
2. Describe the following file organization
techniques
3. Identify which file organization technique is
appropriate for as specific device
4. Describe the three types of file structure
5. Describe the various methods of file
allocation
6. State the benefits and weaknesses of using
each of the file allocation method
7. Describe the two free space management
techniques
8. Describe the various techniques for
implementing file access control
9. Explain the techniques used to prevent data
loss
10. Implement specific backup technique in a
given situation
 Files
• Named collection of data that is manipulated
as a unit
• Reside on secondary storage devices
 Operating systems can create an interface that
facilitates navigation of a user’s files
• File systems can protect such data from
corruption or total loss from disasters
• Systems that manage large amounts of shared
data can benefit from databases as an
alternative to files
 File: a named collection of data that may be
manipulated as a unit by operations such as:
• Open
• Close
• Create
• Destroy
• Copy
• Rename
• List
 Individual data items within a file may be manipulated by
operations like:
• Read
• Write
• Update
• Insert
• Delete
 File characteristics include:
• Location
• Accessibility
• Type
• Volatility
• Activity
 Files can consist of one or more records
 Directories is ……. :
• Files containing the names and locations of
other files in the file system, to organize and
quickly locate files
 Directory entry stores information such as:
• File name
• Location
• Size
• Type
• Accessed
• Modified and creation times
 File systems
• Organize files and manages
access to data
• Responsible for file management, auxiliary
storage management, file integrity
mechanisms and access methods
• Primarily are concerned with managing
secondary storage space, particularly disk
storage
FileSystem
Function
Organize
files
Manages
access
Responsible
file
management
storage
management
file integrity
access
methods
 It is about …. How records are arranged &
characteristics of medium? used to store it
 It is HOW the records of a file are arranged on
secondary storage
 On magnetic disks, files can be organized as
• sequential
• direct
• indexed sequential
• Partitioned
*refers to Notes below.
 Sequential
• Easiest to implement because records are stored &
retrieved serially, one after other.
• Optimization features - Built into system to speed
process.
 E.g., select a key field from record & then sort
records by that field before storing them.
 Aids search process. (filtering)
 Complicates maintenance algorithms because
original order must be preserved every time records
added or deleted.
 Direct (a.k.a Random)
• Uses direct access files which can be implemented only
on direct access storage devices (pronounced DAZ-dee –
magnetic storage / drum).
• Give users flexibility of accessing any record in any
order without having to begin search from beginning of
file.
• Records are identified by their relative addresses (their
addresses relative to beginning of file).
 Logical addresses computed when records are stored &
again when records are retrieved.
 Direct – Advantages
• Fast access to records.
• Can be accessed sequentially by starting at first
relative address & incrementing it by one to get to next
record.
• Can be updated more quickly than sequential files
because records quickly rewritten to original
addresses after modifications.
 No need to preserve order of the records, so adding
or deleting them takes very little time.
 Indexed Sequential
• Combines best of sequential & direct access.
• Records are arranged in a logical sequence
according to a key contained in each record.
• The system maintains an index containing the
physical address of contain records
 Partitioned
• This refers to a file of sequential sub-files.
Each sequential sub-file is called a member of
the partitioned file.
• Improvement for sequential technique.
FILE STRUCTURE
Unstructured
BYTE
Structured
RECORD
Complex
TREE
 OS considers a file to be unstructured
 OS does not know what is in the file.
 All it sees are bytes.
 Any meaning? must be imposed by user-level
programs.
 Used by UNIX, Windows, most modern OS (FAT
family filesystem)
 The byte sequences provides the maximum
flexibility (easy to read/fast read).
 Applications can impose their own structure
 File is a sequence of fixed-length records,
each with some internal structure (head-body-
tail).
 Read operation : returns one record
 Write operation : overwrites or appends
(tambah/’topup’) one record.
 OS can optimize operations on records
 A file consists of a tree of records.
 Record not necessarily all the same length
 Each record containing a key field in a fixed
position in the record.
 The tree is sorted on the key field  why ?
 allow fast searching for a particular key.
 The basic operation here is to get the record with
a specific key (NTFS family filesystem).
 Furthermore, new records can be added to the
file, with the operating system deciding where to
place them.
 This type of file is clearly quite different from the
unstructured byte sequence used in UNIX and
Win. 98 (FAT filesystem)
 Widely used on the large mainframe computers.
 Still used in some commercial data processing.
 For the zoo file of Figure (c), one could ask the
system to get the record whose key is pony, for
example, without worrying about its exact
position in the file.
 Problem of allocating space and freeing space
on secondary storage.
 Contiguous allocation systems have generally
been replaced by more dynamic non-contiguous
allocation systems. Why?
• Files tend to grow or shrink over time
• Users rarely know in advance how large their
files will be
FILE ALLOCATION
Contiguous
Linked list
Blocks
Linked list
Index
 File Allocation will used THREE (3) types of algorithm to
store files:
• Best fit (padanan TERBAIK – sama padan)
 determine the best place to put the new data
 minimise the wasted space
• First fit (padanan PERTAMA – cukup untuk padanan)
 scanning from the beginning of available memory to the
end, which is at least big enough to accept the data is
found
• Worst Fit (padanan TERBURUK – ruang besar untuk
data kecil)
 selects the largest possible free space that the
information can be stored on
File Allocation
 Store each file as a contiguous run of disk
blocks
 Wasteful of space (dynamic storage-allocation
problem).
 Simple – only starting location and length
(number of blocks) are required.
 E.g: Assume a disk of 1KB = 1 blocks  50 KB
file is allocated 50 consecutive blocks
 Types of allocation : best fit or first fit
File Allocation
 Advantages
• Easy to implement
• Two numbers needed for each file:
1 - disk address of the first block
2 - number of blocks in the file
• Read performance is excellent
File Allocation
 Disadvantages
• Fragmentation of blocks
• Will need periodic compaction (wasting time)
• Will need to manage free lists
• Have to know a file’s maximum possible size
at the time it is created
• Good for CD-ROMs, DVDs
 All file sizes are known in advance
 Files are never deleted
File Allocation
File Allocation
File Start Length
Dip2a 2 4
Dip2b 8 8
Dip3a 24 1
No click
 The first word of each block is used as a pointer
to the next one.
 The rest of the block is for data
 Unlike contiguous allocation, every empty disk
block can be used in this method
 No space is lost to disk fragmentation (except for
internal fragmentation in the last block of each file)
 FAT used by DOS is a variation of linked allocation,
where all the links are stored in a separate table at
the beginning of the disk.
 Benefits : cached in memory, improving random
access speeds
File Allocation
 Advantage
• No fragmentation on disk (except internal
fragmentation on block)
• No need to pre-specify file sizes (files can
grow/shrink).
• Never necessary to defragment disk.
• For sequentially accessed files, performance
is optimal.
File Allocation
 Disadvantage
• Random access is slow
• Can only be used effectively for sequentially
accessed files.
• The pointers use additional disk space.
• Reliability. What if a pointer gets corrupted?
File Allocation
File Allocation
 Index allocation solves all of the problems of
contiguous allocation.
 Support the random access of a file.
 With indexed allocation each file is like a set of
linked blocks, except the pointers are all stored
in an index (the index block – unique to each
file).
 The directory contains the location (disk block) of
the index block for each file.
File Allocation
 Advantage
• No external fragmentation.
• No need to pre-specify file sizes (files can
grow/shrink).
• Never necessary to defragment disk.
 Disadvantage
• The pointers use an additional disk block
(wastes more space than linked allocation
does).
File Allocation
File Allocation
 Since the amount of disk space is limited, it is
necessary to reuse the space released by
deleted files.
 In general, file systems keep a list of free disk
blocks (initially, all the blocks are free) and
manage this list by one of the following
techniques :
• a. using free lists
• b. using bitmaps
 Free List - Linked list of blocks containing the
locations of free blocks
 Manage as LIFO or FIFO on disk and store it in
main memory
 Blocks are allocated from the beginning of the
free list
 Newly freed blocks are appended to the end of
the list
 Files are likely to be allocated in noncontiguous
blocks
 Increases file access time
Secondary Storage
0 1 2 3 4 5
6 7 8 9 10 11
12 13 14 15 16 17
18 19 20 21 22 23
24 25 26 27 28 29
30 31 32 33 34 35
Addres
s
Free Blocks
0 4
1 5
2 6
3 11
4 12
5 21
6 22
7 23
9 28
10 29
: :
n Block n
 used to track allocated sector by some file
systems
 If block is free : bit 0
 If block is occupied : bit 1
 A bitmap (bit-array) contains one bit for each
block in memory
• Xth bit corresponds to the Xth block on the
storage device
 May be too large to hold in main memory
 Hard to search; the bigger the storage  more
hard to search
 Advantage:
• Simple: Each bit directly corresponds to a
sector
• Efficient to find first free block
 Disadvantage :
• The file system may need to search the entire
bitmap to find a free block
 Files are often used to store sensitive data such
as:
• Credit card numbers
• Passwords
• Social security numbers
 Therefore, they should include mechanisms to
control user access to data.
• Access control matrix
• Access control by user classes
Two-dimensional access control matrix:
In an installation with a large number of
users and a large number of files, this
matrix generally would be large.
Inappropriate for most systems
Figure 13.12 Access control matrix.
A B C D E F G H I J
0 – Cannot Access
1 – Can Access
 A technique that requires considerably less
space is to control access to various user
classes
 User classes can include:
• The file owner
• A specified user
• Group
• Project
• Public
 Access control data
• Can be stored as part of the file control block
• Often consumes an insignificant amount of
space
 Backup techniques
• Store redundant copies of information
 Recovery techniques
• Enable the system to restore data after a
system failure
 Physical safeguards such as locks and fire
alarms are the lowest level of data protection
 Performing periodic backups is the most
common technique used to ensure the continued
availability of data
 Physical backups
• Duplicate a storage device’s data at the bit
level
 Logical backups
• Store file system data and its logical structure
• Inspect the directory structure to determine
which files need to be backed up, then write
these files to a backup device in a common,
often compressed, archival format
 Incremental backups are logical backups that
store only file system data that has changed
since the previous backup

Weitere ähnliche Inhalte

Was ist angesagt?

Memory management ppt
Memory management pptMemory management ppt
Memory management pptManishaJha43
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1rohassanie
 
Operating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputOperating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputPeter Tröger
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsDrishti Bhalla
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresWayne Jones Jnr
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
Operations on Processes and Cooperating processes
Operations on Processes and Cooperating processesOperations on Processes and Cooperating processes
Operations on Processes and Cooperating processesVishnuMenon59
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47 myrajendra
 
5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering myrajendra
 
Operating System Chapter 1
Operating System Chapter 1Operating System Chapter 1
Operating System Chapter 1Kasam Sharif
 

Was ist angesagt? (20)

operating system structure
operating system structureoperating system structure
operating system structure
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Chapter 2 part 1
Chapter 2 part 1Chapter 2 part 1
Chapter 2 part 1
 
Disk Management
Disk ManagementDisk Management
Disk Management
 
Operating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputOperating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / Output
 
File Systems
File SystemsFile Systems
File Systems
 
Hard drive partitions
Hard drive partitionsHard drive partitions
Hard drive partitions
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
cache memory
 cache memory cache memory
cache memory
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Operations on Processes and Cooperating processes
Operations on Processes and Cooperating processesOperations on Processes and Cooperating processes
Operations on Processes and Cooperating processes
 
Cerpen Hutan Rimba
Cerpen Hutan RimbaCerpen Hutan Rimba
Cerpen Hutan Rimba
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47
 
Disk formatting
Disk formattingDisk formatting
Disk formatting
 
Mapping
MappingMapping
Mapping
 
5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering
 
Operating System Chapter 1
Operating System Chapter 1Operating System Chapter 1
Operating System Chapter 1
 
Memory management OS
Memory management OSMemory management OS
Memory management OS
 

Andere mochten auch

Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2) rohassanie
 
chapter 1 introduction to operating system
chapter 1 introduction to operating systemchapter 1 introduction to operating system
chapter 1 introduction to operating systemAisyah Rafiuddin
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating systemtittuajay
 
Operating system and its function
Operating system and its functionOperating system and its function
Operating system and its functionNikhi Jain
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 

Andere mochten auch (6)

Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
 
Ch4 memory management
Ch4 memory managementCh4 memory management
Ch4 memory management
 
chapter 1 introduction to operating system
chapter 1 introduction to operating systemchapter 1 introduction to operating system
chapter 1 introduction to operating system
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
Operating system and its function
Operating system and its functionOperating system and its function
Operating system and its function
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 

Ähnlich wie Chapter 3

File system in operating system e learning
File system in operating system e learningFile system in operating system e learning
File system in operating system e learningLavanya Sharma
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control YuvrajWadavale
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1rohassanie
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Ch11 file system implementation
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementationWelly Dian Astika
 
Wk 1 - File organization.pptx
Wk 1 - File organization.pptxWk 1 - File organization.pptx
Wk 1 - File organization.pptxDORCASGABRIEL1
 
Storage Mediums and Fragmentation
Storage Mediums and FragmentationStorage Mediums and Fragmentation
Storage Mediums and FragmentationJonathan Reid
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and DeadlocksRohit Jain
 
Operating system and installation
Operating system and  installationOperating system and  installation
Operating system and installationIshworKhatiwada
 
storage techniques_overview-1.pptx
storage techniques_overview-1.pptxstorage techniques_overview-1.pptx
storage techniques_overview-1.pptx20CS102RAMMPRASHATHK
 
DBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptxDBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptxJayendranath3
 

Ähnlich wie Chapter 3 (20)

File system in operating system e learning
File system in operating system e learningFile system in operating system e learning
File system in operating system e learning
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1
 
File Allocation Methods.ppt
File Allocation Methods.pptFile Allocation Methods.ppt
File Allocation Methods.ppt
 
File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating system
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Ch11 file system implementation
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementation
 
File organisation
File organisationFile organisation
File organisation
 
Ch10 file system interface
Ch10   file system interfaceCh10   file system interface
Ch10 file system interface
 
Wk 1 - File organization.pptx
Wk 1 - File organization.pptxWk 1 - File organization.pptx
Wk 1 - File organization.pptx
 
File Management
File ManagementFile Management
File Management
 
Storage Mediums and Fragmentation
Storage Mediums and FragmentationStorage Mediums and Fragmentation
Storage Mediums and Fragmentation
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
 
9781111306366 ppt ch11
9781111306366 ppt ch119781111306366 ppt ch11
9781111306366 ppt ch11
 
Windows file system
Windows file systemWindows file system
Windows file system
 
Operating system and installation
Operating system and  installationOperating system and  installation
Operating system and installation
 
storage techniques_overview-1.pptx
storage techniques_overview-1.pptxstorage techniques_overview-1.pptx
storage techniques_overview-1.pptx
 
File Management.ppt
File Management.pptFile Management.ppt
File Management.ppt
 
DBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptxDBMS_UNIT 5 Notes.pptx
DBMS_UNIT 5 Notes.pptx
 
Operating system
Operating systemOperating system
Operating system
 

Chapter 3

  • 1.
  • 2. 1. Explain file management in operating system
  • 3. 1. Identify the basic function of file system 2. Describe the following file organization techniques 3. Identify which file organization technique is appropriate for as specific device 4. Describe the three types of file structure 5. Describe the various methods of file allocation
  • 4. 6. State the benefits and weaknesses of using each of the file allocation method 7. Describe the two free space management techniques 8. Describe the various techniques for implementing file access control 9. Explain the techniques used to prevent data loss 10. Implement specific backup technique in a given situation
  • 5.  Files • Named collection of data that is manipulated as a unit • Reside on secondary storage devices  Operating systems can create an interface that facilitates navigation of a user’s files • File systems can protect such data from corruption or total loss from disasters • Systems that manage large amounts of shared data can benefit from databases as an alternative to files
  • 6.  File: a named collection of data that may be manipulated as a unit by operations such as: • Open • Close • Create • Destroy • Copy • Rename • List
  • 7.  Individual data items within a file may be manipulated by operations like: • Read • Write • Update • Insert • Delete  File characteristics include: • Location • Accessibility • Type • Volatility • Activity  Files can consist of one or more records
  • 8.  Directories is ……. : • Files containing the names and locations of other files in the file system, to organize and quickly locate files  Directory entry stores information such as: • File name • Location • Size • Type • Accessed • Modified and creation times
  • 9.
  • 10.  File systems • Organize files and manages access to data • Responsible for file management, auxiliary storage management, file integrity mechanisms and access methods • Primarily are concerned with managing secondary storage space, particularly disk storage
  • 12.  It is about …. How records are arranged & characteristics of medium? used to store it  It is HOW the records of a file are arranged on secondary storage  On magnetic disks, files can be organized as • sequential • direct • indexed sequential • Partitioned *refers to Notes below.
  • 13.  Sequential • Easiest to implement because records are stored & retrieved serially, one after other. • Optimization features - Built into system to speed process.  E.g., select a key field from record & then sort records by that field before storing them.  Aids search process. (filtering)  Complicates maintenance algorithms because original order must be preserved every time records added or deleted.
  • 14.  Direct (a.k.a Random) • Uses direct access files which can be implemented only on direct access storage devices (pronounced DAZ-dee – magnetic storage / drum). • Give users flexibility of accessing any record in any order without having to begin search from beginning of file. • Records are identified by their relative addresses (their addresses relative to beginning of file).  Logical addresses computed when records are stored & again when records are retrieved.
  • 15.  Direct – Advantages • Fast access to records. • Can be accessed sequentially by starting at first relative address & incrementing it by one to get to next record. • Can be updated more quickly than sequential files because records quickly rewritten to original addresses after modifications.  No need to preserve order of the records, so adding or deleting them takes very little time.
  • 16.
  • 17.  Indexed Sequential • Combines best of sequential & direct access. • Records are arranged in a logical sequence according to a key contained in each record. • The system maintains an index containing the physical address of contain records
  • 18.  Partitioned • This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file. • Improvement for sequential technique.
  • 20.  OS considers a file to be unstructured  OS does not know what is in the file.  All it sees are bytes.  Any meaning? must be imposed by user-level programs.  Used by UNIX, Windows, most modern OS (FAT family filesystem)  The byte sequences provides the maximum flexibility (easy to read/fast read).
  • 21.  Applications can impose their own structure
  • 22.  File is a sequence of fixed-length records, each with some internal structure (head-body- tail).  Read operation : returns one record  Write operation : overwrites or appends (tambah/’topup’) one record.  OS can optimize operations on records
  • 23.
  • 24.  A file consists of a tree of records.  Record not necessarily all the same length  Each record containing a key field in a fixed position in the record.  The tree is sorted on the key field  why ?  allow fast searching for a particular key.  The basic operation here is to get the record with a specific key (NTFS family filesystem).
  • 25.  Furthermore, new records can be added to the file, with the operating system deciding where to place them.  This type of file is clearly quite different from the unstructured byte sequence used in UNIX and Win. 98 (FAT filesystem)  Widely used on the large mainframe computers.  Still used in some commercial data processing.
  • 26.  For the zoo file of Figure (c), one could ask the system to get the record whose key is pony, for example, without worrying about its exact position in the file.
  • 27.  Problem of allocating space and freeing space on secondary storage.  Contiguous allocation systems have generally been replaced by more dynamic non-contiguous allocation systems. Why? • Files tend to grow or shrink over time • Users rarely know in advance how large their files will be
  • 29.  File Allocation will used THREE (3) types of algorithm to store files: • Best fit (padanan TERBAIK – sama padan)  determine the best place to put the new data  minimise the wasted space • First fit (padanan PERTAMA – cukup untuk padanan)  scanning from the beginning of available memory to the end, which is at least big enough to accept the data is found • Worst Fit (padanan TERBURUK – ruang besar untuk data kecil)  selects the largest possible free space that the information can be stored on File Allocation
  • 30.  Store each file as a contiguous run of disk blocks  Wasteful of space (dynamic storage-allocation problem).  Simple – only starting location and length (number of blocks) are required.  E.g: Assume a disk of 1KB = 1 blocks  50 KB file is allocated 50 consecutive blocks  Types of allocation : best fit or first fit File Allocation
  • 31.  Advantages • Easy to implement • Two numbers needed for each file: 1 - disk address of the first block 2 - number of blocks in the file • Read performance is excellent File Allocation
  • 32.  Disadvantages • Fragmentation of blocks • Will need periodic compaction (wasting time) • Will need to manage free lists • Have to know a file’s maximum possible size at the time it is created • Good for CD-ROMs, DVDs  All file sizes are known in advance  Files are never deleted File Allocation
  • 33. File Allocation File Start Length Dip2a 2 4 Dip2b 8 8 Dip3a 24 1 No click
  • 34.  The first word of each block is used as a pointer to the next one.  The rest of the block is for data  Unlike contiguous allocation, every empty disk block can be used in this method  No space is lost to disk fragmentation (except for internal fragmentation in the last block of each file)  FAT used by DOS is a variation of linked allocation, where all the links are stored in a separate table at the beginning of the disk.  Benefits : cached in memory, improving random access speeds File Allocation
  • 35.  Advantage • No fragmentation on disk (except internal fragmentation on block) • No need to pre-specify file sizes (files can grow/shrink). • Never necessary to defragment disk. • For sequentially accessed files, performance is optimal. File Allocation
  • 36.  Disadvantage • Random access is slow • Can only be used effectively for sequentially accessed files. • The pointers use additional disk space. • Reliability. What if a pointer gets corrupted? File Allocation
  • 38.  Index allocation solves all of the problems of contiguous allocation.  Support the random access of a file.  With indexed allocation each file is like a set of linked blocks, except the pointers are all stored in an index (the index block – unique to each file).  The directory contains the location (disk block) of the index block for each file. File Allocation
  • 39.  Advantage • No external fragmentation. • No need to pre-specify file sizes (files can grow/shrink). • Never necessary to defragment disk.  Disadvantage • The pointers use an additional disk block (wastes more space than linked allocation does). File Allocation
  • 41.
  • 42.  Since the amount of disk space is limited, it is necessary to reuse the space released by deleted files.  In general, file systems keep a list of free disk blocks (initially, all the blocks are free) and manage this list by one of the following techniques : • a. using free lists • b. using bitmaps
  • 43.  Free List - Linked list of blocks containing the locations of free blocks  Manage as LIFO or FIFO on disk and store it in main memory  Blocks are allocated from the beginning of the free list  Newly freed blocks are appended to the end of the list  Files are likely to be allocated in noncontiguous blocks  Increases file access time
  • 44. Secondary Storage 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Addres s Free Blocks 0 4 1 5 2 6 3 11 4 12 5 21 6 22 7 23 9 28 10 29 : : n Block n
  • 45.  used to track allocated sector by some file systems  If block is free : bit 0  If block is occupied : bit 1  A bitmap (bit-array) contains one bit for each block in memory • Xth bit corresponds to the Xth block on the storage device  May be too large to hold in main memory  Hard to search; the bigger the storage  more hard to search
  • 46.  Advantage: • Simple: Each bit directly corresponds to a sector • Efficient to find first free block  Disadvantage : • The file system may need to search the entire bitmap to find a free block
  • 47.
  • 48.  Files are often used to store sensitive data such as: • Credit card numbers • Passwords • Social security numbers  Therefore, they should include mechanisms to control user access to data. • Access control matrix • Access control by user classes
  • 49. Two-dimensional access control matrix: In an installation with a large number of users and a large number of files, this matrix generally would be large. Inappropriate for most systems
  • 50. Figure 13.12 Access control matrix. A B C D E F G H I J 0 – Cannot Access 1 – Can Access
  • 51.  A technique that requires considerably less space is to control access to various user classes  User classes can include: • The file owner • A specified user • Group • Project • Public
  • 52.  Access control data • Can be stored as part of the file control block • Often consumes an insignificant amount of space
  • 53.  Backup techniques • Store redundant copies of information  Recovery techniques • Enable the system to restore data after a system failure  Physical safeguards such as locks and fire alarms are the lowest level of data protection  Performing periodic backups is the most common technique used to ensure the continued availability of data
  • 54.  Physical backups • Duplicate a storage device’s data at the bit level  Logical backups • Store file system data and its logical structure • Inspect the directory structure to determine which files need to be backed up, then write these files to a backup device in a common, often compressed, archival format  Incremental backups are logical backups that store only file system data that has changed since the previous backup

Hinweis der Redaktion

  1. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  2. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  3. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  4. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  5. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  6. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  7. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  8. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  9. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  10. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.
  11. Sequential - the file records are stored strictly in the same order as they occur physically in the fileDirect - The records are placed in any order, which is suited for application. The system supports random access or direct access of any record in the file.Indexed - the records are arranged in a logical sequence according to a key contained in each record. the system maintains an index containing the physical address of contain recordsPartitioned - This refers to a file of sequential sub-files. Each sequential sub-file is called a member of the partitioned file.