File management in UNIX and windows 2000

Download Report

Transcript File management in UNIX and windows 2000

File management in UNIX
and windows 2000
 FILE MANAGEMENT:
File Management system is that set of system software
that provides services to users and applications in
the use of files.
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 .
UNIX File Management
UNIX file system is hierarchical file system.
The directory that you are placed when you
first log on to the system is called the home
directory.
System administrator creates the home
directory for each user.
Different Type Of Files
 Ordinary files
 Directories
 Special files
 Pipes
Ordinary Files
This type of file is used to store information, such as
some text or an image.
Any file is always contained within a directory.
Files do not actually reside inside directories. A
directory is a file that contains references to other
files. The directory holds two pieces of information
about each file:
• Its filename.
• An inode number which acts as a pointer to where
the system can find the information it needs about
this file.
Directories
A directory is a file that holds other files and other
directories. You can create directories in your home
directory to hold files and other sub-directories.
Having your own directory structure gives you a
definable place to work from and allows you to
structure your information in a way that makes best
sense to you.
Special Files
This type of file is used to represent a real physical
device such as a printer, tape drive or terminal.
It may seem unusual to think of a physical device as a
file, but it allows you to send the output of a
command to a device in the same way that you send
it to a file.
Pipes
UNIX allows you to link commands together using a
pipe.
The pipe acts a temporary file which only exists to
hold data from one command until it is read by
another.
The pipe takes the standard output from one command
and uses it as the standard input to another
command
Structure Of The File System.
The UNIX file system is organized as a hierarchy of
directories starting from a single directory called
root which is represented by a / (slash). Imagine it
as being similar to the root system of a plant or as
an inverted tree structure.
Immediately below the root directory are several
system directories that contain information required
by the operating system.
Controlling Access To Files
And Directories
Every file and directory in your account can be
protected from or made accessible to other users by
changing its access permissions.
You can only change the permissions for files and
directories that you own
Controlling Access To Files
And Directories(contd.)
The user has following options
•
•
•
•
Displaying access permissions
Understanding access permissions
Default access permissions
Changing group ownership of files and directories
• Changing access permissions
i-node
A Unix file is described by an information block
called an i-node.
There is an i-node on disc for every file on the disc
and there is also a copy in kernel memory for every
open file.
All the information about a file, other than it's name,
is stored in the i-node
i-node(contd.)
The following information is contained in the i-node
• File access and type information, collectively
known as the mode.
• File ownership information.
• Time stamps for last modification, last access and
last mode modification.
• Link count.
• File size in bytes.
• Addresses of physical blocks.
Structure of i-node
Structure of the i-node(contd.)
 There are 13 physical block addresses in an i-node,
each of these addresses is 3 bytes long.
 The first ten block addresses refer directly to data
blocks, the next refers to a first level index block
 the next refers to a second level index block which
holds the addresses of further index blocks
 the last refers to a third level index block which
holds the addresses of further second level index
blocks.
Windows 2000 File System
Windows 2000 supports a number of file systems,
including the file allocation table (FAT) that runs on
windows 95, MS DOS, and OS/2. But the
developers of windows 2000 also designed a new
and a very effective file system, NTFS file system
NTFS Physical Structure
The NTFS partition theoretically can be almost of any
size
NTFS divides all useful place into clusters - data
blocks used at a time. NTFS supports almost all
sizes of clusters - from 512 bytes up to 64 KBytes.
The 4 KBytes cluster is considered to be some
standard..
NTFS Layout
Overview Of Partition structure
NTFS disk is symbolically divided into two parts
• The first 12% of the disk are assigned to so-called
MFT area (Master File Table). The MFT-area is
always kept empty not to let the most important
service file (MFT) be fragmented at growth.
• The rest 88% of the disks represent usual space for
files storage.
MFT & Its Structure
The most important file on NTFS is named MFT or
Master File Table - the common table of files
MFT is divided into records of the fixed size (usually
1 KBytes), and each record corresponds to some
file.
The first 16 files are housekeeping and they are
inaccessible to the operating system. They are
named metafiles and the very first metafile is MTF
itself.
Features Of NTFS






Directories
Journalizing
Compression
Security
Encryption
Recoverability
Directories
The directory on NTFS is a specific file storing the
references to other files and directories establishing
the hierarchical constitution of disk data
The directory file is divided into blocks, each of them
contains a file name, base attributes and reference
to the element MFT which already gives the
complete information on an element of the
directory.
Journalizing
NTFS is a fail-safe system which can correct itself at
practically any real failure.
NTFS just doesn't have intermediate (erratic or
incorrect) conditions - the data variation quantum
cannot be divided on before failure or after it
bringing breakups and muddle - it is either
accomplished or cancelled.
Compression
Files on the NTFS volume have one rather useful
attribute - "compressed".
Any file or directory in the individual order can be
stored on the disk in the compressed form and this
process is completely clear for applications
The file compression has very much high speed and
only one large negative property - huge virtual
fragmentation of compressed files which however
does not bother anybody.
Security
NTFS is supposed to be the most perfect file system
from all nowadays existing.
In theory it is undoubtedly so, but in current
implementations unfortunately the rights system is
far enough from the ideal.
NTFS file system rights are close connected with the
system itself, and that means they are not obligatory
to be kept by another system if it is given physical
access to the disk
Encryption
Each file or directory can be encrypted and
thus cannot be read by another NT
installation.
In combination with standard and safe
password on the system, important data
selected by you can be protected.
Recoverability
Each file on an NTFS volume is listed as a record in a
special file called the Master File Table (MFT).
The first record in the table describes the MFT itself.
second record is an MFT "mirror" record. If the first
MFT record is corrupted, NTFS uses the second
record to find the MFT mirror file.
The third record in the MFT is the log file which
records all file transaction information.
Recoverability(contd.)
If a transaction completes successfully, NTFS
commits the file update to disk.
If the transaction is not complete, NTFS ends or rolls
back the transaction.
If the system crashes, NTFS performs three passes
through the data on the disk: an analysis pass, a
redo pass, and an undo pass.
Recoverability(contd.)
The NTFS recovery pass involves the following
six steps:
1.
2.
3.
4.
5.
6.
When Windows NT recognizes an NTFS volume, it reads the MFT.
NTFS calls the Log File Service to open the log file. This causes the Log File
Service Recovery to take place.
NTFS calls the Log File Service to read its restart area and reads all the data
from the last checkpoint operation. This data initializes the transaction table,
dirty pages table, and open file table so they can be used in the recovery
process.
NTFS performs an analysis pass on its last checkpoint record. At the end of
this pass, the transaction table contains only transactions that were active
when the
NTFS performs a redo pass. At the end of this pass, the cache reflects the
state of the volume when the crash occurred.
NTFS performs an undo pass. At the end of this pass, the volume is recovered
to a stable state
Advantages Of NTFS
 The NTFS file system is best for use on volumes of
about 400 MB or more, because performance does
not degrade as much on larger NTFS volumes as
compared to larger FAT volumes
 You can assign permissions to individual files and
folders, so you can specify who is allowed various
kinds of access to a file or folder
 You can assign permissions to individual files and
folders, so you can specify who is allowed various
kinds of access to a file or folder