Jump to content

REINSTALL REWRITE DARWIN BOOTLOADER


cele_82
 Share

25 posts in this topic

Recommended Posts

First I want to know if know it correctly:

 

The MBR is the first part of the disk and it contains the data about how the disk is partitioned and which is the partition to boot.

 

Every OS partition has in it a bootloader, for example Windows partition has NTLDR bootloader, OSX partition has Darwin Bootloader.

 

IS IT RIGHT?

 

 

MY PROBLEM:

 

I have installed OSX and XP in the same disk with no trouble and pain, and Acronis to manage the boot.

 

In a later reinstallation of XP (with OSX partition active damn...) XP has "deleted" the Acronis and also the Darwin Bootloader.

 

I've tried to reinstall Acronis but it doens't see no longer the OSX system only the XP.

Without Acronis installed If I make acrive the OSX partition it boot and says "NTLDR missing", if I make XP partition active it boots normally.

 

I know that I can use chain0 method but I don't want cause in a short future I want to delete Windows and use only OSX.

 

 

SOLUTIONS ALREADY TESTED:

 

I've tried to use sudo fdisk -e /dev/rdisk0 but it restore only the MBR(like fixmbr in Windowss and the MBR works cause Windows boot if I want)

 

 

WHAT I NEED IS TO REINSTALL DARWIN BOOTLOADER LIKE FIXBOOT COMMAND FOR WINDOWS.

 

 

IDEAS???

Link to comment
Share on other sites

I've done doing this:

 

1. Remove any non Windows/Apple Bootloader (like Acronis,Grub, etc...)

2. Make OSX partition active

3. Boot from the Install DVD, open Terminal from Utility

4. Going to /usr/standalone/i386 folder of the DVD

5. write "dd if=boot1h of=/dev/disk0s1 bs=512 count=1 (see the end note for disk0s1)

6. Reboot and say welcome to Darwin Bootloader.

 

 

Use disk0s1 or rdisk0s1 if your OSX partition is on the first disk (0) and on the first partition (1)

 

 

If you can not boot again, boot from the install DVD pressing F8 (this will take you directly in OSX) and from terminal do:

 

1. sudo fdisk -e /dev/rdisk0 (if you have install OSX in the first disk of the system)

2. reinit

3. flag 1 (if the OSX is in the first partition, or 2 if it is in the second)

4. write

5. exit

6. reboot

 

Also try to do:

 

1. sudo fdisk -e /dev/rdisk0 (if you have install OSX in the first disk of the system)

2. update

3. write

4. exit

5. reboot

 

Hope that for someone this will be useful.

Link to comment
Share on other sites

  • 3 months later...

Hopefully this will help someone who is in the same situation as I was.

 

I have Windows on my first partition and OS X on the second. I use the Darwin bootloader to choose OS X or Windows. The other day I had to reinstall Windows and after this the Darwin bootloader never came up.

 

The solution is to use the second set of instructions (as repeated below) to make the second partition with the Darwin bootloader active - you don't need to fiddle with the MBR or anything else.

 

1. sudo fdisk -e /dev/rdisk0 (if you have install OSX in the first disk of the system)

2. reinit

3. flag 1 (if the OSX is in the first partition, or 2 if it is in the second)

4. write

5. exit

6. reboot

 

I didn't realise this until I had messed up the mbr so had to reinstall the Windows bootloader (as I had multiple partitions and harddisks I had to specify the partition, "fixmbr c:"). :(

Link to comment
Share on other sites

Is there a way to do this from within windows or linux. I had burned the install DVD on a rewritable DVD and I already rewrote the DVD since I installed OS X. I am trying to use EasyBCD but I get an error when I select OS X. I'll restart and post the error.

 

EDIT: The error is "Chain booting error". That's all that is on my screen. It happened after I modified my partition table. But even after I set all the values back I still got the error.

Link to comment
Share on other sites

  • 3 weeks later...

I have a similar sort of problem. My OSX 10.4.8 will not boot, just hangs at a flashing cursor just after the BIOS. If I leave the install CD in the drive and let the counter reach 0 then OSX boots from my hard drive with no problems.

 

I assume my darwin bootloader is broken in the same way so I will try your methods and post back what happens for me.

 

Thanks for the info :(

Link to comment
Share on other sites

After doing the above, now when my system boots I get a message saying "HFS+ partition error."

 

So it definitely done something so I looked into it further. After reading many many different problems about booting after DVD installation I noticed that my hard drive seemed partitioned differently. Here is what fdisk shows:

 

osx86-computer:~ root# fdisk -e /dev/rdisk0

Enter 'help' for information

fdisk: 1> p

Disk: /dev/rdisk0 geometry: 3649/255/63 [58633344 sectors]

Offset: 0 Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

*1: AB 0 1 1 - 1023 254 63 [ 63 - 16384] Darwin Boot

2: AF 1023 254 63 - 1023 254 63 [ 16447 - 58616897] HFS+

3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

fdisk: 1>

 

Now I admit i'm a complete noob when it comes to osx and when I originally formatted my hard drive and set it up, I used fdisk auto boothfs command to make the partition. I assumed this was correct as the boothfs made me think the 8MB 1st part. was needed to boot osx.

 

Looking at other people problems and solutions it appears that you only need 1 hfs partition.

 

By now though my 10.4.8 is running pretty sweet and I've got it set up just the way I want it so I thought I'd do some more reading to see if I could find a solution. I found a post but I cannot remember where and who was the poster so sorry to whoever it was as I cannot make a thank you reply. I'll try and explain the steps I took as maybe someone will find this information useful too.

 

First thing I needed to do was flag partition 2 as the boot partition so I booted the DVD installation and ran a terminal. I then typed:

 

 

fdisk -e /dev/rdisk0

update

flag 2

write

quit

reboot

 

This seems to flag the 2nd partition as the boot partition but I assume the bootloader is missing still. (remember I am new to osx and mac stuff so correct me if I am wrong please)

 

I read that I now needed to copy the boot files from the DVD cd into a folder on the hard drive. So when my system had booted back into osx, I copied all the files from the DVD folder "/usr/standalone/i386/" folder to the exact same folder on the hard drive "/usr/standalone/i386/" some of the files were named boot boot0 boot1h etc.

 

Now i needed to embed? these files into the boot sector. Well embed is what I gathered from reading different sources. To do this I also needed a file freely available in source form by apple called startupfiletool. After looking around the net I found a compiled version of this and saved it to my USB drive.

 

Now I came across another problem, i needed to unmount the drive to perform this operation and I needed access to this startupfiletool after the drive was unmounted. Simple I thought, It's on the USB drive so just run it from there. Well I cannot access the USB drive at all from booting the DVD Installation and I have no idea how to add this drive. So instead of messing on trying to gain access to the USB drive I simply burned the file to a blank DVD.

 

Now this is the final step I took and it worked like a charm. For the following please note -

 

OSX86inst < refers to the volume name of the installation DVD.

ToolsDVD < refers to the blank DVD I used to copy startupfiletool too.

OSX86 < refers to the volume name of my 2nd partition on the hard drive.

 

So you will need to replace these with the volume names of your disks.

 

 

I booted the system with the installation DVD and ran a terminal. From here I typed (case sensitive):

 

diskutil unmount disk0s2

cd /volumes/OSX86inst/usr/standalone/i386

dd if=boot1h of=/dev/rdisk0s2 bs=512 count=1

/volumes/ToolsDVD/startupfiletool -v /dev/rdisk0s2 boot

bless -device /dev/disk0s2 -setBoot -verbose

diskutil mount disk0s2

bless -mount /volumes/OSX86/ -setBoot -verbose

reboot

 

I took the installation DVD out of the drive before I ran the reboot command. I had been using the DVD as a method to boot osx from my hard drive by letting the timer reach 0. Upon Bios screen finishing the next screen was an apple! It was now booting without the DVD ! :dev:

 

 

I'm sorry about the crappy layout of this post but I hope that it helps someone to overcome this problem as it does not seem too uncommon from reading various forums.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 3 weeks later...
  • 2 months later...

2. Make OSX partition active

3. Boot from the Install DVD, open Terminal from Utility

4. Going to /usr/standalone/i386 folder of the DVD

5. write "dd if=boot1h of=/dev/disk0s1 bs=512 count=1 (see the end note for disk0s1)

6. Reboot and say welcome to Darwin Bootloader

 

i am little lost about step #4, how you do that??

Link to comment
Share on other sites

  • 2 months later...
2. Make OSX partition active

3. Boot from the Install DVD, open Terminal from Utility

4. Going to /usr/standalone/i386 folder of the DVD

5. write "dd if=boot1h of=/dev/disk0s1 bs=512 count=1 (see the end note for disk0s1)

6. Reboot and say welcome to Darwin Bootloader

 

i am little lost about step #4, how you do that??

 

at terminal, type "cd /usr/standalone/i386" (without quotes)

Link to comment
Share on other sites

  • 1 month later...

did it, great, got the bootloader back up but it simply resets immediately, even prior the gray apple logo.

Did -v, it ran through the large font verbose files, then does the same before the little font comes up.

I have a sneaky suspicion that the bless command did not work, as every time it was called it spewed out;

 

'bless should only be executed from the installation program'.

 

Is this normal for bless? Is this my problem? How do I go about fixing it?

Perhaps I need the Chameleon bootloader? No clue, please help!

-------------

 

update:

 

Good news all! I installed the Chameleon bootloader using osx86 tools and all is well!!

Is this the standard bootloader that comes with Kalyway!?

Link to comment
Share on other sites

  • 3 weeks later...

You can also store chain0 file (search google for chain0.rar - 512B unpacked) on Your XP drive and use Your NTLDR for booting OS-X

Just edit boot.ini file and add line C:\chain0="OS-X blablah" to [operating systems] section.

 

Cheers, Mi.

Link to comment
Share on other sites

  • 4 weeks later...

Christ I've found it !

 

(and AFAIK it's not on insanelymac, anyway I didn't found this oh so needed answer to so many boot problems)

  • Get to terminal (in Utilies at the top of the first screen)

  1. boot up the osx86 install dvd
  2. select tools in the top menu bar
  3. select terminal

  • Find out which hard disk to install mbr to, if you only have one its rdisk0
  • restore mbr with following command

  1. fdisk -u /dev/rdisk0
  2. hit ender
  3. respod with the answer yes to if you want to install new mbr

  • Please keep in mind that depending on how many hard drives you have it might not be rdisk0

as seen here : http://sportman.freeflux.net/blog/archive/...der-to-mbr.html

Link to comment
Share on other sites

  • 1 month later...

Hi,

I just realized that a very convenient way of getting back darwin after whatever is having an OSX release, which gives you the possibility to install only the bootloader. This won't affect your installation it will only install the darwin bootloader freshly. Thanks to that you needn't have to worry about commamds, terminal and stuff.

Such releases are usually provided by uphuck or for leopard iatkos.

Hope it helps some, and that my info is not already yesterdays snow :-)

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
Many thanks for posting this solution!

Helped me restoring my system w/o pain.

 

I'm stuck with flashing underscores on 10.5.6... i was getting a hfs+ partition error but i'm not no more. When I tried the dd command it said unknown operand and didn't seem to work. I can't get into osx at all to boot. Any ideas?

Link to comment
Share on other sites

  • 1 month later...

The following DID NOT work for me and would just leave me at the usual "Boot0: MBR" error on boot-up

* Doing the "fdisk -e /dev/rdisk0"

* Doing the "fdisk" with update or reinit

* Doing the "dd" command to my /dev/disk0s2 (my OSX is on primary partition 2, WinXP on primary partition 1)

 

The following made the "Boot0: MBR" error go away *but* then the screen would just flash a cursor indefinitely:

* "fixmbr" procedure in WinXP Recovery Console

 

Here's what *FINALLY* did work:

 

1. Boot off my "MSI Wind OSX 10.5.4" install disk (despite having installed iPC v10.5.6).

2. This got me to my Mac OSX partition, but if it hadn't, you can F8 and then "rd=/dev/disk0s2" if OSX on partition 2 of first disk (as in my case).

3. Install "OSx86 Tools" and launch.

4. Do the "EFI Install" option and specifically select "Chamelian EFI" to the OSX partition (/dev/disk0s2).

5. Enter your password when prompted.

6. Say "yes" despite the warning about this being an active partition and losing data.

7. Eject the CD-ROM install disk (right-click > eject)

8. Reboot (from Apple menu) or "sudo reboot"

9. The issue should now be fixed. It auto-booted to Mac 0SX. (Although this may be because earlier I did do the fdisk "flag 2" step to set this as the active partition.

 

Anyhow, on reboot I can access either partiton with the F8 and select either my WinXP partition (/dev/disk0s1) or OSX (/dev/disk0s2).

 

Hope this helps someone because I spent half a day scouring the net and trying all these things out and am relieved I don't have to reinstall both OSes.

Link to comment
Share on other sites

Wanted to post here since i tried a few of the options in this thread. I installed WinXP on the first partition and OSx86 on the 2nd.

 

Then was playing around and accidentely deleted the Darwin bootloader from the MBR of the disk.

 

Was more stupid by then running windows disk and used the "fixboot" & "fixmbr" so i could at least boot back into XP, figuring i could use XP's boot loader (with the chain0 and boot.ini edit) - this didn't work for some reason, possiblly since i have multiple disks in my machine and c:\chain0 may not be exactly the location of file pre-boot..who knows.

 

Anyway to fix it i did

- make the OSx partition active (i.e. flag it) via terminal from the OSx DVD (see the other post in this thread for how to do this)

- then i was able to boot from the OSx DVD, let the timer run to zero and my OSx install on the 2nd partiton booted up (good!)

- now use OSx86 tools 1. Run the FDISK tool first on the OSx partition (this preps the MBR i think) 2. Install an EFI (i used chameleon)

- reboot and hopefully the bootloader comes back up and you're away.

 

good luck

 

AK

Link to comment
Share on other sites

  • 4 weeks later...
The following DID NOT work for me and would just leave me at the usual "Boot0: MBR" error on boot-up

* Doing the "fdisk -e /dev/rdisk0"

* Doing the "fdisk" with update or reinit

* Doing the "dd" command to my /dev/disk0s2 (my OSX is on primary partition 2, WinXP on primary partition 1)

 

The following made the "Boot0: MBR" error go away *but* then the screen would just flash a cursor indefinitely:

* "fixmbr" procedure in WinXP Recovery Console

 

Here's what *FINALLY* did work:

 

1. Boot off my "MSI Wind OSX 10.5.4" install disk (despite having installed iPC v10.5.6).

2. This got me to my Mac OSX partition, but if it hadn't, you can F8 and then "rd=/dev/disk0s2" if OSX on partition 2 of first disk (as in my case).

3. Install "OSx86 Tools" and launch.

4. Do the "EFI Install" option and specifically select "Chamelian EFI" to the OSX partition (/dev/disk0s2).

5. Enter your password when prompted.

6. Say "yes" despite the warning about this being an active partition and losing data.

7. Eject the CD-ROM install disk (right-click > eject)

8. Reboot (from Apple menu) or "sudo reboot"

9. The issue should now be fixed. It auto-booted to Mac 0SX. (Although this may be because earlier I did do the fdisk "flag 2" step to set this as the active partition.

 

Anyhow, on reboot I can access either partiton with the F8 and select either my WinXP partition (/dev/disk0s1) or OSX (/dev/disk0s2).

 

Hope this helps someone because I spent half a day scouring the net and trying all these things out and am relieved I don't have to reinstall both OSes.

 

Thanks, this worked perfectly

Link to comment
Share on other sites

  • 2 weeks later...
Thanks, this worked perfectly

 

Just to share a chance more....

 

For some reasons, my Darwin loader (from XxX 10.5.6 Universal) didn't return a smooth startup for some plist/bios issues.

(lately I discovered that was a bios issue of my old AMD Turion on a Pavilion HP DV8000 notebook).

 

Anyway, trying to fix this annoying startup issue, I totally erased Darwin using (not properly, maybe) OSX86tools and Fdisk/Install EFI functions. (Why this happened, I don't know....)

So I fell down on the tragic "boot0: mbr / boot0 : done" error

 

I tried using OSX86 again and again, testing all the possible choices (PC EFI, EFI+Chameleon, Darwin alone).

I even tried, as suggested on forums, to fdisk -u from the DVD terminal.

 

No way.

 

The only chance to boot my system has been, for two days, to use the DVD Bootloader.

 

My final and winning solution was to install the Netkas Zef Bootloader PC EFI v9 Chameleon v1.0.12 through this little app downloadable here (h-t-t-p://######.com/weaksauce12/?p=309), and launch it directly from Leopard.

 

Once rebooted, Darwin, incredibly, was there again.

 

Please notice that I tried it only once and on my "hack" machine.... so before doing anything I strongly suggest to CCC your OSX86 on another HD and then play and trick.

 

Stefania Castelli

Italy

Link to comment
Share on other sites

  • 4 weeks later...
After doing the above, now when my system boots I get a message saying "HFS+ partition error."

 

So it definitely done something so I looked into it further. After reading many many different problems about booting after DVD installation I noticed that my hard drive seemed partitioned differently. Here is what fdisk shows:

 

osx86-computer:~ root# fdisk -e /dev/rdisk0

Enter 'help' for information

fdisk: 1> p

Disk: /dev/rdisk0 geometry: 3649/255/63 [58633344 sectors]

Offset: 0 Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

*1: AB 0 1 1 - 1023 254 63 [ 63 - 16384] Darwin Boot

2: AF 1023 254 63 - 1023 254 63 [ 16447 - 58616897] HFS+

3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

fdisk: 1>

 

Now I admit i'm a complete noob when it comes to osx and when I originally formatted my hard drive and set it up, I used fdisk auto boothfs command to make the partition. I assumed this was correct as the boothfs made me think the 8MB 1st part. was needed to boot osx.

 

Looking at other people problems and solutions it appears that you only need 1 hfs partition.

 

By now though my 10.4.8 is running pretty sweet and I've got it set up just the way I want it so I thought I'd do some more reading to see if I could find a solution. I found a post but I cannot remember where and who was the poster so sorry to whoever it was as I cannot make a thank you reply. I'll try and explain the steps I took as maybe someone will find this information useful too.

 

First thing I needed to do was flag partition 2 as the boot partition so I booted the DVD installation and ran a terminal. I then typed:

fdisk -e /dev/rdisk0

update

flag 2

write

quit

reboot

 

This seems to flag the 2nd partition as the boot partition but I assume the bootloader is missing still. (remember I am new to osx and mac stuff so correct me if I am wrong please)

 

I read that I now needed to copy the boot files from the DVD cd into a folder on the hard drive. So when my system had booted back into osx, I copied all the files from the DVD folder "/usr/standalone/i386/" folder to the exact same folder on the hard drive "/usr/standalone/i386/" some of the files were named boot boot0 boot1h etc.

 

Now i needed to embed? these files into the boot sector. Well embed is what I gathered from reading different sources. To do this I also needed a file freely available in source form by apple called startupfiletool. After looking around the net I found a compiled version of this and saved it to my USB drive.

 

Now I came across another problem, i needed to unmount the drive to perform this operation and I needed access to this startupfiletool after the drive was unmounted. Simple I thought, It's on the USB drive so just run it from there. Well I cannot access the USB drive at all from booting the DVD Installation and I have no idea how to add this drive. So instead of messing on trying to gain access to the USB drive I simply burned the file to a blank DVD.

 

Now this is the final step I took and it worked like a charm. For the following please note -

 

OSX86inst < refers to the volume name of the installation DVD.

ToolsDVD < refers to the blank DVD I used to copy startupfiletool too.

OSX86 < refers to the volume name of my 2nd partition on the hard drive.

 

So you will need to replace these with the volume names of your disks.

I booted the system with the installation DVD and ran a terminal. From here I typed (case sensitive):

 

diskutil unmount disk0s2

cd /volumes/OSX86inst/usr/standalone/i386

dd if=boot1h of=/dev/rdisk0s2 bs=512 count=1

/volumes/ToolsDVD/startupfiletool -v /dev/rdisk0s2 boot

bless -device /dev/disk0s2 -setBoot -verbose

diskutil mount disk0s2

bless -mount /volumes/OSX86/ -setBoot -verbose

reboot

 

I took the installation DVD out of the drive before I ran the reboot command. I had been using the DVD as a method to boot osx from my hard drive by letting the timer reach 0. Upon Bios screen finishing the next screen was an apple! It was now booting without the DVD ! :)

I'm sorry about the crappy layout of this post but I hope that it helps someone to overcome this problem as it does not seem too uncommon from reading various forums.

 

You are guru man, your method helps

My hackintosh details: Leo Kalyway 10.5.3

Link to comment
Share on other sites

 Share

×
×
  • Create New...