Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

how to disable the internal hard drive

I am using OS X 10.6.8 on a macmini. i boot from an external FW800 3.5" HD and only use the internal drive for a daily backup.

For the the sake of quietness and reduced wear and tear i want to keep the internal drive in a powered-off state until needed for the backup.


The closest i was able to get to my goal has been to eject the two internal partitions thru finder, but the drive begins spinning again after one minute. However, the partitions don't re-appear in finder and are found to remain in the unmounted state in disk utility.


What is causing the spinup again, and can any script be written to stop this happening? Thinking ahead to using this idea on an iMac as well.


Hoping someone can help.

Mac mini, Mac OS X (10.6.8)

Posted on Jan 26, 2012 6:34 AM

Reply
Question marked as Best reply

Posted on Jun 28, 2014 12:45 PM

As always BACKUP FIRST…


If you want a disk to not mount on boot use /etc/fstab.


This hints example is a bit old, so find a newer example if you can't do parts of it (I'm short on time & the moment to explain fully).

http://hints.macworld.com/comment.php?mode=view&cid=62120&query=stab+prevent+mou nt(NOTE: See this comment, not the original hint)


Here is my short version…


In Terminal …

diskutil list

Find the disk 'IDENTIFIER' for the volume you want to prevent mounting.

Insert that 'IDENTIFIER' into the next command (here it is disk1s2)

diskutil info disk1s2

Find the Volume UUID, make a note in a text file…


Edit the text file to look like a correct fstab entry…

UUID=MAD3-UP-5H1T-I5-H3R3-S0-U-RTFM none hfs rw,no-auto

#NOTE: The file system type may need changing & there are many other 'options', the mount command explains the options so read 'man mount'


In Terminal in your admin account, edit the '/etc/fstab' use 'vifs' as root… (a fstab file will be created if it doesn't exist)

sudo vifs


Copy the line from the test file & paste it in to the Terminal that is editing fstab - I'm uncertain if your editor will be 'vi' or 'nano', you will have to search for help on using these, if it says 'GNU nano' at the top hit crtl +x, Y, hit return to save.

If it is 'vi' go and use 'vitiator' or search for vi help! - vi is a pain in the neck!


Don't forget to read the manual for fstab…

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man5/fstab.5.html


If you need the disk to mount at any point just use Disk Utility or the command.

diskutil mount disk1s2



P.S. If you mess up your /etc/fstab you may not be able to boot, just boot to single user mode and comment out the entries with a '#' (octothorpe = alt+3 )

20 replies

Dec 13, 2016 3:56 PM in response to leanch

leanch wrote:


I'd also recommend you try to use my util to auto disable your second drive on booting OS with an opportunity to enable it in one command whenever after. Please check it out: https://github.com/igorleanch/2ndrive

Um, why is this needed and how have you tested it?


fstab controls disk mounting and is built in to OS X/ macOS.

fstab can set a disk to never mount on startup with one line in /etc/fstab e.g.

UUID=YOUR-UUID-HERE none hfs rw,noauto

diskutil can mount a volume that has been setup not to mount in fstab.


You are solving a problem that already has an answer built into the OS.


Your script also fails on 10.9 (with a disk called '10.6'). What OS's have you tested?

The command you use…

diskutil info [device-name] | grep '10.6'

…does not include the name of any partitions when I do have a disk of that name attached.

You script also ejects entire disks which may contain other volumes, that is not an accurate method to handle multiple partitions.



Sorry to sound so negative but this is doesn't look very good.

Dec 14, 2016 6:13 AM in response to Drew Reece

1) I put the second hard drive to my MacBook Pro. Commonly I use SSD only and sometimes I need to use my second storage for example to use large media libraries. Why I need to boot this disk, listen his noise and waste my battery? The script solves all these problems. And if I want to connect it again I just have to run one simple command.

2) I believe there is a difference between unmounting and physical disabling a drive. If I just unmount it then physically it still be working.

3) I've test it on macOS Sierra 10.12

4) The instruction asks to find out a media name of your physical drive instead of a volume because the aim of the script is to disable his at all.

5) If you are interested then in the nearest future I intend to upgrade it in some way of simplification until degree of just 1 step to be able just choose a number of listed drive s in order to disable his automatically loading.

Dec 14, 2016 11:59 AM in response to leanch

2) What you believe is not entirely correct. Having a disk spin down does save power but you would have to physically remove it to have it 'detach' from the system. An internal disk remains attached to a system whether you use 'diskutil eject' or if you prevent mounting of all volumes via fstab. Your script makes no difference to using fstab. You can still mount an attached disk via 'diskutil mount disk [device_name]'. You get no extra benefit from your script.


3) The original poster is on 10.6.8, if you are going to recommend this script you need to test on that version. It doesn't work on 10.9 so I doubt earlier versions will work either.


5) You don't need your script. The OS already has a system for this feature - fstab. It seems unwise to reinvent something that is already built in - I'm also guilty of making similar mistakes (as are other posters here) 🙂

Adding more complexity to your script it seems like a wasted effort to me, I wish you luck with it but I hope you can see that there is actually a 'unix way' already built in to the OS to manage disk mounting - a single text file configures it for you. A single command will also mount that disk on request.



Sometimes the correct answer is to read the manual.

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPag es/man5/fstab.5.html

or 'man fstab' in Terminal…


...

The option ``auto'' can be used in the ``noauto'' form to cause a file system not to be mounted

automatically (with ``mount -a'', or system boot time).

how to disable the internal hard drive

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.