My system is a 2018 Mac Mini; the macOS 10.14 install doesn't come much cleaner than that. I have both /etc/fstab and /etc/fstab.hd files. Initial contents:A bit more about /etc/fstab:
- The file doesn't exist in a virgin macOS 10.12 installation nor a clean macOS 10.13 system.
- However, these clean systems have /etc/fstab.hd which contains:
- /etc/fstab.hd and the /etc/fstab file I created with vifs have owner: root, group: wheel, permissions: 644:
ls -la /etc/fstab.hd -rw-r--r-- 1 root wheel 150 Feb 20 2017 /etc/fstab.hd
- If /etc/fstab has the appropriate owner, group, and permissions, I doubt that it's actually necessary to hassle with using vifs to deal with it; I suspect that you could create the file with any text editor, e.g. BBEdit, make sure owner, group and permissions are correct, and its location, and simply reboot to get the desired result. FileVault/Core Storage volumes seem to be problematic, but simple, unencrypted HFS+ and APFS volumes should work (see discussions above).
- See also: /etc/auto-master and /etc/autofs.conf as well as the man pages for automount and automountd etc.
fstab.hd:# Warning - this file should only be modified with vifs(8)
# Failure to do so is unsupported and may be destructive
I suspect Ric is right that any text editor will work -- as long as it doesn't put in any hidden characters, but most text editors seem to insert hidden characters. (Years ago my Unix unit was in charge of SSL certificates for corporate servers but the powers that be turned that over to a Windows group and they passed on to us certificates which had different invisible end-of-line characters than the certificates that didn't pass through Windows. Took us a long time to figure that out because the certs looked perfect. Hex editors are good friends.)IGNORE THIS FILE.
This file does nothing, contains no useful data, and might go away in
future releases. Do not depend on this file or its contents.
As near as I can remember, all the success stories about preventing a disk from trying to mount are HFS, not APFS. I think I saw a page that said it worked with unencrypted APFS, but the reply below that said he tried the exact same thing and it failed. I guess I need to try that myself, but it can't be a long-term solution for me.