Thursday, 13 October 2011

TUGASAN 3


File System Management

File system management objectives

v  A file management system is that set of system software that provides services to users and applications related to the use of files.
v  Typically, the only way that a user or application may access files is through the file management system.
v  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:

a)    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
b)    To guarantee, the extent possible that the data in the file are valid.
c)    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
d)    To provide I/O support for a variety of types of storage device.
e)    To minimize or eliminate the potential for lost or destroyed data.
f)     To provide a standardized set of I/O interface routines.
g)    To provide I/O support for multiple users in the case of multiple–user systems.

Concept and design
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.
*      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
a)    The simplest directory structure is the single-level directory.
b)     All files are contained in the same directory, which is easy to support and understand.
c)     A single level directory has significant limitation, however, when the number of the file increases or when there is more than one user.
d)     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.
e)     For example in one programming class 23 student call the program for their second assignment prog2: another 11 call it assign2.
f)     Although file names are generally selected to reflect the content of the file, there are often limited in length.
g)    The MS-DOS operating system allows only 11 characters file names: Unix allows 255 characters.
2. Two level directory
a)     The major disadvantage to a single level directory is the confusion of files names between different users.
b)     The standard solution is to create a separate directory for each user.
c)     In the two level directory structures, each user has her own user file directory (UFD).
d)     Each UFD has a similar structure, but lists only the files of a single user.
e)     When a user job starts or a user log in, the system master file directory (MFD), is search.
f)      The master file directory is index by user name or account number, and each entry point to the UFD for that user.
g)     When a user refers to a particular file, only his own UFD is search.
h)     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
a)    Once we 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.
b)    This generalization allows users to create their own subdirectories and to organize their files accordingly.
c)    The MS-DOS system for instance is structured as a tree. In fact a tree is the most common directory structure.
d)     The tree has a root directory.
e)     Every files in the system has a unique path name.
f)      A path name is the path from the root through all the sub directories to a specified file.



File Sharing
In a multi user system, there is almost always a requirement for allowing files to
be shared among a number of users. Two issues arise: access rights and the
management of simultaneous access.

Access Rights
The file systems provide a flexible tool for the following extensive file sharing
among users. The file system should provide a number of options so that the
way in which a particular file is accessed can be controlled. Typically, users or
groups of users are granted certain access rights to a file. A wide range of access
rights has been used. The following list is representative of access rights that can
be assigned to a particular user for a particular file:
®    None: The user may not even learn of the existence of the file much lessaccess 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.
®    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:

1)    Linking block
2)    File map
3)    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