Monday, March 21, 2011

File System Management

File System Management Objectives
A file management system is that set of system software that provides services to users and applications related to the use of files.

  • Typically, the only way that a user or application may access files is through the file management system.
  • This relieves the user or programmer of the necessity of developing special purpose software for each application and provide the system with a means of controlling its most important asset.
  • [GROS86] suggests the following objectives for file management system:
v     To meet the data-management needs and requirements of the user, which include storage of data and the ability to perform the operations listed earlier
v     To guarantee, the extent possible that the data in the file are valid
v     To optimize performance both from the system point of view in terms of overall throughput and from the user’s point of view in terms of response time
v     To provide I/O support for a variety of types of storage device
v     To minimize or eliminate the potential for lost or destroyed data
v     To provide a standardized set of I/O interface routines
v     To provide I/O support for multiple users in the case of multiple–user systems


Concept
  • Computer can store information on several different storage media such as magnetic disks, magnetic tapes and optical disks.
  • So that the computer systems will be convenient to use, the operating system provides a uniform logical view of information storage.
  • The operating system abstract from the physical properties of its storage devices to define a logical storage unit, the file.
  • File are mapped, by the operating system, on to physical devices.
  • This storage device are usually non volatile, so the contents are persistent thru power failures and systems reboots.


File directory
  • Associated with any file-management system and collection of files is a file directory.
  • The directory contains information about the files including attributes, location and ownership.
  • Much of this information, especially that concern with storage, is managed by the operating system.
  • The directory is itself a file, owned by the operating system and accessible by various to users and applications, information is generally provided indirectly by system routines.
  • Thus, users cannot directly access the directory even in read-only mode.
  • We can describe the most common schemes for defining the logical structure of a directory:
1.      Single level Directory
·        The simplest directory structure is the single-level directory.
·        All files are contained in the same directory, which is easy to support and understand.
·        A single level directory has significant limitation, however, when the number of the file increases or when there is more than one user.
·        Since all files are in the same directory, they must have unique names.
·        If we have two users who call their data file test, then the unique name rule is violated.
·        For example in one programming class 23 student call the program for their second assignment prog2: another 11 call it assign2.
·        Although file names are generally selected to reflect the content of the file, there are often limited in length.
·        The MS-DOS operating system allows only 11 characters file names: Unix allows 255 characters.
·        Even with a single user, as the number of files increases, it becomes difficult to remember the name of all the file, so as to create only file with unique name.
·        It is not uncommon for a user to have 100 of files on one computer system and an equal number of additional files on another system.
·        In such an environment, keeping track of so many files is a daunting task.

2. Two level directory
  • The major disadvantage to a single level directory is the confusion of file names between different users.
  • The standard solution is to create a separate directory for each user.
  • In the two level directory structures, each user has her own user file directory (UFD).
  • Each UFD has a similar structure, but lists only the files of a single user.
  • When a user job starts or a user log in, the system master file directory (MFD), is search.
  • The master file directory is index by user name or account number, and each entry point to the UFD for that user.
  • When a user refers to a particular file, only his own UFD is search.
  • Thus different users may have files with the same name, as long as all the file names within it UFD are unique.
3. Multilevel directory
  • Once have seen how to view a two level directory as two-level tree, the natural generalization is to extend the directory structure to a tree of a arbitrary height.
  • This generalization allows users to create their own subdirectories and to organize their files accordingly.
  • The MS-DOS system for instance is structured as a tree.
  • In fact a tree is the most common directory structure.
  • The tree has a root directory.
  • Every files in the system has a unique path name.
  • A path name is the path from the root through all the sub directories to a specified file.

Access Right
  • None: The user may not even learn of the existence of the file much less access it. To enforce this restriction, the user is not allowed to read the user directory that includes this file.
  • Knowledge: The user can determine that the file exists and who its owner is. The user is then able to petition the owner for additional access rights
  • Execution: The user can load and execute a program but cannot copy it. Proprietary programs are often made accessible with this restriction.
  • Reading: The user can read the file for any purpose, including copying and execution. Some system is able to enforce a distinction between viewing and copying. In the former case, the content of the file can be displayed to the user, but the user has no means for making copy.
  • Appending: The user can add data to the file, often only at the end, but cannot modify or delete any of the file’s content. This right is useful in collecting data from a number of sources.
  • Updating: The user can modify, delete and add to the file’s data. Updating normally includes writing the file initially, rewriting it completely or in part and removing all or portion of the data. Some systems distinguish among different degrees of updating.
  • Changing protection: The user can change the access rights granted to other users. Typically this right is held only by the owner of the file. In some systems, the owner can extend this right to others. To prevent abuse of this mechanism, the file owner is typically able to specify which rights can be changed by the holder of this right.
  • Deletion: The user can delete the file from the file system.

Secondary Storage Organization Program
A file may contain more than one block of secondary storage. It means few block should linking to form file. There are three methods which are:
  • Linking block
  • File map
  • Index block
Linking block
  • Every block that use to from a file will link using a pointer.
  • The pointer in UFD (User file directory) link to the first block in a chain.
  • The Problem to this method is there are many access to disk and need to be done to find the last file, for example to delete file, clear information about the earlier position of the file. 
File map
  • This method linking the block to form a file and were recorded using file map.
  • It is known as file scheduling.
  • The pointer in the file of UFD will link to the location in the map file which is representing the first block to form the file.
  • The last block will stated using zero pointers.
Index Block
  • This method will link the entire block using the index block.
  • The pointer in the UFD will link to that index block.
  • The advantage of this method is file can be accessed without parallel system.
  • While the disadvantages are too many space should be used to keep the index block. 

No comments:

Post a Comment