10.5: Set a FireWire drive's mount point

Jun 03, '08 07:30:02AM

Contributed by: xld00d

This is a tutorial on how to automatically mount your FireWire drive to a custom mount point on OS X 10.5 Leopard. Variants will probably work with USB 2.0 drives, and internal SATA drives, and probably for IDE drives for G4 or G5 Macs. For this, you will need a little familiarity with the UNIX side of OS X, and more specifically, with the Terminal application. You will also need to know how to use vi, I think (though there's a very brief primer included in this hint). If that is beyond you, then you probably shouldn't be reading this.

  1. Connect your FireWire drive and then log in to your favorite account to mount the FireWire drive.
  2. Get the UUID of the drive in Terminal; MyFWDrive should be replaced with the name of your FireWire drive: diskutil info /Volumes/MyFWDrive. This command is going to spew out a lot of info, but the stuff you want is on the line that starts with Volume UUID. You want the long identifier afterwords, i.e. A740D396-D42D-3348-BD87-709342F87840.
  3. In Terminal, make your mount point directory: sudo mkdir -p /my/mount/point
  4. Edit your /etc/fstab file the OS X approved way with vifs (in Terminal): sudo vifs
  5. Add something like the below line to the file:
    UUID=A740D396-D42D-3348-BD87-709342F87840 /my/mount/point hfs rw 1 0
    /my/mount/point is the mount point you just created, and the string after UUID= is the UUID you found earlier. As a brief primer, here's how you do the above in vi. When vifs starts up, hit Shift-G to go to the end of the file. Hit the o key to go into insert mode on a new line. Paste in the above line (with changes as necessary, of course). Hit the the Escape key to get out of insert mode. Type in :wq to save and quit the vifs session (don't forget the : before the wq).

Your /etc/fstab file will probably end up looking something like this:

#
# Warning - this file should only be modified with vifs(8)
#
# Failure to do so is unsupported and may be destructive.
#
UUID=A740D396-D42D-3348-BD87-709342F87840 /my/mount/point hfs rw 1 0
With your newly-acquired vi skills, edit or create the autodiskmount.plist file from Terminal:
sudo vi /Library/Preferences/SystemConfiguration/autodiskmount.plist
If you get a blank file, then paste in the following into the blank file (emulate the vifs instructions from above):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>AutomountDisksWithoutUserLogin</key>
    <true/>
</dict>
</plist>
If you get a file with some settings, make sure the value that follows the AutomountDisksWithoutUserLogin key is <true/>. Study the above file to get an idea of how the final product might appear.

Instead of all of the above, you can do the easier and less recommended Terminal command:
sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true
But hardcore UNIX administrators may not like that, because it converts the XML file into a binary file. Now, reboot your Mac and enjoy.

[robg adds: You can read the original version of this hint on the author's blog. I've reformatted it somewhat for publication here on macosxhints, and tweaked a few sentences to read a little differently.]

Comments (16)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20080531040605723