Is blessing the Ubuntu partition reversible in OS X?

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

Solution 1:

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.