0% found this document useful (0 votes)
86 views23 pages

Chapter 13

This document discusses file systems and directories. It provides an overview of how directories store file name to file number mappings. Directories can be implemented as a simple linear list or with an additional hash-based structure. File metadata like size and permissions can be stored in file headers or directory entries. Common file system goals are sequential data placement, efficient random access, and support for various file sizes. Example file systems discussed are FAT, FFS, and NTFS. FAT uses a File Allocation Table to map files to blocks while FFS uses an indexed tree structure and locality heuristics. NTFS uses extents to store file data and a flexible tree structure to organize metadata.

Uploaded by

Chanel Hooper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views23 pages

Chapter 13

This document discusses file systems and directories. It provides an overview of how directories store file name to file number mappings. Directories can be implemented as a simple linear list or with an additional hash-based structure. File metadata like size and permissions can be stored in file headers or directory entries. Common file system goals are sequential data placement, efficient random access, and support for various file sizes. Example file systems discussed are FAT, FFS, and NTFS. FAT uses a File Allocation Table to map files to blocks while FFS uses an indexed tree structure and locality heuristics. NTFS uses extents to store file data and a flexible tree structure to organize metadata.

Uploaded by

Chanel Hooper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

CHAPTER 13

FILES AND DIRECTORIES


IMPLEMENTATION OVERVIEW
 Directories and index structures

 Free space maps


 Locality heuristics
DIRECTORIES
 A directory is a file that contains file name to file
number mappings
DIRECTORIES
DIRECTORY INTERNALS
 Simple linear list of file (name, file number pairs)
DIRECTORY INTERNALS
 List with additional hash based structure

Logical view
DIRECTORY INTERNALS
 List with additional hash based structure

Physical storage
FILE METADATA
 Includes file size, owner, reference count, access
time etc.
 Can be stored in a file header or directory entries

 Storing metadata in directory entries is problematic


if the file system supports multiple hard links to a
file
FILE SYSTEM GOALS
 Sequential data placement
 Efficient random access

 Efficiently support both small and large files

 Store metadata
FAT FILE SYSTEM
 File number is the
index of the files first
entry in FAT
 At most 228 blocks

 32 bit entries

 One entry for each


block
 Max file size 232 -1
bytes
 End of file is indicated
by special value
 Free block is indicated
by 0
FAT FILE SYSTEM
 Poor locality
 Poor random access

 Limited file metadata and access control

 No support for hard links

 Limitations on number blocks and file size


FFS: INDEX STRUCTURE
FFS: CHARACTERISTICS
 Tree structure
 High degree

 Fixed structure

 Asymmetric
FFS: LOCALITY HEURISTICS
 Block group placement
 Files data and metadata are placed nearby
 Different files from the same directory are placed
close to each other
 Files from different directories are placed far from
each other
 Reserved space
 Improve the performance when the disk is almost full
FFS: LOCALITY HEURISTICS
FFS: LOCALITY HEURISTICS
NTFS FILE SYSTEM
 Two main characteristics
 Extents
 Flexible tree
MASTER FILE TABLE (MFT)
 Stores an array of 1KB records
 Each record is a sequence of attributes

 Both data and meta-data are considered


attributes of a file
 Two types of attributes
 Resident
 Non-resident
REFERENCE
Chapter 13
Operating Systems: Principles & Practice
Thomas Anderson and Michael Dahlin

You might also like