A Directory Is A Container That Is Used To Contain Folders and File. It Organizes Files and Folders Into A Hierarchical Manner

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

DIRECTORY STRUCTURE:

A directory is a container that is used to contain folders and file. It organizes


files and folders into a hierarchical manner.
• Single-level directory –
Single level directory is simplest directory structure. In it all files are contained in same
directory which make it easy to support and understand.
• A single level directory has a significant limitation, however, when the number of files
increases or when the system has more than one user.
• Since all the files are in the same directory, they must have the unique name . if two
users call their dataset test, then the unique name rule violated.
Advantages:
•Since it is a single directory, so its implementation is very easy.
•If the files are smaller in size, searching will become faster.
•The operations like file creation, searching, deletion, updating are very easy in such a
directory structure.
Disadvantages:
•There may chance of name collision because two files can not have the same name.
•Searching will become time taking if the directory is large.
•In this can not group the same type of files together.
Two-level directory –
i) Each user has Its own User File Directory (UFD).
ii) When the user job start or user log in, the system Master File Directory (MFD) is
searched. MFD is indexed by user name or Account Number.
iii) When user refers to a particular file, only his own UFD is searched.
Thus different users may have files with same name. To have a particular file uniquely, in
a two level directory, we must give both the user name and file name.
A two level directory can be a tree or an inverted tree of height 2
The root of a tree is Master File Directory (MFD).
Each user gets their own directory space.
File names only need to be unique within a given user's directory.
A master file directory is used to keep track of each users directory, and must be
maintained when users are added to or removed from the system.

The files are the leaves of the tree.


Limitations of Two Level Directory
The structure effectively isolates one user from another.
Advantages:
•We can give full path like /User-name/directory-name/.
•Different users can have same directory as well as file name.
•Searching of files become more easy due to path name and user-grouping.
Disadvantages:
A user is not allowed to share files with other users.
Still it not very scalable, two files of the same type cannot be grouped together in the
same user.
Observe the figure below, 4 users have created their separate directory inside the root directory. But further, no
subdirectory is created by the users.
3) Tree Structured Directory
A directory (or Sub directory) contains a set of files or sub directories. All
directories has the same internal format.
The user can change his current directory whenever he desires.
If a file is not needed in the current directory then the user usually must either specify a path
name or change the current directory.
In a tree directory structure, except root directory, every directory or file has only one parent
directory. So, there is a total separation between the users which provide complete naming
freedom. Here, if a user wishes to access another users file, it has to go through two or more
directories.
Directories are stored the same as any other file in the system, except there is a bit that
identifies them as directories, and they have some special structure that the OS understands.
Paths can be of two types :-
a) Absolute Path
Begins at root and follows a path down to the specified file.
b) Relative Path
Defines a path from current directory.
vii) Deletions if directory is empty, its entry in the directory that contains it can simply deleted. If
it is not empty : One of the Two approaches can be taken :-
a)User must delete all the files in the directory.
b)If any sub directories exist, same procedure must be applied.
The UNIX rm command is used.
MS dos will not delete a directory unless it is empty.
Disk Organization – It is the manner in which the disk drive is organized for storage of data.
The disk surface comprises several tracks arranged in concentric circles called tracks which are further subdivided into
sectors. The greater the number of tracks, the more is the storage capacity of the disk. When all the sectors, of a track
are full, drive starts using the next track.
Basically structure of Hard Disk(HDD) in Two types:
1.Hard Disk Physical Structure
2.Hard Disk Logical Structure

Physical Structure of HDD


However, we can divide the Hard Disk Physical structure Inti the
following terms:
1.Platters
2.Read/Write Heads
3.Spindle Motor
4.Logic Board
PLATTERS:

A platter is a round, metal disk that is mounted inside a hard disk drive. Several plasters are mounted on a fixed
spindle motor to create more data storage surfaces in a smaller area. The platter consists of a core containing
aluminium or glass substrate, covered with a thin layer of Ferric Oxide or Cobalt Alloy. On both sides of the layer, a
thin coating is deposited by a special manufacturing technique. This is the thin cover where the original data is stored
at the Media Layer.
When the magnetic media is applied on the surface of the layer material, a thin oily layer is applied to protect the
material.

READ WRITE HEAD

The heads are the interface between magnetic media where data is stored and the electronic component on the hard disk.
Converts the bits into magnetic pulses in bit size while storing the heads on the platter and reverses the process while
reading. Each platter has two read/write heads, one at the top and the other at the bottom.
SPINDLE MOTOR

Spindle motors play an important role in hard drive operation by turning hard disk platters. A spindle motor must
provide stable, reliable and continuous turning power for continued use for several hours. Many hard drive failures
occur because the spindle motor is not working properly.

HARD DISK LOGIC BOARD


Hard disks are made with an intelligent circuit board integrated into the hard disk unit. It is mounted on the outside
of the base casting exposed on the outside. The read/write heads are connected to the logic board via a flexible
ribbon wire.
LOGICAL STRUCTURE OF HARD DISK

A Hard Disk drive (HDD) has a logical structure that is compatible with the operating system
installed. The master boot record is the most important part of the hard disk. This is the first sector
on the hard disk that the operating system accesses. The master boot record contains boot loaders
and partition tables. It is important to know the logical structure of the hard disk to better
understand and resolve the hard disk drive problems.
Basically, we can divide the hard disk logical structure into the following logical terms:

MBR (Master Boot Record)


•DBR(DOS BOOT RECORD)
•FAT (File Allocation Tables)
•Root Directory
•Data Area
MASTER BOOT RECORD (M.B.R)
There is a small program to load and start active (or bootable) partitions from hard
disk drives, known as master boot records (MBRs) or sometimes master partition
tables (MPTs). The master boot record contains information about the four primary
partition types of the hard drive (s), such as startup area, completion area, partition
size, and so on.
It contains a small program to load and start the active partition from hard disk.
note;:Whichever primary partition from which you load your OS at boot time becomes the active partition. You
can designate only one partition active at a time.

FAT (FILE ALLOCATIONAL TABLE)


Full form - File Allocation Tables, FAT is a method for tracking the contents of hard drives
used by Microsoft operating systems, first launched in 1977. FAT manages the disk area in
group of sectors called clusters. The Table is a chart of numbers that matches the cluster
address of a hard drive. The following is a list of the different types of FAT used and the
operating system using them.
•FAT 8
•FAT 12
•FAT 16
DBR (DOS BOOT RECORD) contains important information about disk like
Bytes per sector
Sectors per cluster
Reserved sectors
DBR created by the FORMAT command of DOS. The job of DBR is to load OS from HDD to
main memory

ROOT DIRECTORY
It is like a table of contents for information stored on HDD.

The remainder area of volume after root directory is the data area. It contains actual data
stored on the disk surface.
RAID

RAID, or “Redundant Arrays of Independent Disks” is a technique which makes use of a


combination of multiple disks instead of using a single disk for increased performance, data
redundancy or both.

Data redundancy, although taking up extra space, adds to disk reliability. This means, in
case of disk failure, if the same data is also backed up onto another disk, we can retrieve
the data and go on with the operation. On the other hand, if the data is spread across
just multiple disks without the RAID technique, the loss of a single disk can affect the
entire data.
RAID levels
Raid devices will make use of different versions, called levels.

(disk striping) is the process of dividing a body of data into blocks and spreading the data
blocks across multiple storage devices, such as hard disks or solid-state drives (SSDs), in a
redundant array of independent disks (RAID) group. A stripe consists of the data divided
across the set of hard disks or SSDs, and a striped unit refers to the data slice on an individual
drive.
Raid 0: Striping
Requiring a minimum of two disks, RAID 0 splits files and stripes the data across two disks or
more, treating the striped disks as a single partition.
RAID 0 does not provide redundancy or fault tolerance. Since it treats multiple disks as a
single partition, if even one drive fails, the striped file is unreadable.
This is not an insurmountable problem in video streaming or computer gaming
environments where performance matters the most, and the source file will still exist even if
the stream fails.
RAID 1: Mirroring
RAID 1 requires a minimum of two disks to work, and provides data redundancy and
failover. It reads and writes the exact same data to each disk. Should a mirrored disk fail,
the file exists in its entirety on the functioning disk.
RAID 2. This configuration uses striping across disks, with some disks storing error
checking and correcting (ECC) information. RAID 2 also uses a dedicated Hamming
code parity; a linear form of error correction code. RAID 2 has no advantage over
RAID 3 and is no longer used
Hamming code is a block code that is capable of detecting up to two simultaneous bit errors
and correcting single-bit errors. It was developed by R.W. Hamming for error correction.
In this coding method, the source encodes the message by inserting redundant bits within
the message. These redundant bits are extra bits that are generated and inserted at specific
positions in the message itself to enable error detection and correction. When the
destination receives this message, it performs recalculations to detect errors and find the
bit position that has error.
RAID 3. This technique uses striping and dedicates one drive to
storing parity information. The embedded ECC information is used to detect
errors. Data recovery is accomplished by calculating the exclusive information
recorded on the other drives. Since an I/O operation addresses all the drives at the
same time, RAID 3 cannot overlap I/O. For this reason, RAID 3 is best for single-user
systems with long record applications.
RAID 4. This level uses large stripes, which means a user can read records from
any single drive.Since all write operations are required to update the parity drive,
no I/O overlapping is possible. RAID-4 allows recovery of at most 1 disk failure
(because of the way parity works). If more than one disk fails, there is no way to
recover the data.
RAID 5. This level is based on parity block-level striping. The parity information is striped
across each drive, enabling the array to function even if one drive were to fail. The array's
architecture allows read and write operations to span multiple drives -- resulting in
performance better than that of a single drive, but not as high as that of a RAID 0 array. RAID
5 requires at least three disks, but it is often recommended to use at least five disks for
performance reasons. RAID-5 allows recovery of at most 1 disk failure (because of the way
parity works). If more than one disk fails, there is no way to recover the data. This is identical
to RAID-4.
RAID 6. This technique is similar to RAID 5, but it includes a second
parity scheme distributed across the drives in the array. The use of
additional parity enables the array to continue to function even if two
disks fail simultaneously. However, this extra protection comes at a cost.
RAID 6 arrays often have slower write performance than RAID 5 arrays

You might also like