07 - MacOS File Systems

Class: CYBR-405


Notes:

Objectives

Early days of MacOS

Understanding Mac Files Structures

Hierarchical File System (HFS) - Launched in 1985

Hierarchical File System (HFS+) - Launched in 1998

Apple File System (APFS) - Launched in 2017

Why do you think they went from HFS to HFS+?

An Overview of Mac File Structures

Notes:

Common Evidence Sources

Here are a few differences between Window and macOS file systems

Windows Mac Description
AppData /Libraries Directory where applications
information is stored.
IWindows /private/var/root Directory where system information
is stored
IUsers /Users Directory where user information is
stored

Forensics Procedures 1

For forensics procedures in macOS:

Application settings are in three formats:

FileVault is used to encrypt and decrypt a user's directory

Forensics Procedures 2

Keychains

Deleted files are in the Trashes folder

Where stored...

Forensics Procedures 3

APFS (Modern Macs)

APFS Architecture Overview

Notes:

APFS Containers and Dynamic Volumes

In NTFS, partitions are rigid. In APFS, volumes flex. They all pull space from the same container pool.

Notes:

Copy on Write (CoW) in APFS

Instead of erasing old "homework", APFS writes a new version and just updates the pointer.

Notes:

APFS Metadata Structure

Notes:

APFS Snapshots

Notes:

APFS File Cloning

Forensics note:

APFS Encryption Model

Encryption is not an add-on. It is built into the architecture.

Note:

NTFS vs APFS vs Ext4

Feature NTFS APFS Ext4 (Linux)
Volume Structure Fixed partitions Container + dynamic volumes Fixed partitions
Metadata MFT Object map + COW Inodes
Snapshots Shadow Copy Native snapshots Not native
Cloning No Yes No
Encryption BitLocker Native encryption Separate layer

Notes:

Forensic Impact of APFS Features

Notes:

This is how the File Structure looks like in MacOS

> df -h
Filesystem        Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/disk3s1s1   460Gi    15Gi   170Gi     9%    453k  1.8G    0%   /
devfs            201Ki   201Ki     0Bi   100%     696     0  100%   /dev
/dev/disk3s6     460Gi    20Ki   170Gi     1%       0  1.8G    0%   /System/Volumes/VM
/dev/disk3s2     460Gi    15Gi   170Gi     9%    1.9k  1.8G    0%   /System/Volumes/Preboot
/dev/disk3s4     460Gi   782Mi   170Gi     1%     547  1.8G    0%   /System/Volumes/Update
/dev/disk1s2     500Mi   6.0Mi   481Mi     2%       1  4.9M    0%   /System/Volumes/xarts
/dev/disk1s1     500Mi   6.0Mi   481Mi     2%      35  4.9M    0%   /System/Volumes/iSCPreboot
/dev/disk1s3     500Mi   2.4Mi   481Mi     1%      93  4.9M    0%   /System/Volumes/Hardware
/dev/disk3s5     460Gi   257Gi   170Gi    61%    1.8M  1.8G    0%   /System/Volumes/Data
map auto_home      0Bi     0Bi     0Bi   100%       0     0     -   /System/Volumes/Data/home
/dev/disk3s1     460Gi    15Gi   170Gi     9%    453k  1.8G    0%   /System/Volumes/Update/mnt1

Linux OS

Linux File System Philosophy

Evolution of Linux File Systems

Ext4 Architecture Overview

Pasted image 20260225092700.png|475

Notes:

The Superblock

Forensic note:
Corrupted superblock can prevent mounting but recovery may still be possible using backups.

Notes:

inodes - the Heart of Linux

Important concept:

Notes:

Ext4 Extents

Journaling in Ext3 and Ext4

Forensics angle:
Journal may contain remnants of recent metadata activity.

Notes:

Deleted File Behavior in Linux

NOTE: If inode and data blocks are not overwritten, recovery is possible

Notes:

Linux vs NTFS vs APFS

NTFS → Centrailized MFT-based
APFS → Container-based and Copy-On-Write (COW)
Ext4 → Inode based + journaling

Introduction to ZFS

ZFS is not the default Linux file system.
Ext4 still dominates most Linux distributions.

However:
ZFS is widely used in

And architecturally, it is very similar to APFS in some ways.

Notes:

ZFS

Notes:

ZFS Storage Model

Pasted image 20260225094113.png|400

ZFS Copy-on-Write

ZFS Data Integrity Model

Notes:

ZFS vs Ext4

IMPORTANT:

Summary