Sie sind auf Seite 1von 39

File Systems

Computer Systems
File Allocation Table
• A special file that is used by the
operating system to store the physical
location of all the files on a storage
medium such as floppy disks or hard
disks.
• Like creating a table of contents
• Varies depending on the type of media
• It was developed by Bill Gates and Marc
McDonald during 1976–1977
How FAT stores data?

• The OS looks at the FAT to see w/c clusters are


empty.
• The OS then puts the data of the file in empty
clusters.
• The name of the new file & the no. of the
cluster are recorded in the directory.
• If a file doesn’t fit a single cluster will spill over
to the adjacent empty cluster.
• If the adjacent cluster is full, the OS stores the
file in a noncontiguous (non-adjacent) cluster &
sets up instructions called “pointers”.
How is data be retrieved?
• The OS looks through the directory for the
filename & the no. of the first cluster.
• The FAT tells the PC w/c clusters contains the
remaining data for the file.
• The OS moves the R/W head to the cluster
that contains the beginning of the file.
• If the file is stored in more than 1 cluster, the
R/W head must move to the next cluster.

NOTE: It takes longer to access a file stored in


a noncontiguous cluster
When a file is being erased…..
• The OS changes the status of the appropriate
cluster in the FAT.
• Ex. Cluster 7,8,10. The status is changed into
“empty or 0”.
• The data is not physically removed from the
cluster. Instead, it will remain until a new file
is stored there.
• To recover:
For DOS, undelete utilities.
For Windows, Recycle Bin.
For Random Access Storages…
• File tends to become “FRAGMENT”
meaning ‘file is stored in noncontiguous
clusters.

• DEFRAGMENT Utility – arranges the file


so that it will be stored in contiguous
clusters.
Result
FAT Four sections
• Reserved sectors, located at the very
beginning.
– The first reserved sector (sector 0) is the Boot
Sector.
– It includes an area called the BIOS Parameter
Block (with some basic file system information,
in particular its type, and pointers to the
location of the other sections) and usually
contains the operating system's boot loader
code. The total count of reserved sectors is
indicated by a field inside the Boot Sector.
FAT Four sections
• The FAT Region. This typically
contains two copies (may vary) of the
File Allocation Table for the sake of
redundancy checking, although the
extra copy is rarely used, even by disk
repair utilities. These are maps of the
Data Region, indicating which clusters
are used by files and directories.
FAT Four sections
• The Root Directory Region. This is a
Directory Table that stores information
about the files and directories located in
the root directory.
FAT Four sections
• The Data Region. This is where the
actual file and directory data is stored
and takes up most of the partition.
FAT
Developer Microsoft
File Allocation Table
Full Name (16-bit
(12-bit version) (32-bit)
version)
Introduced before 1980 1987, 1996
(MS- BASIC) ( DOS 3.31) (Windows 95)
Limits
Max file size 4 GB minus 1 byte
Max Volume 32MB 4GB 16TB
Max cluster 65,517 (2 16- 268,435,437
4,077 (2 -19)
12
count 19) (228-19)
Max
8.3 filename, or 255 UTF-16 characters
filename size
FAT Architecture
Component Description
Hard disk Contains one or more partitions.
Bootable partition that stores
information about the layout of the
Boot sector
volume and the file system
structures. This loads the Ntdlr.
Contains executable code that the
Master Boot
system BIOS loads into memory.
Record
partition.
Switches the CPU to protected mode,
Ntldlr.dll starts the file system, and then reads
the contents of the Boot.ini file.
Component Description

System file driver for FAT16 and


Fastfat.sys
FAT32.
Extracts information about which
Ntoskrnl.exe system device drivers to load and the
load order.
The processing mode that allows
Kernel Mode code to have direct access to all
hardware and memory in the system.
The processing mode in which
User Mode
applications run.
FAT
• The cluster size depends on the operating
system and several variables, including
the size of the hard disk.

• FAT16 uses a 16-bit file allocation table


entry (216 clusters).

FAT32 uses a 32-bit file allocation table


entry. However, it uses a theoretical
maximum of 228 clusters.
Default FAT Cluster Sizes
Volume Size FAT16 FAT32

1–2 (GB) 32 KB 4 KB
2 - 4 (GB) 64 KB 4 KB
4 - 8 (GB) Not supported 4 KB
8 -16 (GB) Not supported 8 KB
16 –32 (GB) Not supported 16 KB
32 GB– 2TB Not supported Not supported
Cluster Size = Disk Space /
Number of Clusters Possible
FAT32
• Ex.
• A 20 KB file would require two 16 KB
clusters actually occupying 32 KB of
space. A mere 1 KB file still requires 16
KB of space.
• A typical large disk might have 30% or
even 40% of its space wasted in this
way
Problems with FAT
• with bigger disks is the large amount of
wasted space or “slack”
• Quick performance decrease with the
fragmentation going up.
• Difficulty in access to big files (more
than 10% of the disc space).
• Very slow work with directories
containing huge amount of files.
FAT32 Multiple Issues
• -windows systems can only format a drive
up to 32 GB. 2TB for some OS.
• - The maximum file size on a FAT32
formatted drive is around 4 GB.
• - Dealing with fragmentation and free disk
space calculations can become painfully
resource intensive in large FAT32 systems.
• - A FAT32 directory can have 65,536
directory entries.
NTFS
• New Technology File System
• Developer- Microsoft
• Developed last July, 1993 for Windows
NT 3.1
• Overcomes FAT system limitations
NTFS
• “Journaling” file system
– Keeps track of transaction performed
– “Rolls back” transactions if errors found
• Uses a Master File Table (MFT)
– Stores data about all files and directories
– Similar to database table with records
• Uses clusters
• Reserves blocks of space to allow the
MFT to grow
Connecting with Computer
23 Science, 2e
NTFS
• stores all objects in NTFS
Volume Size
the file system using Cluster Size
a record called the
7 -512 MB 512 bytes
Master File Table
(MFT),
513-1,024 MB 1 KB

1,025MB-2 GB 2 KB

2GB-2 terabytes 4 KB
NTFS Architecture
Organization of an NTFS Volume
ADVANTAGES of NTFS:
• NTFS is much more flexible than FAT.
Its system areas are almost all files
instead of the fixed structures used in
FAT.
• NTFS has much more security built in.
• supports both long and short file names
ADVANTAGES of NTFS:
• NTFS is much more flexible than FAT.
Its system areas are almost all files
instead of the fixed structures used in
FAT.
• NTFS has much more security built in.
• supports both long and short file names
ADVANTAGES of NTFS:
• File compression
• Encrypting File System (EFS)
• Volume Shadow Copy
• Disk quotas
Disadvantages of NTFS
• Large overhead
– Not recommended for volumes less than 4
GB
• Cannot access NTFS volumes from:
– MS-DOS
– Windows 95
– Windows 98
– Linux
Connecting with
Computer Science,
2e 30
LIMITATIONS of NTFS:
• High memory & processing ratings

• .Old software might not run on NTFS


Comparing File Systems
• Choosing correct file system
– Operating system dependent
– Rarely depends on hardware
• NTFS: Windows XP or Vista
– Supports drive sizes up to 16 TB (1600 GB)
• FAT: Windows 9x
– Older small hard drives, small removable
devices
• UNIX/Linux Connecting with
Computer Science,

– Many file system choices


32 2e
Comparing File Systems (cont’d.)

Table 10-1, Fat16, FAT32, and NTFS compared

Connecting with Computer Science, 2e


33
Comparing File Systems (cont’d.)

Table 10-2, Some UNIX/Linux file systems

Connecting with Computer


Science, 2e 34
eXFAT
• Also called as “FAT64”
• November 2006 (Windows Embedded
CE 6.0)
• is a proprietary, patent-pending file
system designed especially for USB
flash drives
exFAT Limits
• Volume size 128PiB
– MS said 64ZiB
– MS now says 256TiB
• File Size 16 EiB (64 bit number)
– Bigger than volume size
• Subdirectory 256MiB
• Sector 512-4096 bytes (29-212)
• Cluster 32MiB (225)
• No floppy support
• No FAT32 minimum cluster (65,525) restriction
• No 8.3 file name support
June 6th, 2010 36
Extended File Allocation Table
(exFAT)
• has several advantages over FAT32:
– File size up to 16 exabytes
– Format size limits and files per directory limits
are practically eliminated.
– exFAT uses free space bitmaps to reduce
fragmentation and free space
allocation/detection issues.
– permission systems should be able to be
attached through an access control list (ACL)
Disadvantages
• Limited or no support outside PC/Mac
environment at present
• The standard exFAT format only uses a
single file allocation table and free
space map.
• Not transparent in file compression &
file encryption
• Only few OS can access exFAT storages
ASSIGN: File Systems Used in the ff:
• MAC OS
• SSDs

• Give its features.