FREE SPACE MANAGEMENT

FREE SPACE MANAGEMENT

Introduction:

The disk space (or secondary storage) is limited: therefore we must manage the free space of the disk properly. The operating system must be able to identify those physical blocks that are not currently allocating to any file. Most of the operating systems maintain a free space list, which contains the record of all file disk blocks. When a new file is created, the operating system searches the free space list. If free space is available, it is allocated to the new file and the free space list is updated. Similarly, if a file is deleted, then the space allocated to that file is added to the free space list.
Some mechanisms have been used to maintain the free list. The most popular and commonly used method to maintain the free space list is as under:

Bitmap Method:

 The most popular to implement (or maintain) the free space list is the bitmap method. It is also known as a bit vector. Using this scheme, the status of each block is a bit. If a block is free, the bit is set to 0. Similarly, if a block is allocated, the bit is set to 1,
 Consider a disk, which is divided into 20 blocks. Blocks 1,2,7,15,19 and 20are allocated and the rest of the blocks are free. In its case, the free list bitmap will be shown as:
1 1 0 0 0 0 1 0 0 0 0 0 0 0  1 0 0 0 1 1
The above series of bits, one bit for each physical block, represents the free lust bitmap. The size of the bitmap is very small in processing the computer network system.

Advantages:

Bitmap method has the following advantages:
It provides an easy method to find a specific or consecutive free block on the disk.
Its size is very small and occupies a very small amount of memory. The amount of memory (in bytes) required for a bitmap is calculated as:
Disk size in bytes
8 X block size

Disadvantages:

Although, bitmap takes less CPU has to consume extra time in finding the free space to maintain the free list bitmap.

free List Array:

The free space list can also be implemented very easily using an array. The operating system stores the addresses of all the free blocks in an array known as a free lost array. This array can easily be adding and removing addresses of the blocks.

Linked List:

computer-files

The free space list may also be maintained by creating a linked list of all the free space blocks. Using this scheme, this scheme, the free blocks are linked together by using a pointer. The first free block contains a pointer to the next free disk block, and so on. Using this scheme, the pointer to the first block is required and there is no need for a disk allocation table. This method is limited to all of the file allocation methods.

DIRECTORIES:

The file management system of any operating system provides the facility to organize files and other file objects using directories. In this way, various operating be performed easily on the files. The directory is also called a folder (in Window). It is a file system object, which contains information about files. This information includes file attributes such as the name of files, location of files on disk, type of files and access privileges, etc. A directory is also known as a container for the files. In most cases, a directory is defined as an object that contains the names of the file system object. However, the directory itself is a specific file that is owned by the operating system. In a secondary storage device, directories are created under the root directory. A root directory is at the top and is created by the operating system. Each disk or partition of the disk a root directory. All directories, other than the root directory, are the subdirectories of the root directory. The root directory is denoted by ''/' in a  network system.

Pathnames:
 A file is accessed regarding its filename with a complete path or address. Entries in a directory determine the full pathname associated with a file system object. Suppose a structure of the directory is a tree-like structure. Two methods are commonly used to specify the address of a file.

system

In the first method, each file is given an absolute pathname, which is a full path starting from the root directory to the file. 
In the second method, a relative pathname for a file is specified, instead of specifying the full pathname. This is used in conjunction with the concept of a working directory or currency directory. Typically, an interactive operating system user or a process is associated with its current directory in a system network. Files are referenced relative to the working directory in a processing computer system. When an interactive user logs on in a system, or a process is created in a computer, then the default working directory is the user directory in a system network. The user can navigate up or down in the tree to set a different working directory. In UNIX, DOS and Window, full pathnames begin with the separator, whereas relative names do not and they are taken relative to the working directory.

Partitions:

Files are commonly stored on secondary storage like hard disks. The hard disk can be divided into different logical parts. These logical parts of the disk are known as partition. A file system can be created on each of these partitions of the disk. For example, if we make four partitions of a hard disk, then by default the letter designated to these partitions will be C:, D:, E:, and F:,.However, we can change this letter also.
In some operating systems such as DOS and Windows, the partition is specified as part of the pathname for a file. For example, in DOS''C:/Data/Renault/File2'' specifies the file system object named ''/Data/Renault/File2'' in partition C. These are also used in a computer system network for processing any type of data. It plays an important role in a computer network system. It carries files that are major used in it for processing or update.

Comments

Popular posts from this blog

Modern scenario of information technology:

Deadlock Questions and Answers pdf

What is the bus interconnection?