Monday, January 16, 2012

Dual Boot PC-BSD 9.0 and OS X Lion on Macmini

A few days ago, both FreeBSD 9.0 and PC-BSD 9.0 are officially released, and these handbooks are also upgraded.
IMO, the best advantage of PC-BSD 9.0 compared with FreeBSD 9.0 is that the installer can make easily dual boot with FreeBSD 9.0/PC-BSD 9.0 and Mac OS X 10.5 or later on Macmini, Macbook and any Mac machines. In this article, I introduce the way I make dual boot.

Get and create install media

Get DVD or USB image Obtaining PC-BSD. I choose the USB image file so that I create install USB media like Writing the IMG File on a Mac OSX System. If you choose the DVD image, please check Burning the CD/DVD ISO File on a Mac OSX System.

Create partition for PC-BSD on Mac

Check this article. But I add some supplements for this article.
  1. In this article, partition for PC-BSD is created with Bootcamp. That's easy but we must prepare some windows installation media. If you have no windows installation media, You can create with Mac OS X's Disk Utility.
  2. rEFIt is optional.

Installation

Check articles in this chapter. But, there are some cautions.
  1. At the boot menu, select 7 and load "geom_part" kernel modules on the loader prompt.
    load geom_part_gpt
    load geom_part_ebr
    load geom_part_bsd
    load geom_part_apm
    load geom_part_mbr
    boot
  2. As noted several times in the chapter, DO NOT check the "Use Entire Disk" box and DO NOT format the entire disk.

After installation

When rebooting after succeeding installation, In Mac OS X, we adjust partition information with fdisk command. Input numbers in below sample is for my environment. You may input numbers fro you environment.
$ sudo fdisk -e /dev/disk0
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1> edit 1
Partition id ('0' to disable)  [0 - FF]: [EE] (? for help) EE
Do you wish to edit in CHS mode? [n] n
Partition offset [0 - 625142448]: [63] 1
Partition size [1 - 625142447]: [625142447] 409639
fdisk:*1> flag 3
Partition 3 marked active.
fdisk:*1> print
Disk: /dev/disk0 geometry: 38913/255/63 [625142448 sectors]
Offset: 0 Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE    0   0   2 - 1023 254  63 [         1 -     409639] <Unknown ID>
 2: AF 1023 254  63 - 1023 254  63 [    409640 -  456697184] HFS+        
*3: A5 1023 254  63 - 1023 254  63 [ 457369600 -  167772160] FreeBSD     
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused
fdisk:*1> quit
Writing current MBR to disk.
Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] y
And then, Check the partition:
sudo fdisk /dev/disk0
Disk: /dev/disk0 geometry: 38913/255/63 [625142448 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE    0   0   2 - 1023 254  63 [         1 -     409639] <Unknown ID>
 2: AF 1023 254  63 - 1023 254  63 [    409640 -  456697184] HFS+        
*3: A5 1023 254  63 - 1023 254  63 [ 457369600 -  167772160] FreeBSD     
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused

Dual boot!

After succeeding installation and adjusting partition, you can do dual boot. If use rEFIt, this automatically recognizes PC-BSD as FreeBSD partition. If you don't use rEFIt, press option key when turn on you Mac, then select "Windows" on your Mac's EFI menu, and select function key labeled "FreeBSD". That's all.

No comments:

Post a Comment