I have a HFS partition on my internal boot disk on a Mac Mini (High Sierra) that I would like to not automatically mount at boot time. Rather, I want to reserve it to raw-mount to a VirtualBox VM by default.
How do I configure the Mac to not automount the partition?
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 600.0 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
4: *** Apple_HFS Shared user data 199.6 GB disk0s4
5: Apple_APFS Container disk3 199.6 GB disk0s5
...
I want to reserve disk0s4.
I've seen some similar posts that suggest automountd is involved, but don't provide any help configuring it.
Best Answer
Traditionally, the file you have to edit to prevent automounting is
/etc/fstab
.In your case, you would need to add the line shown below to this file.
You can get more information on the
/etc/fstab
file, by entering the commandman fstab
.This also works:
Note that the mount path must be created manually before using Disk Utilities to mount the partition manually, and Disk Utilities will destroy that mount directory when unmounting manually.