design and development videos - apple developer - 715 … · 2017-06-10 · ios 10.3 apfs became...

86
#WWDC17 © 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. Pavel Sokolov, File System Manager Eric Tamura, File System Manager What’s New in APFS Session 715 System Frameworks

Upload: others

Post on 07-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

#WWDC17

© 2017 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

Pavel Sokolov, File System Manager Eric Tamura, File System Manager

•What’s New in APFS • Session 715

System Frameworks

Page 2: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

•APFS on iOS •APFS on Mac

Page 3: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

•APFS on iOS •APFS on Mac

Page 4: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

•Default filesystem (iOS 10.3) •Conversion to APFS •Normalization/case-sensitivity (iOS/tvOS/watchOS)

Page 5: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update
Page 6: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

iOS/tvOS/watchOS devices migrated to APFS successfully

Millions

Page 7: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

iOS 10.3

Page 8: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

iOS 10.3

APFS became the default filesystem on iOS 10.3

Millions of devices converted successfully

Update frees up storage for end-users

Adds APFS capabilities to iOS/tvOS/watchOS devices

Listening to developer feedback to improve and refine

Page 9: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion to APFS

Page 10: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion to APFS

APFS conversion occurs inline during update to iOS 10.3 and beyond

Tracking results during update process

Feedback from iOS conversion yields improvements on macOS

Page 11: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion

Meta Meta MetaSB File Data File Data

Page 12: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion

Meta Meta MetaSB File Data File DataMeta Meta Meta

Page 13: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion

Meta Meta MetaSB File Data File DataMetaMetaMeta

Page 14: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion

Meta Meta MetaSB File Data File DataMetaMeta Meta

Page 15: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion

Meta Meta MetaFile Data File DataMetaMetaMetaAPFS SB

Page 16: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Conversion

File Data File DataMetaMetaMetaAPFS SB

Page 17: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode and APFS

Unicode NFC vs. NFD

Prior to iOS 11, APFS stored filenames as non-normalized UTF-8

Page 18: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode and APFS

ñU+00F1

Unicode NFC vs. NFD

Prior to iOS 11, APFS stored filenames as non-normalized UTF-8

Page 19: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode and APFS

ñ n ~ + U+00F1 U+006E U+0303

Unicode NFC vs. NFD

Prior to iOS 11, APFS stored filenames as non-normalized UTF-8

Page 20: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode and APFS

Page 21: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode and APFS

Native vs. Runtime normalization

Native normalization available today in macOS Developer Seed (case-sensitive)

Native normalization coming soon for iOS 11 (erase-restores only)

Runtime normalization will be available in iOS 10.3.3 and iOS 11

Future update will convert all devices to new native normalization

Page 22: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

•APFS on iOS •APFS on Mac

Page 23: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Pavel Sokolov, File System Manager

•APFS on macOS

Page 24: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Features

Page 25: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Features

Next-generation file system designed for iOS, tvOS, watchOS, macOS

Cloning

Copy-on-write

Snapshots

Natively supported encryption

Space sharing

Defragmentation

Page 26: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

Page 27: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

System volume is converted by installer

Manual conversion for other volumes

Multiple containers do not share space

Page 28: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

Page 29: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

HFS+

Page 30: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

HFS+

CoreStorage

Page 31: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

HFS+

CoreStorage

Fusion

Page 32: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

HFS+

CoreStorage

Fusion

FileVault

Page 33: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

HFS+

CoreStorage

Fusion

FileVault

APFS

Page 34: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

APFS

Forward Migration

HFS+CoreStorageFusionFileVault

Page 35: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

APFS

Forward Migration

Page 36: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

Page 37: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Forward Migration

Page 38: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Space Sharing

GPT ESP Volume1 Volume2

GPT ESP Volume1 Volume2

HFS

APFS Container

Page 39: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Space Sharing

GPT ESP Volume1 Volume2

HFS

APFS Container

Volume1GPT ESP Volume1 Volume2

Page 40: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Space Sharing

GPT ESP Volume1 Volume2

HFS

APFS Container

Volume1Volume1Volume1Volume1

Volume1GPT ESP Volume1 Volume2

Page 41: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Cloning Files and Directories

~eric/TOP_SECRET_APFS.key

SSD

Page 42: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Cloning Files and Directories

~eric/TOP_SECRET_APFS.key

~eric/Archive/TOP_SECRET_APFS.key

SSD

Page 43: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Cloning Files and Directories

SSD

~eric/TOP_SECRET_APFS.key

~eric/Archive/TOP_SECRET_APFS.key

Page 44: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Cloning Files and Directories

SSD

~eric/TOP_SECRET_APFS.key

~eric/Archive/TOP_SECRET_APFS.key

Page 45: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update
Page 46: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Sparse Files

~/cat.png

APFS

HFS

1MB

1MB

1MB

Page 47: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Sparse Files

~/cat.png

APFS

HFS

1MB

1MB

1MB

Page 48: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Sparse Files

~/cat.png

APFS

HFS

Seek Write 3MB

3MB

2MB

Page 49: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Sparse Files

~/cat.png

APFS

HFS

Page 50: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Sparse Files

HFS

~/cat.png

APFS

Page 51: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Sparse Files

~/cat.png

APFS

Page 52: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

How Big is My File?

~/cat.png

APFS

Snapshot

Page 53: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

How Big is My File?

~/cat.png

Live view

APFS

Snapshot

Page 54: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

How Big is My File?

APFS

Snapshot

Page 55: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode and Normalization

Page 56: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode and Normalization

APFS

Case-insensitive and normalization-insensitive by default

Unicode 9.0

Forward compatible

Unassigned code points are not allowed

Hash based comparison

Canonical folding

HFS

Case-insensitive and normalizing by default

Unicode 3.2

Not forward compatible

Unassigned code points are allowed

Lexicographic comparison

Simplified folding

Page 57: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode 9.0

Page 58: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode 9.0

Truly global

Page 59: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode 9.0

Truly global

Latest emojis

Page 60: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode 9.0

Truly global

Latest emojis

Page 61: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Unicode 9.0

Truly global

Latest emojis

Correctness

Page 62: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Boot Support

Page 63: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Boot Support

Embedded EFI driver

Future proof

Encrypted and Fusion volumes are supported

More secure

Page 64: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Encryption

Page 65: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Encryption

FileVault model

Converter for existing FileVault

Passwords and recovery keys are preserved

Snapshots are encrypted

Page 66: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Fusion

Page 67: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Fusion

All metadata is on SSD

Write back cache

Read cache

Page 68: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Defragmentation

Page 69: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Defragmentation

Intelligent defragmenter

Defragments on HDD only

Active when your machine is idle

Page 70: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

File System Snapshots

SSD

~dbg/BikeRacing.key ~dbg/CoffeeOrigins.key

Page 71: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

File System Snapshots

SSD

Snapshot FS: /Volumes/Users/dbg

~dbg/BikeRacing.key ~dbg/CoffeeOrigins.key

Page 72: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

File System Snapshots

SSD

Snapshot FS: /Volumes/Users/dbg

~dbg/CoffeeOrigins.key~dbg/BikeRacing.key

Page 73: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

File System Snapshots

SSD

Snapshot FS: /Volumes/Users/dbg

~dbg/CoffeeOrigins.key~dbg/BikeRacing.key

Page 74: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

File System Snapshots

SSD

Snapshot FS: /Volumes/Users/dbg

~dbg/BikeRacing.key

Page 75: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Reverting to a Snapshot

SSD

Snapshot FS: /Volumes/Users/dbg

~dbg/BikeRacing.key

Page 76: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Reverting to a Snapshot

SSD

Snapshot FS: /Volumes/Users/dbg

~dbg/CoffeeOrigins.key~dbg/BikeRacing.key

Page 77: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Snapshots

Page 78: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Snapshots

Snapshots are fast to take

Snapshots occupy space

Creating snapshots requires entitlements

Please talk to us if you want to use snapshots

Page 79: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Pavel Císler, Manager, Finder and Time Machine

•Demo

Page 80: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

// Swift APIs

import Foundation

open class FileManager : NSObject { open func copyItem(at srcURL: URL, to dstURL: URL) throws open func replaceItem(at originalItemURL: URL, withItemAt newItemURL: URL, backupItemName: String?, options: FileManager.ItemReplacementOptions = [], resultingItemURL resultingURL: AutoreleasingUnsafeMutablePointer<NSURL?>?) throws }

Page 81: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Guidelines

DeprecatedRecommendedexchangedata()

Carbon APIs

renamex_np()

Foundation APIs

copyfile() + COPYFILE_CLONE

Page 82: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Caveats for WWDC Preview

HDD-based systems are not automatically converted

We are working on performance improvements

Bootable APFS requires running installer

Page 83: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Summary

APFS is coming to macOS!

Fusion drives, encryption, space sharing, cloning, and snapshots

Please test your apps for compatibility with APFS installations

Please report any bugs you encounter with APFS

Page 84: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

More Informationhttps://developer.apple.com/wwdc17/715

Page 85: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update

Labs

Apple File System Lab Technology Lab D Fri 10:00AM–12:00PM

Page 86: Design and Development Videos - Apple Developer - 715 … · 2017-06-10 · iOS 10.3 APFS became the default filesystem on iOS 10.3 Millions of devices converted successfully Update