6

I have a 256G SSD and a 1T HDD in my 27" iMac.

The 1T HDD is dying due to hardware failure.

Is there a file in OS X similar to /etc/fstab in Linux where I can prevent this 1T HDD from mounting?

I'd like to effectively disable/ignore this disk without needing to take it into an Apple store to be removed.

Deefour
  • 173
  • Related: http://apple.stackexchange.com/questions/86257/how-can-i-tell-osx-not-to-mount-some-of-the-drives-in-my-computer/111024#111024 – AllInOne Sep 17 '14 at 21:57

2 Answers2

3

Yes!

First get the UUID of the partition you want to prevent from mounting... You can get this in Disk Utility "Get Info".

Now open your /etc/fstab file for editing:

sudo pico /etc/fstab

In this file add the following line (use your own UUID naturally):

UUID=[your UUID] none hfs rw,noauto 0 0

And save the file.

Restart for the change to take affect.

You can always mount it manually in Disk Utility.

AllInOne
  • 1,645
  • Thank you. This works in terms of preventing the disk from mounting, but I can still hear what sounds like the needle scanning on the platters repeatedly. Can anything more be done to kill power to the drive altogether - short of opening up the iMac? – Deefour Sep 18 '14 at 02:09
  • 1
    This does not work if the drive is not formatted.. there IS NO UUID!!! – Just World Jan 30 '19 at 22:50
  • Can Partition UUID be used here? – Sandwich Oct 29 '23 at 15:21
3

Similar to Linux.

The preferred disk identifier a Volume UUID.

You can use disk utility to find the Volume UUID or use diskutil:

diskutil list

get the disk indentifier, e.g. disk0s4

diskutil information disk0s4

In the row labeled Volume UUID:

Volume UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Edit /etc/fstab as root (it may not exist), creating an entry of the form:

UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none hfs rw,noauto

Also refer to

man -S5 fstab

  • Thank you. This works in terms of preventing the disk from mounting, but I can still hear what sounds like the needle scanning on the platters repeatedly. Can anything more be done to kill power to the drive altogether - short of opening up the iMac? – Deefour Sep 18 '14 at 01:57
  • Have you unmounted it? Are there more volumes on the same disk mounted? Preferences > Energy Saver - Put hard disk to sleep when possible, does it persist through a power down/boot up? –  Sep 18 '14 at 02:32
  • I went through a full power cycle, instead of restarting. The computer was off for about 8 hours. That seemed to fix it (for now). – Deefour Sep 18 '14 at 12:22
  • That puppy sounds seriously sick. –  Sep 18 '14 at 13:33
  • 2
    This does not work if the drive is not formatted.. there IS NO UUID!!! – Just World Jan 30 '19 at 22:50