6.file Management1
6.file Management1
Unit-6
FILE MANAGEMENT
Marks-10
By: Mr.A.D.Cholke
File Management
File Management
• Introduction-
• File is a collection of related data
• Data is stored in computer in the form of file.
• Different types of data need different types of files.
• Data could be in in different form ,it could be number ,character, image or even symbol
etc.
• Information stored in file is could be further stored in folder or directory.
• File could be divided in following main two types
• Data
• Program
• Data file is a sequence of bit , bytes, line or record and meaning of which is defined by
file creator and user. Data files are numeric character, binary.
• Program is a set of instruction given to machine work.
File Management
Attributes of File-
There are certain attributes of files.
• Name
• Identifier
• Type
• Location
• Size
• Protection
• Date Time and user Identification
• Password
• Creator and owner of file
File Management
Operation on File-
There are certain operation on files.
• Creating file
• Writing file
• Reading file
• Delete file
• Close file
• Rename file
File Management
Types of File-
• File type refers to the ability of the operating system to distinguish different
types of file such as text files, source files and binary files etc.
• Many operating systems support many types of files.
• Operating system like MS-DOS and UNIX have the following types of files −
1. Ordinary files-
• These are the files that contain user information.
• These may have text, databases or executable program.
• The user can apply various operations on such files like add, modify, delete or even
remove the entire file.
2. Directory files-
• These files contain list of file names and other information related to these files.
File Management
3.Special files
• These files are also known as device files.
• These files represent physical device like disks, terminals, printers, networks, tape drive
etc.
• These files are of two types -
1. Character special files - data is handled character by character as in case of
terminals or printers.
2. Block special files - data is handled in blocks as in the case of disks and tapes.
File Management
File Access Method –
There are two file access method.
1. Sequential Access
• Sequential access is that in which the records are accessed in some sequence, i.e., the
information in the file is processed in order, one record after the other.
• This access method is the most primitive one.
• Example: Compilers usually access files in this fashion.
2. Direct Access
• Random access file organization provides, accessing the records directly.
• Each record has its own address on the file with by the help of which it can be directly
accessed for reading or writing.
• The records need not be in any sequence within the file and they need not be in adjacent
locations on the storage medium.
File Management
Swapping–
Swapping is a mechanism in which a process can be swapped temporarily out of main
memory (or move) to secondary storage (disk) and make that memory available to other
processes. At some later time, the system swaps back the process from the secondary
storage to main memory.
File Management
File Allocation Method –
There are three types of file allocation method.
1. Continuous Allocation-
2. Linked Allocation
3. Index allocation
1. Continuous Allocation-
• A single continuous set of blocks is allocated to a
file at the time of file creation.
• Thus, this is a pre-allocation strategy, using
variable size portions.
• The file allocation table needs just a single entry
for each file, showing the starting block and the
length of the file.
File Management
2.Linked Allocation-
Allocation is on an individual block basis.
Each block contains a pointer to the next
block in the chain. Again the file table needs
just a single entry for each file, showing
the starting block and the length of the file.
Although pre-allocation is possible, it is more
common simply to allocate blocks as needed.
File Management
File Allocation Method –
3. Index Allocation- It addresses many of the
problems of contiguous and chained allocation.
In this case, the file allocation table contains
a separate one-level index for each file:
The index has one entry for each block allocated
to the file. Allocation may be on the basis of
fixed-size blocks or variable-sized blocks.
Allocation by blocks eliminates external
fragmentation, whereas allocation by variable-
size blocks improves locality. This allocation
technique supports both sequential and direct
access to the file and thus is the most popular
form of file allocation.
File Management
Directory Structure–
Single-level Directory
• In this a single directory is maintained for all the users.
File Management
Directory Structure–
Two-level Directory
• In this separate directories for each user is maintained.
• Path name: Due to two levels there is a path name for every file to locate that file.
Now, we can have same file name for different user.
Searching is efficient in this method.
File Management
Directory Structure–
Tree level Directory:
• Directory is maintained in the form of a tree.
• Searching is efficient and also there is
grouping capability.
• We have absolute or relative path name for a
file.
File Management
Disk Structure–
1. A hard disk is a sealed unit containing several
platters in a stack.
2. Hard disk (HDD) can be mounted in a horizontal
or vertical position.
3. Electromagnetic read/write heads are located
above and below each platter.
4. As the platters spin, the drive heads move
toward the center surface and edge. That way,
the drive heads can reach the entire surface of
each platter.
Basically structure of Hard Disk(HDD)
in Two types:
1. Physical Structure
2. Logical Structure
File Management
Disk Structure (Physical Structure) –
Hard Disk Physical structure can be divided into the
following terms:
1. Platters
2. Read/Write Heads
3. Spindle Motor
4. Logic Board
5. Drive Bay
File Management
Disk Structure (Physical Structure) –
Platters
• A platter is a round, metal disk that is mounted inside a hard
disk drive.
• Several platters are mounted on a fixed spindle motor to
create more data storage surfaces in a smaller area.
• These specific structures include tracks, sectors, and clusters
• Each track is broken down into smaller units called sectors.
As the sector is the basic unit of data storage on an HDD.
• A single-track typically can have thousands of sectors and
each sector can hold more than 512 bytes of data.
• Each partition on your hard disk is divided into clusters.
• A cluster is the smallest possible unit of storage on a hard
disk.
• The size of a cluster depends on two things:
• The size of the partition.
• The file system installed on the partition.
• Sectors are often grouped together to form Clusters.
File Management
Disk Structure (Physical Structure) –
Read/Write Heads:
• 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.
• The heads are the most sophisticated part of the hard
disk.
• Each platter has two read/write heads, one at the top
and the other at the bottom.
File Management
Disk Structure (Physical Structure) –
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.
File Management
Disk Structure (Logical Structure) –
• 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 five logical terms:
1. MBR (Master Boot Record)
2. DBR (DOS Boot Record)
3. FAT (File Allocation Tables)
4. Root Directory
5. Data Area
File Management
Disk Structure (Logical Structure) –
MBR (Master Boot Record)
• 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.
File Management
Disk Structure (Logical Structure) –
MBR (Master Boot Record)
• At the beginning of the hard drive is the
MBR. When your computer starts using
your hard drive(HDD), this is where it looks
first.
• The MBR itself has a specific organization.
The size of the MBR is 512 bytes.
• The boot loader is the first 446 bytes of the
MBR. This section contains executable code,
where programs are housed.
• The partition tables are 4 slots of 16 bytes
each, containing the description of a
partition (primary or extended) on the disk.
File Management
Disk Structure (Logical Structure) –
D.O.S BOOT RECORD (D.B.R)
• After the power-on self-test (POST), the BIOS loads from the hard disk into MBR (Master Boot
Record) memory and later performs it.
• First MBR tests the hard disk for an active partition, then loads it into the DOS boot record (DBR)
memory and removes control over the operating system boot code, and then loads the rest of the
operating system boot record code into the memory.
File Management
Disk Structure (Logical Structure) –
File Allocation table (FAT) –
• File Allocation Tables, FAT is a method for tracking the contents of hard drives used by operating
systems, first launched in 1977.
• 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.
1. FAT 8
2. FAT 12
3. FAT 16
4. FAT 16B
5. FAT 32
6. ExFAT
7. FATX
8. FAT+
File Management
RAID Disk Structure –
• RAID (redundant array of independent disks) is a way of storing the same data in different places on
multiple hard disks or solid-state drives (SSDs) to protect data in the case of a drive failure.
• There are different RAID levels
RAID devices use different versions, called levels
RAID setup concept defined six levels of RAID -- 0 through 5.
1. RAID 0.
2. RAID 1
3. RAID 2
4. RAID 3
5. RAID 4
6. RAID 5
• A RAID controller is a device used to manage hard disk drives in a storage array. It can be used as a
level of abstraction between the OS and the physical disks, presenting groups of disks as logical units.
Using a RAID controller can improve performance and help protect data in case of a crash.
File Management
RAID Disk Structure –
• RAID Level 0
• This configuration has striping but no redundancy of data. It offers the best performance, but
it does not provide fault tolerance.
File Management
RAID Disk Structure –
RAID Level 1
• Also known as disk mirroring, this configuration consists of at least two drives that duplicate the storage of data.
There is no striping. Read performance is improved, since either disk can be read at the same time.
• Write performance is the same as for single disk storage.
File Management
RAID Disk Structure –
RAID Level 2
• 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 ECC. RAID 2 has no
advantage over RAID 3 and is no longer used.
File Management
RAID Disk Structure –
RAID Level 3
• 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.
• Because 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.
THANK
YOU