MECH 2301 Lecture Notes - Lecture 28: Defragmentation, Linked List
MECH 2301 Lecture 28 Notes
Introduction
Noncontiguous Storage Allocation
• The idea was to leave as much room for another file as possible, but studies showed
that it didn’t work any better than the others.
• Ultimately, it becomes necessary to reorganize the space periodically to eliminate the
fragments by collecting them together to form one new, usable space.
• This operation is called defragmentation, usually shortened to defragging.
• It is also sometimes called compaction.
• The time and effort required to defrag a disk is large, but pays off in faster disk access.
• A file system will normally attempt to allocate file storage space contiguously.
• When this is not possible, the file must be stored no contiguously in whatever blocks are
available.
• With noncontiguous storage, new blocks do not have to be assigned until they are
actually needed.
• Fragmentation of the storage space cannot occur
• Although defragmentation may still be used to reduce the number of file accesses by
maximizing the contiguous use of space
• The use of noncontiguous space requires that the file system maintain a detailed,
ordered list of assigned blocks for each file in the system
• As well as a list of free blocks available for assignment
• For consistency, the file system will maintain ordered lists for all files, contiguous and
noncontiguous.
• There are two basic approaches to maintaining the lists of blocks allocated to each file
• The block numbers for a file may be stored as a linked list, using pointers from one block
to the next.
• This method is known as a linked allocation.
find more resources at oneclass.com
find more resources at oneclass.com