Macintosh Hierarchical File System by Imad Qamar 2190-B.

14
Macintosh Macintosh Hierarchical File System Hierarchical File System by by Imad Qamar Imad Qamar 2190-B 2190-B

Transcript of Macintosh Hierarchical File System by Imad Qamar 2190-B.

Page 1: Macintosh Hierarchical File System by Imad Qamar 2190-B.

MacintoshMacintoshHierarchical File SystemHierarchical File System

byby

Imad QamarImad Qamar

2190-B2190-B

Page 2: Macintosh Hierarchical File System by Imad Qamar 2190-B.

What is HFS?What is HFS?

Hierarchical File SystemHierarchical File System ((HFSHFS), is a file system ), is a file system developed by Apple Computers developed by Apple Computers for use on computers running for use on computers running Mac OS.Mac OS.

Designed for use on floppy and Designed for use on floppy and hard disks.hard disks.

Also known as Also known as Mac OS Mac OS StandardStandard..

Page 3: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Design Design

The Hierarchical File System The Hierarchical File System divides a volume into divides a volume into logical logical blocks.blocks.

Logical blocks are then grouped Logical blocks are then grouped together into together into allocation blocks.allocation blocks.

Size of allocation block depends Size of allocation block depends upon size of volume.upon size of volume.

No# of allocation blocks:No# of allocation blocks: 65,536 65,536

Page 4: Macintosh Hierarchical File System by Imad Qamar 2190-B.

HFS Volume HFS Volume

Five structures make up an HFS Five structures make up an HFS volume.volume.

Boot BlocksBoot Blocks Master Directory BlockMaster Directory Block Volume BitmapVolume Bitmap Extent Overflow FileExtent Overflow File Catalog FileCatalog File

Page 5: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Boot BlocksBoot Blocks

Logical blocks 0 and 1.Logical blocks 0 and 1.

Contain system startup Contain system startup information.information.

e.g. System and Shell (Finder) e.g. System and Shell (Finder) Files loaded at startup.Files loaded at startup.

Page 6: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Master Directory BlockMaster Directory Block

Logical Block 2Logical Block 2

Defines a variety of data about Defines a variety of data about the volume:the volume: Time of volume creation.Time of volume creation. Size of logical structures (e.g. Size of logical structures (e.g.

allocation blocks)allocation blocks) Location of volume structures.Location of volume structures.

Page 7: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Volume BitmapVolume Bitmap Logical Block 3.Logical Block 3.

Keeps track of which allocation Keeps track of which allocation blocks are in use and which are blocks are in use and which are free.free.

Allocation represented by a bit:Allocation represented by a bit: Set = Block in use.Set = Block in use. Not set = Block is free.Not set = Block is free.

Page 8: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Extent Overflow FileExtent Overflow File

Follows a B-tree data structure.Follows a B-tree data structure.

Contains extra Contains extra extents extents to record to record which allocation blocks are which allocation blocks are allocated to which files.allocated to which files.

Is used after all 3 Is used after all 3 extents extents of the of the Catalog File are used up.Catalog File are used up.

Page 9: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Catalog FileCatalog File

Also follows a B-tree data Also follows a B-tree data structure.structure.

Contains records for all the Contains records for all the files/directories stored in the files/directories stored in the volume.volume.

File/Directories are located by File/Directories are located by their their Catalog Node IDCatalog Node ID..

Page 10: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Catalog File (Continued)Catalog File (Continued)

Each file consists of:Each file consists of: File Thread RecordFile Thread Record File RecordFile Record

Each directory consists of:Each directory consists of: Directory Thread RecordDirectory Thread Record Directory RecordDirectory Record

Page 11: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Catalog File (Continued)Catalog File (Continued)

File Thread Record:File Thread Record:Stores:Stores: Filename Filename CNID of its parent directory.CNID of its parent directory.

File Record:File Record:Stores meta data of a file:Stores meta data of a file: CNIDCNID Size of fileSize of file

Page 12: Macintosh Hierarchical File System by Imad Qamar 2190-B.

Catalog File (Continued)Catalog File (Continued)

Directory Thread Record:Directory Thread Record:Stores:Stores: Directory name.Directory name. CNID of its parent directory.CNID of its parent directory.

Directory Record:Directory Record:Stores data such as:Stores data such as: No# of files stored in directoryNo# of files stored in directory CNID of the directoryCNID of the directory

Page 13: Macintosh Hierarchical File System by Imad Qamar 2190-B.

HFS (Some more info)HFS (Some more info)

Max file size:Max file size: 2 GB2 GB

Max no# of files:Max no# of files: 6553565535

Max filename size:Max filename size: 31 31 charchar

Max Volume size:Max Volume size: 2 TB2 TB

Directory Contents:Directory Contents: B-treeB-tree

File Allocation:File Allocation: B-treeB-tree

Bad Blocks:Bad Blocks: B-treeB-tree

Page 14: Macintosh Hierarchical File System by Imad Qamar 2190-B.

The EndThe End