Anda di halaman 1dari 7

CHAPTER 2.

2 (FILE SYSTEM)
File system Concept
File is a collection of data (binary, numeric or
character)
File can represent a program, a document or part
of the file system itself.
File can stored on various storage media
OS provides a uniform logical view of information
storage.
OS abstracts from the physical properties of its
storage device to define a logical storage unit.

File

Structure

Attribute

-Simple record
structure
-Complex
structure

-Name
-type
-location
-size
protection
-time,
date &
user
identificat
ion

Operati
on
-Create
a file
-Write a
file
Read(us
ea
system
-that
call
specifie
s)
Repositi
on
within
file
-Delete

Directory Concept
Directory stores information (attributes, location and
ownership) about all files
Directory represent collections of files

Type

Access Method

-Names
-extension

Sequential Access
-simplest method
-accessing from
beginning
-read next
-write next
-reset
-no read after last
write (rewrite)

Direct Access
-in any order
-most application used
-read n
-write n
-position to n
-read next
-write next
-rewrite n
-n = relative block number

Directo
ry

-Stores
information
about all files
-Both the
directory
structure and
the files reside
on disk
(secondary
storage)
-Contains files
name and
identifier
Identifier in
turn locates
other file
attributes
-More than 1KB
of information
for each file
-Directory
structure size
in MBs
-Backups of
files and
directory
structure kept

-Name
-Type
-Address
-Current
length
Maximum
length
-Date last
accessed
-Date last
updated
-Owner ID
Protection
informatio
n

Truncat
e
-Open
(Fi)
-Close
(Fi)
-List a
director
y
-Search
for a file
-Create
a file
-Delete
a file
Rename
a file
Travers
e the
file
system

Type of Directory
Single
level
-A
single
directo
ry for
all
users.
Namin
g
proble
m
Groupi
ng
proble
m

Two
level
Separa
te
directo
ry for
each
user.
-Has
path
name
-Can
have
the
same
file
name
for
differe
nt user
Efficien
t
searchi

Tree
Structured
Generaliza
tion of twolevel
directory
(with
arbitrary
height)
-Each user
has a
current
directory
(working
directory)
-Can
change
current
directory
via cd
command
or system
call
-Path

Acyclic Graph

General Graph

on tapes
Directo
ry
Files

Directo
ry
Files

Directo
ry
Files

ng
-No
groupi
ng
capabil
ity
-In
twolevel
directo
ry, this
tree
structu
re has
MFD as
root of
path
throug
h UFD
to user
file
name
at leaf.
-Each
user
has its
own
UFD
(User
File
Dir)
-UFDs
have
similar

names can
be
absolute or
relative

structu
re
-When
a user
logs in,
the
MFD
(Maste
r File
Dir) is
search
ed
-MFD is
indexe
d by
user
name
or
accoun
t no.
-Each
entry
in MFD
points
to a
UFD
-User
name
and file
name
define
a path
name

FILE
SYSTEM
MOUNTING

File system must be mounted before it can be accessed.

FILE
SHARING

-Sharing of files on multi-user systems is desirable.


-Sharing may be done through a protection scheme owner, group, and universe.
-On distributed systems, files may be shared across a network.
-Network File System (NFS) is a common distributed file-sharing method.
Protection mechanism provides controlled access by limiting the type of file access that can be made
Different types of access a read, write, execute, append, delete and list

FILE
PROTECTIO
N

3 types of user: owner (user who created the file),


group ( set of users)
and others (all other users in the system)
File owner/creator should be able to control:
what can be done

by whom
Types of access
Read
Write
Execute
Append
Delete
List

RWX
a). owner access

7 =>

111

RWX
b). group access
6 =>
110
RWX
c). public access
1 =>
001
Contiguous Allocation
Linked Allocation
-Each file occupies a set of
-Each file is a linked list of
contiguous
disk blocks: blocks may be
scattered anywhere on the
disk.

us blocks on the disk.


Advantages:

-Simple need only


starting address
-Free-space management
system no waste of space

Indexed Allocation
- Brings all pointers together into the
index block.
-Logical view.
-Need index table
-Random access
-Random access without external
fragmentation, but have overhead of
index block.

FILE
TECHNOLO
GY

-Simple only starting location


(block number) and length
(number of blocks) are
required.
-Random access.
Disadvantages:
-Wasteful of space (dynamic
storage-allocation problem).
-Files cannot grow.

-No random access


-Clusters of blocks are
used for better
performance (disk head
moving) and to have fewer
pointers

OPERATING SYSTEM
MS-DOS, Windows 95
Windows 95,98, Me
Windows NT, 2000, XP
Linux
FAT (File Allocation Table)

FILE TECHNOLOGY SUPPORTED


FAT16
FAT16, FAT32
FAT16,FAT32, NTFS
FAT16, FAT32, Ext2
NTFS (Windows File
EXT (Extended File System)
System)

Anda mungkin juga menyukai