Keep external hard drives mounted under OS X without being logged in
I have an old G4 mac mini running OS X 10.5 Leopard that I've set up as a NAS for my home network. The idea was to have our laptops and other macs use Time Machine to backup to the USB drives attached to the mini. The mini draws only a small amount of electricity and I happened to have a couple of large USB drives kicking around so it seemed like a great replacement setup for my aging Linux solution. So I plugged the drives in, turned on file sharing, shared the drives, and started backing things up.
It was working great. But I noticed that the other machines would complain about not being able to connect to the shared USB drives after a while. It took me a little while to realize that every time I logged out of the mini the USB drives were unmounted. Obviously this is a problem.
Thanks to the folks at bombich.com for providing the following commands that resolved my problem. I typed the following into the Terminal:
sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount \
AutomountDisksWithoutUserLogin -bool YES
Now the drives stay mounted regardless of who logs in or out. This is especially nice when the machine reboots after a power failure.