Neither man fstab
nor man diskarbitrationd
(see here for example) mention deprecation of /etc/fstab
.
It's not there by default, but why should it be, if it just were empty because the defaults are good? It's there if you need it.
Claims of deprecation of fstab
has been floating around the web for some time now.
From here:
etc/fstab is deprecated in Leopard
From here:
I was going to suggest editing the /etc/fstab file, but apparently that was deprecated in Leopard, and is probably now removed from Snow Leopard...
Apart from the fact that there is no mention of deprecation in its documentation, why would Apple add utilities for properly editing deprecated configuration files?
Quoting man vifs
:
NAME
vifs -- safely edit fstab
[...]
HISTORY
The vifs utility originates from Mac OSX 10.5.
While the following program runs (infinite loop, Ctrl-C to quit), no disk will be mounted, with proper conditions you can control it more fine-grained of course:
#include <CoreFoundation/CoreFoundation.h>
#include <DiskArbitration/DiskArbitration.h>
DADissenterRef BlockMount(DADiskRef disk, void *context)
{
DADissenterRef dissenter = DADissenterCreate(kCFAllocatorDefault, kDAReturnNotPermitted, CFSTR("forbidden!"));
return dissenter;
}
int main (int argc, const char * argv[])
{
DAApprovalSessionRef session = DAApprovalSessionCreate (kCFAllocatorDefault);
if (!session)
{
fprintf(stderr, "failed to create Disk Arbitration session");
}
else
{
DARegisterDiskMountApprovalCallback(session, NULL, BlockMount, NULL);
DAApprovalSessionScheduleWithRunLoop(session, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
while (true) {
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 60 /* seconds */, false);
}
DAApprovalSessionUnscheduleFromRunLoop(session, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
DAUnregisterApprovalCallback(session, BlockMount, NULL);
CFRelease(session);
}
return 0;
}
Save as main.c and compile using the following (you need Developer Tools):
cc main.c -o mountstopd -framework Foundation -framework DiskArbitration