How to find firmlinks

2

macOS Catalina introduces "firmlinks" to the APFS filesystem. Is there a way via a CLI tool to determine whether /Users is a firmlink and where it is firmlinking to? I'm looking for something similar to the readlink command for symlinks.

michaelt

Posted 2019-10-10T01:07:02.033

Reputation: 21

Answers

1

I'm also looking for this. In the meantime, I've resorted to using comparing the results of pwd -P (show physical path of process working directory) with that of df ., e.g.:

# cd /Users ; pwd -P ; df .; cd - >/dev/null
/Users
Filesystem   512-blocks       Used Available Capacity iused      ifree %iused  Mounted on
/dev/disk1s1 1953595632 1384119832 545065168    72% 1287392 9766690768    0%   /System/Volumes/Data

(The final cd - switches back to the original directory, and prints out the directory path, hence the redirection to /dev/null.)

Note how the output of pwd -P says /Users, while df says it is mounted on /System/Volumes/Data.

RobM

Posted 2019-10-10T01:07:02.033

Reputation: 575

1

A list of the system firmlinks can be found in the file /usr/share/firmlinks.

On macOS Catalina version 10.15.1, the contents of the firmlinks file appear as follows:

/AppleInternal  AppleInternal
/Applications   Applications
/Library        Library
/System/Library/Caches  System/Library/Caches
/System/Library/Assets  System/Library/Assets
/System/Library/PreinstalledAssets      System/Library/PreinstalledAssets
/System/Library/AssetsV2        System/Library/AssetsV2
/System/Library/PreinstalledAssetsV2    System/Library/PreinstalledAssetsV2
/System/Library/CoreServices/CoreTypes.bundle/Contents/Library  System/Library/CoreServices/CoreTypes.bundle/Contents/Library
/System/Library/Speech  System/Library/Speech
/Users  Users
/Volumes        Volumes
/cores  cores
/opt    opt
/private        private
/usr/local      usr/local
/usr/libexec/cups       usr/libexec/cups
/usr/share/snmp usr/share/snmp

Hambly

Posted 2019-10-10T01:07:02.033

Reputation: 11