Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm considering using Ubuntu as a main OS. So far, I've been using it in a dual boot setup with OS X. The dual boot worked by holding the ⌥ alt key upon boot (not rEFIt).

Blessing the Ubuntu Partition will speed up the boot process. Apparently, all I have to do is this:

sudo bless –device /dev/disk0s3 –setboot –legacy –verbose

I will do this using the Terminal with the Recovery USB for Lion. I do not yet understand in detail what the command does. Also, I do not know how to reverse it.

You can see my partition layout here:

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *128.0 GB   disk0
   1:       Microsoft Basic Data EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            92.7 GB    disk0s2
   3:       Microsoft Basic Data                         10.5 GB    disk0s3
   4:       Microsoft Basic Data                         15.7 GB    disk0s4
   5:                 Linux Swap                         4.2 GB     disk0s5
   6:                  Apple_HFS FREEDOM                 4.2 GB     disk0s7
share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted
+100

Short Answer: YES, it's reversible, nothing is "permanent" in a hard-drive partition (other than deleting partitions and information of course). Almost always you will be able to undo what you did, although sometimes at the cost of data loss, naturally.

While you are at the terminal type:

man bless

or if you're lazy, you can read it here.

You are interested in this part:

 --legacy                 If --setBoot is given, set the firmware to boot a legacy BIOS-based operating
                          system from the specified disk. The active flag of an MBR-partitioned disk is
                          not modified, which can be done with fdisk(8) . This is only supported on EFI-
                          based systems.

update: Yes, the bless command has different modes of operation, one is device, which specifies a device (rather than just a folder or a mount point) as the destination for the 'blessing'. Bear in mind that blessing does two things, it can select the active boot (which is more or less what you want to do) and it can also make sure that a mount point/folder/device has all the required files for booting. (Kind of what the old format c: /s did in DOS. The "s" was something like: Copy all system files there so this drive can boot.

With the -setBoot option you're also telling the system to boot from the specified device (must be unmounted as far as I can remember).

The --legacy basically tells bless that the Operating System that is going to boot doesn't support OpenEFI or EFI and expects a BIOS instead.

Bear in mind that you might need to later use fdisk to set the active partition if ubuntu fails to boot.

rEFIt usually does all this for you and is easily removable if you don't want it anymore, so in any case, I suggest you give it a try unless you have a specific reason to avoid it.

You don't need the --verbose but it's ok to have it to see what's going on.

So in order to undo the upper command, I would do this: sudo bless -device /dev/disk0s1 -file -setboot -file because EFI on disk0s1 is EFI-based But will the pressing ALT still work to start my recovery stick?

That command will not work, if you specify --file you have to give the path to an EFI-Blessed boot file. Since you're reverting to OS X, you don't need to pass that, because bless will use a default one.

The Option/ALT will always work because it basically tells the EFI in your box: don't boot, just read the drive(s) and tell me which ones are bootable, show me a list and let me select one; this works regardless of your boot drive.

Hope this helps. Bear in mind that I haven't used bless more than a couple of times and was months ago (if not years). I don't remember having problems with it, but then again, I was just probably moving drives or doing something weird. Whenever I installed Linux on an Intel-EFI based Mac, I always used rEFIt.

share|improve this answer
    
So the option -device will set to boot disk0s3 (/ of Ubuntu), correct? Since I'm no native English speaker, can you please verify wheather I understood the man page correctly?: -device -> change boot volume -setboot -> set new partition to boot from -legacy -> new boot partition is BIOS-based -verbose -> Text output. I do not need this. So in order to undo the upper command, I would do this: sudo bless -device /dev/disk0s1 -file -setboot -file because EFI on disk0s1 is EFI-based But will the pressing ALT still work to start my recovery stick? –  gentmatt Nov 8 '11 at 21:23
    
Great. Thank you for your help! –  gentmatt Nov 11 '11 at 9:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.