Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

NVRAM in Apple silicon Macs

By: hoakley
30 July 2024 at 14:30

Although both Intel and Apple silicon Macs store persistent settings in non-volatile memory (NVRAM, formerly PRAM), its use has changed significantly. In the past, users have been able to change values in NVRAM to customise the behaviour of their Macs, including setting whether the startup chime is sounded, and what happens when you open the lid of a notebook. In the event that went wrong, NVRAM has been readily reset to its original state, allowing the Mac to return to normal function.

NVRAM is more extensive in Apple silicon Macs than that in Intel models and stored in NOR Flash memory. Much of it is now protected, and it’s not intended to be meddled with by the user. The Asahi Linux project has documented much of the contents of NVRAM in early Apple silicon Macs, and the Appendix at the end of this article updates that using listings from more recent models running current macOS.

Contents

The only settings that appear to have been changed by users are auto-boot and AutoBoot, its predecessor in Intel Macs, in attempts to modify lid-up behaviour in notebooks. Neither appears to prevent the MacBook Air or Pro from automatically starting up when the lid is raised, and in some models changing auto-boot has been reported as causing boot failure.

Values for keys containing the term breadcrumbs are of particular interest, as they’re written during early stages of the boot process, either by LLB (first stage) or iBoot (second stage) in lieu of a log. Attempts to decipher and understand their contents have so far been unsuccessful.

The aht-results value is normally displayed in the Diagnostics section of System Information, when hardware diagnostics have been run. Similarly, the battery-health value is reported in Battery settings, LocationServicesEnabled in Location Services settings, prev-lang:kbd in Keyboard settings, and SystemAudioVolume in Sound settings, where they’re also controlled.

Resetting NVRAM

Trying to reset NVRAM using the traditional key combination for Intel Macs does absolutely nothing to an Apple silicon Mac.

The only known way to set it back to factory condition is to perform a full restore in DFU mode, which also wipes the entire contents of the internal SSD and returns the whole Mac back to factory condition. Some users report that performing Erase All Content and Settings (EACAS) resets unprotected contents including their attempts to customise settings. However, that too is non-trivial and causes considerable work to restore that Mac to its former state.

Conclusions

In Apple silicon Macs, NVRAM settings aren’t intended to be changed directly by the user. As resetting them requires lengthy procedures, the prudent user shouldn’t even think of trying to change them unless advised to do so by Apple.

Appendix: Current NVRAM Settings in Apple silicon Macs

  • aht-results* – last Diagnostics result, if they have been run.
  • auto-boot – whether to boot automatically. Changing this can cause boot failure on some models.
  • backlight-nits – display backlight strength.
  • battery-health* – given for notebooks.
  • bluetoothExternalDongleFailed
  • BluetoothInfo
  • bluetoothInternalControllerInfo*
  • BluetoothUHEDevices
  • boot-breadcrumbs* – codes from ‘firmware’ stored during last boot.
  • boot-note
  • boot-picker-bringup-reason*
  • boot-volume – default boot volume.
  • bootdelay
  • display-crossbar0
  • fmm-computer-name – computer name.
  • fmm-mobileme-token-FMM
  • fmm-mobileme-token-FMM-BridgeHasAccount
  • guid-var-trans*
  • IDInstallerDataV2
  • LocationServicesEnabled
  • lts-persistance*
  • ota-updateType* – type of updates to install.
  • panicmedic-timestamps*
  • policy-nonce-digests*
  • prev-lang-diags:kbd – keyboard layout in Diagnostics.
  • prev-lang:kbd – keyboard layout.
  • skip-language-setup – whether to run or skip language setup.
  • SystemAudioVolume
  • SystemAudioVolumeExtension
  • upgrade-boot-volume
  • usb,version,rid0 up to rid5*
  • usbcfwflasherResult
  • wlancprops*

* = may not be present.

Excluding folders and files from Time Machine, Spotlight, and iCloud Drive

By: hoakley
9 July 2024 at 14:30

Backups, indexing for search, and cloud storage are each very useful when and where you want them. But there are occasions when you want to exclude folders and files from their reach. This article is a short reference to how you can exclude items from being backed up, indexed and searched, and stored in iCloud Drive.

Time Machine backups

Time Machine has several mechanisms for excluding items from its backups. The first of those used to be its Standard Exclusions list, at /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist, but that has long since disappeared from there. Currently the best way to inspect that list is by viewing the hidden file .exclusions.plist at the top level of any backup.

This lists several categories of exclusions, of which the first are apiExclusionPaths, added by individual third-party apps. The equivalent of what used to appear in StdExclusions.plist is now given under the standardExclusionPaths key, containing:

  • .DocumentRevisions-V100 – the version database on each volume, added in Big Sur,
  • .Spotlight-V100 – Spotlight metadata,
  • .Trashes – contents of Trash folders,
  • .fseventsd – the File System Events database,
  • /Library/Logs – traditional text log files,
  • /Users/Guest – guest user files,
  • /private/var (partial) – various transient files,

among many other ephemeral items.

Of those, only one results in any significant loss of data, the version database. Although this was dutifully copied by Time Machine into backups for several years, the current structure of that database appears to make it impossible to restore successfully, even when restoring a complete volume. By the middle of the Catalina cycle, it had become a frequent cause of Time Machine choking, so was added to the standardExclusionPaths for Big Sur. As far as I’m aware this was never fixed in Catalina.

Following those are stickyExclusionPaths, excluding various Photos Library contents. The key systemFilesExcluded is set to true to ensure that the whole System volume is always excluded, following which are any userExclusionPaths you have set using tmutil or in Time Machine settings, using the Options… button.

xclusions1

By default, volumes on external storage are automatically added to this exclusion list; if you want an external volume to be backed up by Time Machine then you will need to remove it from the exclusion list manually.

In addition to the rules given in the Standard Exclusion list, any file or folder can have an extended attribute of type com.apple.metadata:com_apple_backup_excludeItem attached to it as a ‘sticky’ exclusion, which should add it to the stickyExclusionPaths list and prevent it from being backed up by Time Machine. If you then remove that extended attribute, it should be backed up normally again.

Mike Bombich gives a thorough and detailed account of what CCC doesn’t copy on this page. Other backup utilities should also provide full lists on their support site.

Note that no folders or files can be excluded from APFS snapshots, whether made by Time Machine, CCC or any other app, as snapshots always capture the entire volume.

Spotlight search

There have been three general methods of excluding folders from Spotlight’s indexing and search, although only two of them still work reliably:

  • appending the extension .noindex to the folder name (this previously worked using .no_index instead);
  • making the folder invisible to the Finder by prefixing a dot ‘.’ to its name;
  • putting an empty file named .metadata_never_index inside the folder; that no longer works in recent macOS.

System Settings offers Spotlight Privacy settings in two sections. Search results won’t normally prevent indexing of those items, but does block them from appearing in search results. Spotlight’s indexing exclusion list is accessed from the Spotlight Privacy… button, where you can add items that you don’t want indexed.

xclusions2

iCloud Drive storage

This works primarily by inclusion, in that you copy or move items to the iCloud Drive folder when you want them to be copied up to iCloud Drive. There are occasions, though, when you want to exclude specific folders and files that need to be in a folder in iCloud Drive, but you don’t want those items to be stored in the cloud. iCloud won’t sync items with the extensions .nosync or .tmp, so putting files inside folders whose name ends in either of those extensions will ensure that they’re not stored in iCloud Drive.

Other items intended for local housekeeping and similar purposes that are excluded from syncing include:

  • .DS_Store files
  • files whose name starts (A Document Being Saved
  • .ubd files
  • items with names containing .weakpkg
  • desktop.ini files
  • items with names starting with ~$
  • items named $RECYCLE.BIN, which are trash folders
  • items named icon\r, which are custom folder icons.

Files and folders with purposes that make iCloud syncing inappropriate include those:

  • named iPhoto Library, and presumably now Photos Library too
  • named Dropbox, .dropbox, or .dropbox.attr
  • with the extension .photoslibrary, .photolibrary, .aplibrary, .migratedaplibrary, .migratedphotolibrary, or .migratedaperturelibrary
  • named Microsoft User Data
  • named ~ with an extension of 3 or more characters.

The only setting in System Settings gives control over Desktop & Documents folders, and those of individual apps; there’s no exclusion list available.

xclusions3

Simple reference to folder controls

  • Time Machine: add to settings with the Options… button, or using tmutil;
  • Spotlight indexing: add to settings with the Spotlight Privacy… button, or append the extension .noindex to the folder name;
  • iCloud Drive: append the extension .nosync or .tmp to the folder name.

❌
❌