Let’s make 2021 the year of Disk Utility

Disk Utility is the least glamorous and most critical of all the apps bundled in macOS. The day when you can’t rely on it to format disks correctly we’re all doomed. Over the last few years, since the introduction of APFS, we’ve become ever more reliant on it, but it hasn’t always delivered the goods.

APFS has developed rapidly since we first started getting to know it in High Sierra. By the time it has reached version 1677.60.23 in Big Sur, it has grown many new features, of which most support the new Sealed System Volume, and Time Machine backups to APFS volumes. These include volume roles, Volume Groups, firmlinks, and the copying of storage blocks into backups.

Volume Groups

Despite those, Disk Utility in Big Sur has changed precious little, and can’t for example swap the Data volume in a boot volume group. Although its command tool companion, diskutil, offers a few more facilities, such as the creation of APFS volumes with specified roles, even there the user has comparatively little to work with APFS’s extensive feature-set.

diskutil111

One significant improvement in Big Sur is the ability of Disk Utility to erase a complete Volume Group in a single operation. This makes a clean install simpler and less confusing, although it also makes it easier for users to inadvertently erase a wanted Data volume, when all they intend to do is create a new System volume which is linked to an existing Data volume.

The great advance in performing a clean install of macOS came in later releases of Catalina, since which the macOS installer has been able to link a fresh System volume with an existing Data volume, something which previously often failed, and created multiple Data volumes with names like Macintosh HD – Data and Macintosh HD – Data – Data.

Apple’s current solution to repairing or changing boot Volume Groups is to reinstall macOS with the single correctly-named Data volume present in the container. This suggests that the features underlying boot Volume Groups, such as firmlinks, have to be created when the System volume is itself being created. If that’s true, then control over boot volume groups isn’t going to appear in either Disk Utility or its command tool companion.

Snapshots

Copying individual storage blocks to backups is one of several major new features used by Big Sur’s Time Machine when backing up to APFS volumes, none of which appears to have been documented. Judging by Time Machine’s behaviour, it can also make snapshots of only a part of volume, a major new feature which isn’t yet accessible to users or third-party developers as far as I’m aware.

Checking and repair of snapshots is performed within Disk Utility’s First Aid feature, or in fsck_apfs, although neither the man page nor usage information for that command tool even mentions snapshots, and don’t appear to have been revised for nearly three years.

In Classic Mac OS, when there was no command line, system tools had to be complete and often supported advanced features. Some apps, like ResEdit, provided advanced users with far greater power then any equivalent in Mac OS X. With the availability of command tools, Apple has pursued a policy of giving limited access to features in its utility apps, forcing many users to resort to Terminal for anything more advanced. An example of this is information about the seal on System volumes and their snapshots, which isn’t revealed by Disk Utility, only the diskutil apfs command.

Bugs

There are also some curious mismatches between Disk Utility on Intel Macs, compared with Apple Silicon Macs. For example, unmounting both volumes in a boot Volume Group works well on Intel systems, but generally fails on M1 Macs, where it reports that the Data volume can’t be unmounted because it’s still in use.

On Boxing Day, I described an obvious bug in Disk Utility’s handling of containers which, with a few minutes testing, rapidly made it look as if an APFS disk had many containers, when in fact there was only ever one. I’m still amazed that could appear in any public release of macOS, and even in a beta it should be deeply embarrassing.

For me, though, the most curious aspect of Disk Utility remains the way that it formats a disk in APFS: look at its blow-by-blow log in its Erase dialog, and you’ll see that over three years since Apple’s new file system was released for macOS, every time Disk Utility creates a new disk with a single APFS container and volume, it does so by first formatting the disk in HFS+ and then converting that to APFS, as if it somehow has to recapitulate the Mac’s history of file systems before catching up with the present:
Formatting disk14s2 as Mac OS Extended (Journaled) with name 860evo1tb
Initialized /dev/rdisk14s2 as a 931 GB case-insensitive HFS Plus volume with a 81920k journal
Mounting disk
Creating a new empty APFS Container
Unmounting Volumes
Switching disk14s2 to APFS
Creating APFS Container

Disk Utility is sadly neglected, a tool which is vital to every Mac user but lacks the care and attention which Apple should devote to it. Please, Apple, can we target it for serious high-quality engineering effort in 2021, and end these years of neglect?