2

Today I wanted to check the /etc/fstab on macOS and found that there is no /etc/fstab anymore. Ok, maybe its a long time since I've used it on OS X but i was always sure that the OS X had not too many differences from "UNIX" (since it is supposed that macOS (High Sierra) is indeed a UNIX).

But i had to realize that there is no possibility to admin or configure the fstab anymore. Now, there is an executable called "DiskImageMounter" living in /System/Library/CoreServices/DiskImageMounter.app/Contents/MacOS/ which seems to do the disk administration.

But how we can configure it like with a "normal" Unix like with /etc/fstab? Is it possible?

3

You are correct. There is no /etc/fstab file, but the use of the /etc/fstab file by macOS has not be removed. You just have to create this file yourself.

An example of a possible lines in the /etc/fstab file are given below.

UUID=F21AD81B-B114-456C-B2A0-BF4452E4842D none apfs rw,noauto
LABEL=Macintosh\040HD none apfs rw,noauto

A description for the fields can be found by entering the command man fstab.

You may want to refer to this question: How to prevent auto mounting of a volume in macOS High Sierra?

When using ls -l /etc/fstab to determine ownership and permissions, you should get the same as shown below.

-rw-r--r--  1 root  wheel  123 Dec 31 08:48 /etc/fstab

UPDATE (provided by iggie)

A modification of this answer can be used for ssh keys on an external FAT or ExFAT drive (e.g. mounted via VeraCrypt or whatever). Add the following line to your /etc/fstab file, even if it doesn't exist:

LABEL=PRIVATE none msdos -u=501,-m=700

This assumes your user ID is 501 (try ls -n ~) and the label on your FAT or ExFAT volume is PRIVATE.

  • A modification of this answer can be used for ssh keys on an external FAT or ExFAT drive (e.g. mounted via VeraCrypt or whatever): Add the following line to your /etc/fstab, even if it doesn't exist: LABEL=PRIVATE none msdos -u=501,-m=700. This assumes your user ID is 501 (try ls -n ~) and the label on your FAT or ExFAT is PRIVATE – iggie Apr 15 at 20:03
  • @iggie: I added your comment to the answer. If you wish, you can correct any mistakes I may have made. Thanks. – David Anderson Apr 15 at 20:56

You must log in to answer this question.

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