Way to prevent HDs/partitions from actually mounting at Login ?


New to this forum, so thanks to all concerned for a brilliant resource, and thanks in advance to anyone taking the time to consider this query, which is:

Does anyone know if there’s a way to actually PREVENT partitions from ever actually mounting at Login ?

Context as follows …

1TB 3 partition Maxtor Rugged HD, FW connection, Leopard 240GB partition being used to boot an aging Mac Mini, 740GB partition that will be used for Time Machine backups from 2 completely separate macs for a few months, plus a small FAT32 partition used for interchange; and of course the Mini’s internal HD, which is booted from occasionally for different purposes. I want if possible to prevent all but the Leopard partition from ever being present in the booted Leopard environment, since the user (who will be using it heavily for a few months until he decides what hardware to upgrade to when he’s ready to go Lion) is unfortunately morbidly disorganised in the extreme, insists on keeping several multi-GB folders on the desktop for ‘easy access’ (yeah, aliases … try telling him that), and is prone to the kind of digital Tourette’s that might lead to him inadvertently dumping stuff on disk icons (I had to solve a “my mail’s not working!” emergency for him a while back, discovered he’d accidently mailed himself a 750mb folder that was ponderously still trying to upload).

A script to immediately dismount was my first thought, but (as I’ve seen several references to elsewhere) the scriptable Eject Disk function appears to be broken, at least under Leopard, and does nothing even when the script was recorded from a successful manual eject; same goes for Automator.

And of course managing permissions would prevent actual accidents, but still leaves unwanted and potentially confusing icons present, and is slightly problematic in other ways; eg thus far I’ve found that if I change permissions on the Mini’s internal HD to prohibit access, then it can’t be booted from till they’re changed back.

So I was wondering if anyone knew if there was anything more ‘under the hood’ that could be used to prevent the relevant partitions from ever actually mounting into the user’s environment ?

Thanks for any thoughts,


Well not a real MacScripter question but more a UNIX question but yes you can!

I use it a lot for my backup software and to hide bootcamp volumes. Read the fstab (file system table) manual to do that. Hint: work with UUID and not with LABELS.

Here’s bit of an online recipe to prevent automounting:


You’ll want to understand the process before trying it, as undoing a failed attempt can get nasty.

Thanks to both, fstab does exactly what I need, problem solved!

Re it being more of a UNIX q than a scripting one, yes, that occurred to me after I’d posted, sorry about that; guess I started here because I’d just got through establishing that a simple login script to immediately unmount wasn’t going to work.

In the interests of closure and in case anyone lands on this thread from a search I’ll just add a couple of points …

Whilst the radiotope link does arrive at the same end result, for those of us not so practised and conversant with UNIX command line practise, my googling around in order to make sure I understood any potential issues led me to the following link …


… which less scarily simply talks in terms of getting the UUIDs from Disk Utility and creating and/or editing fstab (which seems not to be created by a Leopard install, but clearly gets checked if it becomes present - there was a fstab.hd already in private/etc, but that self-declares itself to be “completely irrelevant to anything ever” …) with a line for every volume of interest.

And in respect of not using LABEL, obviously UUID is safer, but one of the volumes I didn’t want to mount is a FAT32 partition, and Disk Utility doesn’t display a UUID for it, so I’m assuming MS-DOS volumes don’t get issued with a UUID. In any event, LABEL=dosname seems to work fine for that volume.

Thanks again for the pointers,