- Find out what the device name is (using Disk Utility for example). I'll assume it is /dev/disk0s5.
- As root, create a directory named Unmount in /Library/StartupItems/, containing two files (Unmount and StartupParameters.plist, as shown below). Use any name in place of Unmount, but make sure to use the same name twice.
- Set protections and ownerships like this:
drwxr-xr-x root wheel Unmount -rwxr-xr-x root wheel Unmount -rw-r--r-- root wheel StartupParameters.plist - Reboot to see if it works!
The file Unmount is a shell script (change disk0s5 to whatever your device name is):
#!/bin/sh
. /etc/rc.common
if [ "$1" == "start" ]
then
/usr/sbin/diskutil unmount /dev/disk0s5
fi
The file StartupParameters.plist is a properties list:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>Try to unmount the old disk</string>
<key>Provides</key>
<array>
<string>Unmount</string>
</array>
</dict>
</plist>
I tested it on 10.4 but it should work from 10.2 an onwards, at least.

