2

I have just connected an external RAID1 enclosure (a Lacie Quadro2) through FireWire800 interface to my iMac 24.

I copied all my internal "Machintosh HD" to the new disk, setted the system to use the external disk as Startup Disk, the volume is named "My HD".

After restarting, I run Disk Utility and resized the internal disk 1st partition to 100GB, then made a new partition of about 500GB, named "TM HD".

Then I configured Time Machine to use "TM HD" and runned it ...

.. all works very very fine, but ...

I'd like to made "Machintosh HD" hidden when the system is started using the external disk ... and eventually have it to be the boot disk if and only if the external HD ("my HD") is not available or not connected in order to avoid unwanted filesystem modification.

Is it possible to tell Mac to not visualize a given partition on the internal disk?

Any idea is wellcome, thanks in advance :)

drAlberT
  • 10,949
  • 7
  • 39
  • 52

5 Answers5

2

You could attach an applescript to your login items that unmounts that volume:

do shell script "diskutil unmount '/Volumes/Macintosh HD'"
cOle2
  • 176
  • 1
  • 3
  • It could be an acceptable solution, even if I'd prefer to have a system wide way to prevent it to be mounted at all ... I had a look to automount, but not reached a solution at the moment... – drAlberT Aug 05 '09 at 08:58
  • 1
    Well the only way I can think of to do that is to create an fstab entry. Here's an example of how to do it (note the author uses pico to edit fstab but apple has vifs for just that): http://www.macosxhints.com/article.php?story=20060930150059172 – cOle2 Aug 05 '09 at 14:29
  • I read and thought about that, but I had the dubt that fstab could be a deprecated place to do this kind of things ... can you confirm or not this? Thanks in advance – drAlberT Aug 05 '09 at 18:10
  • No I can't confirm either way. How about instead of using a login item you create a launch daemon that runs the unmount command. Lingon is pretty good for creating the config files. – cOle2 Aug 06 '09 at 02:51
  • I think it would be to use a cannon to hit a fly! – drAlberT Aug 06 '09 at 10:44
2

If you want the disk simply hidden from view in the Finder:

/usr/bin/SetFile -a V /Volumes/Macintosh\ HD

You can find more by running SetFile or man SetFile

Chealion
  • 5,733
  • 28
  • 29
0

You can hide the internal disk using Finder’s preferences (under Finder > Preferences > General). This will hide both the “Macintosh HD” and “TM HD” partitions. The disks are still mounted, so Time Machine keeps working.

Nate
  • 2,366
  • 4
  • 22
  • 25
  • This way I hide the internal disk only "int hte finder" My issue is to really hide the partition ... ie, prevent it to be automatically mounted by the system – drAlberT Aug 03 '09 at 08:09
  • Moreover, if I hide "Hard Disks" in the Finder general preferences the external *system* disk disappear too ... this is because it is the system boot disk and it is not classified as an "external Disk" ... So you solution is not good for me, sorry – drAlberT Aug 03 '09 at 08:13
0

I'm answering to my question basing on the comment by cOle2 in which he suggest to use fstab.

I'm giving my own answer as I think it could be nice and useful to do the job with a single shell line, without the need of any external editor (vi, emacs, pico, nano,etc)

echo "echo \"UUID=$(diskutil info /Volumes/Macintosh\ HD/ | grep UUID | awk '{print $3}')  none  hfs  rw,noauto\" >> /etc/fstab" | sudo bash

This works great and can be simply C&P-ed in the Terminal without customizations.

Thanks to everyone for the tips given

drAlberT
  • 10,949
  • 7
  • 39
  • 52
0

Unfortunately in Mojave none of the above worked for me. (SetFile is deprecated):

/usr/bin/SetFile -- set attributes of files and directories (DEPRECATED)


However this works:

  • in Disk Utility if you select your main drive (in my case was external hardrive)
  • in the toolbar click the Partition button
  • you will see a graph (pie-chart) listing all partitions
  • click on the one I wanted removed (really small one, called Untitled in my case)
  • click the minus ( - ) button
  • click apply
  • disk utility removed the partition and said "growing partition"
  • one of the other partitions was "grown" and filled the empty space

I now have got rid of the 9MB "Untitled" partition.

ionescu77
  • 103
  • 5