mounting or not automounting firewire drives in Mac OS X (10.6.2)
Thursday, February 4th, 2010
The Situation
Ever since my upgrade to Snow Leopard, I have been having problems with Finder freezes causing my computer to become increasingly less functional (everytime an app needs to open a file dialog it becomes unresponsive) and eventually needing to do a forced reboot when my workaround toolbag is depleted. Before I did the backup I made an exact bootable copy of my old leopard install for two reasons: 1) in case it all goes wrong and I want to go back to my previously existing state 2) In case I realize that after the clean install I can’t recover something I need that I had in my old install, I can go back and grab it (software that is not available for download anymore, documents I forgot to transfer, etc.). I made this backup to a partition on a firewire external hard disk attached to my mac. My latest theory is that this other complete operating system volume complete with applications folder, library and all being mounted is causing confusion which is leading eventually to finder death.
This brings us to the second issue I’ve been having. I purchased the external firewire hard drive through work because I needed a substantial amount of extra space for things like video editing projects I work on there. Unfortunately, for reasons I’m not sure of, the disk always failed to automatically mount on system boot. I would have to reach down and power cycle the drive enclosure before it would mount. At this point, all three partitions on the disk would mount: MY big extra space partition (cleverly named Bison as the drive is from a company called Buffalo), my small Windows partition used with VMWare Fusion, and my complete leopard backup.
The Goal
Given the long, hard to read preamble above, the goal was to find a way to be sure that Bison and WINDOWS XP mount automatically on system start, but that direct backup refrain from doing so. I know from freeBSD that file system automounts in unix-based systems are usually controlled by the fstab file so I googled around to find out if that is still the case in Mac OS X, which we all now is unix-based at its foundations. That information was not easy to come by, but it appears that it is still used, though it may be phased out in some future version of the OS. I further learned that the command for editing fstab is vifs.
The naming of that command tells me that it is going to default to using the vi editor in absence of another setting, and I kind of loath the vi editor. It is very unintuitive for me. Others swear by it, but I much prefer emacs. If you don’t care about changing the editor, skip the rest of this paragraph. So I opened up the terminal, and since my default shell is zsh I ran the command
echo $EDITORto see what the system text editor was set to, it was empty to I made a note to change my profile to add emacs as the default, and ran
export EDITOR=emacsto set the editor for this session to be emacs. If you were using the default shell (bash), you would probably just run
EDITOR=emacs.
Now that my editor was set I needed to find out the necessary information about my disk partitions to enter in the fstab. I ran
diskutil info /Volumes/Bisonto get the information for Bison, and copied out the UUID from the heading labeled Volume UUID: and verified the type of partition from the Type: heading. With this information safely tucked away I ran the same command for WINDOWS XP and direct backup and noted down their information.
Next I ran
sudo vifs. You have to run vifs as a superuser since you are making changes that are potentially very damaging to the system (always have a good backup). the format of fstab is:
Identifier, mount point, fs type, options, dump order, check order
with each item separated by a space or tab. I only needed to put in information up to the options section, as I am not concerned about making any manual settings for dump order or check order. Here was my initial fstab:
UUID=070AE21A-4CB1-3AF1-85F6-FCDA55D3C726 none hfs rw,auto UUID=21D65790-4F21-3573-A5B7-C6BDCD119E3E none hfs rw,auto UUID=90410FD7-9CC5-375D-B16C-9C4B2C502D50 none hfs rw,noauto
The last item in the list is the direct backup disk, notice the noauto option on that one. (for more information on options and all that try
man fstab)
I rebooted the system, and joy of joys, my firewire disk mounted. Unfortunately it mounted all partitions, including the direct backup one. I ran vifs again and moved the line for the direct backup partition to the top of the list so the system would parse it first and rebooted. That did the trick. Now when my machine boots, it mounts Bison and WINDOWS XP but leaves direct backup unmounted. I can then mount it at will from the Disk Utility application or from the command line.
I know this writeup is kind of rambling, hopefully it isn’t too hard to follow and can help someone else out who is having similar issues. The main reason for posting it though is so I’ll be able to find it if I run into the issue again.
A quick update: Not mounting my direct backup disk did not solve the finder freeze issue, but it does solve some other problems that were really a thorn in my side, so I’m glad I did it. Also I found a mac fixit article that pointed out some possible causes for my article, and with some further troubleshooting I found that I could get the finder to successfully come back when it crashes by power cycling the external firewire disk. The article suggested the root of the issue may be to do with launch services, so I trashed the preference plist for that and restarted launch services. Only time will tell if that fixed my worst problem.