Sunday, October 19, 2008

Make primary install bootable

how to make a primary installation OSX partition bootable?
sometimes you are going to need a solution for a non bootable partition that was previousely bootable or after successful installation the partition remain non-bootable.

please note that the solution sugested here is for a primary installtion, which means it is for the main and only OSX installation on your computer and you have no way to boot into another OSX system. although it is possible to restore a secondary OSX installaion to be bootable again using this method, there is a simpler solution and it is described at this post.

primary installaion = the first and only OSX installation on your computer.
secondary installation = second (or greater) installation of OSX type (means you have more then one OSX installed on your computer) a disk-on-key/external USB/Firewire drive can be considered a secondary installation for this matter.

also note that this post is for MABR partition scheme (and not for GUID partition scheme). if you don't know what MBR or GUID partition scheme means then please read this post first.

in order to make an OSX86 partition bootable follow these next steps:
1. boot leopard DVD into Single Mode (you can red how to do that here)

2. type the next commands at the command line:
cd /usr/standalone/i386

the result of these two lines should be a list displaying all the files in the i386 folder,
please make sure that at least these files exist:

if these files does not exist they can be copied from the installation DVD, in order to copy the files from the DVD use the method explained in this post. the files can also be downloaded from here.

3. if this is the case then type:
dd if=./boot1h of=/dev/rdiskXsY bs=512 count=1
(replace the X letter with the drive number that the OSX is installed on, the first drive is 0 the second is 1 and so on. replace the Y letter with the OSX partition number, the first partition is 1, the second partition is 2 etc. example: my computer has only one drive so my drive number is 0, and i have windows installed on the first partition and OSX on the second partition, so my OSX partition should be 2, therefor my parameter should be: rdisk0S2)

you should see an output result similar to this:
1+0 records in
1+0 records out
512 bytes transferred in 0.008498 secs (60250 bytes/sec)

4. now type this command:
dd if=./boot0 of=/dev/diskX bs=400 count=1
(replace the X letter with the OSX drive number, first drive is 0, second drive is 1 etc. also please note that it is diskX and not rdiskX as the previouse command)

you should see an output result similar to this:
1+0 records in
1+0 records out
400 bytes transferred in 0.018606 secs (21498 bytes/sec)

5. type in the next command:
./startupfiletool -v /dev/diskXsY ./boot_v8
(replace the X with the number of the OSX drive and Y with the number of the OSX partition)

you should see an output result similar to this:
HFS+ filesystem detected
Looking for 1 word free
reading 4096,4096
reading 8192,4096
reading 12288,4096
Marking word 510
writing back 1288,4096
allocated blocks 32 at start 81856

now the disk should be bootable and should be able to boot on his own, you may do the steps in this post or this post as a completeing procedure in order to make sure that the OSX is the first partition to boot from.


No comments:

the menu is from: Milonic DHTML menus