To clarify: aye, obviously you can use /etc/fstab
to mount things on macOS. By default it's empty; but that doesn't mean you cannot create it, it just means that, by default, there are no (external) things to mount! 😄
Note, however, that Apple strongly encourages editing /etc/fstab
only by doing sudo vifs
— any other way of editing the file may not work.
Although, by default — as the name implies! – vifs
will call vim
, you can actually use whatever editor you wish. Fo example, if you prefer to use nano
instead, just set the EDITOR
environment variable, e.g. with export EDITOR=/usr/bin/nano
.
After editing the file and saving it, the appropriate command to run is sudo automount -vc
— this will refresh existing mounts (none, if /etc/fstab
was empty before editing it for the first time) and add new ones. These will persist after logout or even reboot.
Oh, and despite some comments regarding the 'nature' of macOS, the answer is that aye, it is a fully-licensed UNIX, with a modified Mach microkernel — thus unlike FreeBSD or other common BSD derivatives. However, most command-line applications do have a BSD flavour (and many have been compiled from the BSD sources).
It's Linux that isn't UNIX-compliant (and not only because the Linux Foundation couldn't care less about paying the licensing fees) but "Unix-like". macOS is fully UNIX compliant, just like its immediate predecessor, NeXT OS (from "Steve Jobs' Other Company").
omg