Monday, 17 January 2011

OS X Bootpicker randomly not working

I have a computer suite with Dual Boot apple macs, when you switch them on they boot into OS X and give you the BootPicker menu. Rather annoyingly, only in this room, after rebooting bootpicker doesn't load on some, and after another reboot bootpicker works on these and fails on others. It's been happening for years and caused a lot of annoyance (only with me though). I must admit I do hate random problems.


So I thought I'd take the time to properly look into this problem. I noticed that bootpicker needs the "BSD e.g. Name:disk0s2" of the Windows partition to work. Now on these Apple Macs (Mac Pro's) there are two hard drives, one scratch disk and one operating systems disk (partitioned into two). Now for the Mac Pro's or OS X, it just randomly orders the disks, probably classed on how fast they respond on bootup, to either "disk1" or "disk0"! And so bootpicker fails. The command I found which lists the windows partition disk is:
diskutil list | grep 'Microsoft'
So, solutions! Well, there are two apparent solutions. Either get bootpicker to work not from bsd names but something unchanging like mount points (which are always the same) or UUID's, or get OS X not to randomly name the disks.

To get OS X or mac to keep disk names the same is to do with the /etc/FStab file. Now in OS X it doesn't need this file but if you make one it'll use it (I don't like it though). So using this file you can tell OS X which disk with particular UUID should be mounted where. Here are some posts I've found about it:

http://stackoverflow.com/questions/2278714/look-up-a-volume-by-uuid
http://discussions.apple.com/thread.jspa?messageID=5820852&tstart=0

To get the UUID you just type in terminal:
diskutil info /Volumes/Untitled
Untitled is the mount point for the windows partition .

To get bootpicker to use something which doesn't change you've got the choice between the mountpoint and the UUID. At the end of the day, the way bootpicker works is when you click on "Windows" it runs the command:
/usr/sbin/bless --device /dev/ --setBoot --legacy --nextonly
You'd need to edit the /Library/Preferences/bootpicker.plist file. There is a "windowspartition" section where it normally says "/dev/disk0s3". I'd like to change this to the UUID or mountpoint. I'm not sure if the mountpoint is relevant at bootup, I think that's more of a OS X thing, so the UUID might be more relevant.

No comments:

Post a Comment