Prevent encrypted APFS volume on partition to automount / ask for password on login - Catalina

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.