Session Notes: August Learning Session

Storing our Digital Lives: Mac filesystems from MFS to APFS

Rich Trouton, HHMI

MFS – Macintosh File System

Once upon a time: Macintosh File System.

Introduced resource forks:
* Graphical data stored on disks (floppy)
* Enabled easier localization through multiple language objectst inside a fork.
* Simplified application distro.

Stored metadata needed to support the OS.

MFS was a fully flat file system. Finder created an illusion of folders, but that’s all it was. A processor in the filesystem would

Filesystem limitations:

  • Max volume size 20MiB
  • Max file size 20MiB
  • 4094 files total files
  • 255 chars filesize (still longer than XP)

MFS Discontinued in 1985. You could read and write it til 7.6.1, and read it til Mac OS 8.

MFSLives could read it for 10.0+

HFS – Hierarchical File System

HFS arrives in 1985. Apple’s 20MB Hard Disk 20 was the reason.

HFS necessary because MFS couldn’t handle that massive number of files.

The Catalog File supported the binary tree structure, or b-tree.
Retained resource forks and 255char name max. Finder drops to 31char name, limitation of that app.

REAL DIRECTORIES!
Unique file identifiers exist.
Redeveloped the file structures to support 32-bit names.
HFS supports 65536 files.

Filesystem limitations:

  • 2TB volume size
  • 2GB file size
  • 65535 files.
  • 255 file length name (but Finder wouldn’t do more than 31 chars)

HFS created issues, though…

Only one program at a time can write to the catalog file, creating access problems. And what happens if you hit the catalog file with a problem? Yeah, whole system goes boom.

As drives increase in size, so does the minimum filesize! 1 byte file would be 16KB on 1GB disks. Uh oh. That’s no good.

The FAT-16 filesystem has the same problem.

HFS+

Fixes the allocation block issue for most progblems.

HFS+ adds Unicode support, and addresses the file name length issue.

Filesystem limitations:

  • Max File Size 8 Exabytes.
  • Max Volume Size 8 Exabytes.
  • Max files 4 billion+
  • Unable to checksum metadata
  • 1 second timestamp granularity (no nanosecond…)
  • Single-threaded access to filesystem.

10.2.2 brings optional journaling.
10.3 brings journaling by default., HFSX support (case sensitive), Unicode 3.2 support
10.4 Support for windows style ACL, Extended Attribute
10.5 Hard link support!
10.6 HFS+ Compression support
10.7 CoreDStorage!
10.8 CoreStorage Fusion Drives!
iOS/tvOS/watchOS per-file encryption support.

HFS+ & Time Machine = Beachball because of single-threaded access.
Dates are 32-bit integers. Feb 6, 2040 6:28:15 GMT is the end of the filesystem.
No support for sparse files.
No support for filesystem snapshots
Big-endian filesystem, little-endian processors – designed for PowerPC. Performance cost is negligible, but present.

And now, APFS.

Apple File System (APFS)

64bit file system
9 quintillion files!
1 nanosecond timestamp
Sparse file support
Snapshot support!
Atomic Safe-Save – Saves will either happen or not, no in between.
Extended Attribute Native Support

Disk

APFS Container

APFS Volume

APFS Namespace

diskutil partitionDisk /dev/disk0 1 GPT APFS DriveName 100%

diskutil apfs list

-IHaveBeenWarnedTheAPFSIsPreReleaseAndThatIMayLoseMyData flag will remove the lengthy disclaimer concerning potential data loss on a pre-beta filesystem.

Demos Occur Here.

Volumes can be converted via command at the cost of all their data.
Volumes can be dynamically resized.
Containers & Volumes can be created in one command. diskutil apfs create will do this.

Volumes stored on a container will show the same available space size. That means space is shared evenly between all volumes on a container. Space is managed on a Container-level.

Cloning is a copy that is disk efficient. A cloned file that is altered ONLY stores the CHANGED BLOCKS. Duplicate (clone) a 10GB file will happen instantly. Then changes to that file will be stored as a diff.

APFS Snapshots will let you Create Snapshots, List Snapshots, and Delete Snapshots.
Snapshots will take up space.

apfs_snapshot is our dev only command for now. It will get new syntax at some point in the future.

apfs_snapshot -l : list snapshots.
apfs_snapshot -d : delete snapshot.
apfs_snapshot -c : create Snapshot.

mount_apfs -s SnapShotName /Volumes/VolumeName /path/to/mount
READ ONLY access to snapshots.

Snapshots can take up a lot of space. You’re going to want to watch this. Potential user problem.

fsck_apfs exists!

APFS Limitations:

  • APFS volumes can’t be boot drives
  • case-sensitive is mandatory now
  • Time Machine backups don’t work
  • FV2 is not supported
  • Fusion drives are not supported

Comments

There may be a delay in between release and support for vendors.
Shadow Snapshots? Unknown.
This support is very very iterative.
There will be a seamless process to move from HFS to APFS.

Leave a Reply