Jump to content

[How to] Setting Your Partition "Active" Using Fdisk in MacOSX


  • Please log in to reply
160 replies to this topic

#1
Rammjet

Rammjet

    InsanelyMac V.I.P.

  • Gurus
  • 5,302 posts
  • Gender:Male
There are a lot of people who experience a b0 error on their first boot up after installation. Or the bootloader immediately takes them back to the Windows installation (on dual boot).

These people probably forgot to set the MacOSX partition "Active"

A common mantra provided here to newbies for setting up for installation is:
  • Make the partition Primary
  • Make the partition ID=AF (signifies an HFS partition)
  • Make the partition Active
There is a built-in Unix utility in MacOSX that can be used to set your partition "Active". It is called Fdisk


Setting Your Partition "Active" Using Fdisk

Words in bold below are things you must type (followed by Enter).

1. Boot your Mac OS X install dvd
2. Once the installer is running, go to the Utilities menu and open Terminal

3. Determine which disk your MacOSX partition is on


Type diskutil list

Verify which disk number holds your partition (disk0, disk1, etc.)


4. Start using Fdisk


Assuming the MacOSX disk is the first disk ("disk0"), then
type fdisk -e /dev/rdisk0 <== use "rdisk" with your disk number here !!

Ignore the error "fdisk: could not open MBR file ..."


5. Determine which partition for MacOSX needs to be set "Active"


Type p

Verify which partition is for MacOSX (1, 2, 3, etc.)


6. Set the partition "Active"

Assuming it is partition 1, then
type f 1 <== use your partition number here !!


7. Save and exit


Type write

Type y (yes you are sure)

Type exit (to quit)


8. Remove the install DVD and reboot

#2
Chevelle

Chevelle

    InsanelyMac Protégé

  • Members
  • Pip
  • 30 posts
  • Gender:Male
Or for the people that don't like to wait for the MacOSX disc to boot. You can just use a Win98 Boot Disk. Run FDISK and set partition active. Just My :P.

#3
Rammjet

Rammjet

    InsanelyMac V.I.P.

  • Gurus
  • 5,302 posts
  • Gender:Male
My intent is to allow the user to get to Fdisk with tools I know he has on hand. So he doesn't have to search for anything else or download anything else.

#4
koolaidman23

koolaidman23

    InsanelyMac Protégé

  • Members
  • Pip
  • 21 posts

My intent is to allow the user to get to Fdisk with tools I know he has on hand. So he doesn't have to search for anything else or download anything else.


and this user thanks you!!

#5
VirtualGuitarist

VirtualGuitarist

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 153 posts
  • Gender:Male
Thank you very much Rammjet. I was looking for a simple solution like this. :thumbsup_anim:

#6
fiap

fiap

    InsanelyMac Protégé

  • Members
  • Pip
  • 13 posts
i'm having "sudo:command not found" , using 10.4.6 Jas PPF1 patch..... HELP!!

#7
Rammjet

Rammjet

    InsanelyMac V.I.P.

  • Gurus
  • 5,302 posts
  • Gender:Male
Usually that means what you typed after the sudo command had a typo - it's not sudo it can't find, it can't find the command that sudo was supposed to execute.

sudo(space)fdisk(space)-e(space)/dev/rdisk0 <- replace 0 if necessary

#8
Quan Dang Dinh

Quan Dang Dinh

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 4 posts
hi,

dear fiap, at Mac OS X not exist sudo command,

you can use: fdisk -e /dev/rdisk0 instead

good luck!!!

#9
Silthrim

Silthrim

    InsanelyMac Protégé

  • Members
  • PipPip
  • 60 posts
  • Gender:Male
  • Location:Bel Air, MD
thank you so much, this really helped me out!

#10
OSX86tester

OSX86tester

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 149 posts
strange i did this twice i am still not able to boot osx completey by itself. i either need an install disk in the drive for 2 seconds or the ubcd. i have no idea whats going on. I still havent found the answer to my problem. do i need darwin or something to jumpstart the boot process? otherwise if i reboot its just a black screen with a blinking underscore

#11
xandiztxu

xandiztxu

    The anti-cancer

  • Members
  • PipPipPipPip
  • 228 posts
If I already installed JAS 10.4.6 what should I do

#12
appleshark

appleshark

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 1 posts

Usually that means what you typed after the sudo command had a typo - it's not sudo it can't find, it can't find the command that sudo was supposed to execute.

sudo(space)fdisk(space)-e(space)/dev/rdisk0 <- replace 0 if necessary



Hi, i am trying to make my disk or partition active so OSX will boot. I typed in "diskutil list" and it returned me with "/dev/disk0, /dev/disk1, /dev/disk2, etc." how is it that yours has a "r" in front of "disk." Also when i typed the sudo command it also said "command not found." I tried putting the "r" in where you had it, but it didn't make a difference.

#13
Rammjet

Rammjet

    InsanelyMac V.I.P.

  • Gurus
  • 5,302 posts
  • Gender:Male

Hi, i am trying to make my disk or partition active so OSX will boot. I typed in "diskutil list" and it returned me with "/dev/disk0, /dev/disk1, /dev/disk2, etc." how is it that yours has a "r" in front of "disk." Also when i typed the sudo command it also said "command not found." I tried putting the "r" in where you had it, but it didn't make a difference.


The intent of the "diskutil list" command is to determine the id number of your hard drive (0, 1, 2, etc).

Then you append that number to "sudo fdisk -e /dev/rdisk#" where "#" is the number you determined from "diskutil list"

If the command isn't found, you have a typo somewhere.

#14
sdelano

sdelano

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 107 posts
I can't figure out the partition I need to make active after entering "p" into the terminal...which one is it from this screenshot?

Thanks

Attached Files



#15
Rammjet

Rammjet

    InsanelyMac V.I.P.

  • Gurus
  • 5,302 posts
  • Gender:Male
Off hand, I would say 2. However, I would be more comfortable if I could see all of the output from the "diskutil list" command so I could be sure how you set up your drive. Half of it has scrolled off the top.

#16
sdelano

sdelano

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 107 posts
It was 2, and that just plain didn't work for some reason... I just had a flashing undersore (what it does when searching for bootable drives)

So I then set it to 1 and xp booted for the first time in half a week so I was kinda stoked. Then I just said f*** it and did the Chain0 method. Now it works...only gripe I have about the Chain0 method is that I have to select OS X then pres enter at the darwin boot screen and select OSX again manually otherwise it doesnt work...anybody know anything about that?

Here is my com.apple.boot.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Kernel</key>
	<string>mach_kernel</string>
	<key>Kernel Flags</key>
	<string></string>
	<key>Boot Graphics</key>
	<string>Yes</string>
	<key>Graphics Mode</key>
	<string>1280x1024x32</string>
	<key>Timeout</key>
	<string>10</string>
</dict>
</plist>

Thanks

#17
Will Ryan

Will Ryan

    InsanelyMac Protégé

  • Members
  • Pip
  • 24 posts
Hmmm....it doesn't seem to be working. Here's a screenshot:

http://img217.images.../asdfasddx3.jpg


I have a feeling I'm doing some of the stuff wrong. Everything I wrote is in Red. Also, after I type "write," it says writing blakhg something, then nothing happens.

#18
Rammjet

Rammjet

    InsanelyMac V.I.P.

  • Gurus
  • 5,302 posts
  • Gender:Male
Everything that you typed in fdisk looks correct and the responses from fdisk look correct.

What doesn't look right is that under "diskutil list", the 2nd partition says it is NTFS. If that is the OSX partition, it shouldn't say that. Did you format the OSX partition in Disk Utility during the installation?

#19
speakerwizard

speakerwizard

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
Heya Guys, so, im still quite new here and found this thread that appered to be the answer to my problem, but im not entirely sure what im doing haha, there so many different disk numbers when i do the diskutil list, im not sure what to pick, and when i picked what i thought was right it didnt let me do it, heres the terminal window, if somebody could give me a lil' help, thanks

http://www.flickr.co...@N00/257203325/

#20
Rammjet

Rammjet

    InsanelyMac V.I.P.

  • Gurus
  • 5,302 posts
  • Gender:Male
/dev/disk0 contains your HFS+ partition
/dev/disk1 is your installation DVD

use: fdisk -e /dev/rdisk0
then set partition 1 to active (f 1)





1 user(s) are reading this topic

1 members, 0 guests, 0 anonymous users


© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy