Skip to content

Add missing mount flags (local, protect)#1968

Merged
shirou merged 1 commit intoshirou:masterfrom
kerlenton:darwin-mount-flags
Dec 24, 2025
Merged

Add missing mount flags (local, protect)#1968
shirou merged 1 commit intoshirou:masterfrom
kerlenton:darwin-mount-flags

Conversation

@kerlenton
Copy link
Copy Markdown
Contributor

Summary

Add support for local and protect mount flags on Darwin.

Motivation

While comparing mount command output with gopsutil results on macOS, I noticed two commonly used flags were missing:

$ mount
/dev/disk3s1s1 on / (apfs, sealed, local, read-only, journaled)
/dev/disk3s5 on /System/Volumes/Data (apfs, local, journaled, nobrowse, protect)
/dev/disk3s7 on /nix (apfs, local, nosuid, journaled, noatime, nobrowse, protect)

The local and protect flags were not being parsed.

Changes

Added checks for two mount flags in PartitionsWithContext():

  • MNT_LOCAL - indicates local (non-network) filesystem
  • MNT_CPROTECT - indicates Data Protection is enabled (FileVault)

Testing

Manually tested on macOS by comparing output with the native mount command. The flags now appear correctly in partition options.

Copy link
Copy Markdown
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR.
I have confirmed those flags in sys/unix. LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants