5

I know similar questions have been asked before but I just can't believe this can't be solved, so I am going to ask again with specific details.

I have two partitions that are bootable on the internal drive of my Mac running macOS Catalina 10.15.7. Both are encrypted APFS volumes.

Whenever I log in to one of them, I am getting a promt, asking me for the password of the other. I do not want to store the password in the keychain to work around the prompt (for security reasons), in fact I do not want the other volume to be automatically mounted at all. All I want is to be able to choose the boot volume on startup (via the [Opt] key).


I tried

  1. adding this line to my /etc/fstab using vifs:
UUID=<UUID of the volume> none apfs rw,noauto

but this does not prevent the prompt from appearing.

  1. changing the volume role via
diskutil ap changeVolumeRole <diskId> D

but this returns the error: Error setting APFS Volume role: Unable to set the APFS Volume Role (-69599)


Is there seriously no way of preventing disks from being automounted? Can the Finder be at leat taught to not ask for the password?

6
  • idk the exact syntax rules for fstab, but I keep drives unmounted at boot with UUID=[UUID] none auto noauto
    – Tetsujin
    Commented Oct 24, 2020 at 7:30
  • @Tetsujin and this works with Catalina? Commented Oct 24, 2020 at 12:57
  • I don't have any Mac with Catalina to test. Try it, it will take 5 minutes.
    – Tetsujin
    Commented Oct 24, 2020 at 15:26
  • 1
    The /etc/fstab UUID=[UUID] none auto noauto trick now works in Big Sur 11.2. Commented Feb 2, 2021 at 5:40
  • 1
    Thanks @PlinkPanther, you are right! I added an answer for people looking for an clear description. Commented Feb 3, 2021 at 10:33

1 Answer 1

7

Starting with MacOS BigSur 11.1. the /etc/fstab/ solution works (again):

  1. find the volume label from the volume name:
    diskutil list | grep <volume name>
    the last entry (e.g. disk2s2) is the volume label.
  2. find out the volume UUID from the volume label
    diskutil info <volume label> | grep "Volume UUID"
  3. open /etc/fstab for editing:
    sudo vifs
  4. add a line preventing the auto-mount of the volume:
    UUID=<volume uuid> none auto noauto

Here's a complete example:

> diskutil list | grep "Macintosh HD2 - Data"
2:                APFS Volume Macintosh HD2 - Data⁩       341.8 GB   disk2s2

> diskutil info disk2s2 | grep "Volume UUID"
Volume UUID:               C58A1BDC-593C-4854-B954-702A73ABD67C

> sudo vifs
# add the following line:
UUID=C58A1BDC-593C-4854-B954-702A73ABD67C none auto noauto

On the next reboot the popup asking for the password will no longer appear.

1
  • I guess in only works when the password of the encrypted drive has been entered in the past. But that's something I don't want to as others use the hub the encrypted drive is plugin in. It should only mount when my mac is connected and other macs should not have to save the password to the keychain in order to prevent it from autoloading. Can somebody confirm if it's working for them?
    – haeki
    Commented Jun 24 at 17:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .