Ubuntu 12.04 Precise LTE:GRUB2 unable to boot solaris 11 on zfs

Asked by Lakshminarayanan Seshadri on 2013-02-15

This is really a GRUB2 question....

Problem in short:
Unable to get Ubuntu 12.04 Precise's Grub2 to boot solaris 11 OS somehow( os probe or some custom menuentry i tried didnt work).

Detail: (please bear with me for being verbose here...)

I have ubuntu 12.04 Precise LTE(64bit desktop version) installed as my main linux OS from which i boot windows(via chainloader) in GRUB2(grub 1.9x actually) properly as well as one more linux distro.
However after i installed solaris 11 i am unable to get the ubuntu properly booted directly from my hard disk. solaris 11 UI install had no option to skip mbr update on whole disk device as well as i couldnt somehow force its own grub2 bootloader(1.99) to install its boot code only into its partition sectors.
My objective is to have ubuntu as main OS whose grub2 to boot others via chainloader mechanism or a custom menu entry if needed via 40_custom file. os probe didnt pick solaris properly as it is unable to detect the label and/or zfs boot fs properly.

Currently i boot ubuntu from a backup of its grub installed from a usb stick .(i had installed grub and updated mbr on a alternate device as a backup before i installed solaris)

Can anyone advise of a sample working menu entry or somehow get os probe pickup solaris 11 as part of grub-update.
 I looked up at grub2 manuals and tried few things but didnt work for me to get solaris 11 booted from ubuntu grub side.
The issue is the solaris 11 install uses zfs for its boot filesystem and its own grub2 menu entry contains some zfs boot fs variables whose syntax are not recognized by ubuntu grub .Also ubuntu grub2 is not even able to understand the solaris partition filesystem properly though i made sure zfs,gzio modules are loaded. Tried checking from grub2 command line and it is unable to list the solaris partition filesystem properly(unknown) as well as i couldnt update label as well.

Of course i could try other way around to see if the solaris 11 grub to boot ubuntu but this way also looks problematic as i am not familiar with the implementation of its grub2 or its command line stuff.

Thanks in advance for reading this far...
I can update the sample menu entry from solaris 11 side (from its grub2(1.99x) implementation along with zfs boot fs variables etc if someone is interested..


Question information

English Edit question
Ubuntu grub2 Edit question
No assignee Edit question
Solved by:
Mark Rijckenberg
Last query:
Last reply:

This question was reopened

I think the answer to your question is in this guide on page 88 :


I used the PC BSD 9.1 handbook (page 88) to successfully configure the /etc/grub.d/40_custom file to detect and boot from the PC BSD 9.1 ZFS partition. I am triple booting Windows 7, Ubuntu 12.10 and PC BSD 9.1 with grub2 as bootloader in the MBR. No issues at all. I think the instructions should also apply to Solaris 11, because the solution is ONLY related to configuring grub2 and NOT the operating system involved.

Here are the contents of my /etc/grub.d/40_custom file.

You need to replace

set root='(hd0,3)'

with the RIGHT value.

$ cat /etc/grub.d/40_custom
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry 'PC-BSD 9.1 64bit choice hd03' --class os {
    set root='(hd0,3)'
    chainloader +1

Hi Mark
  Thanks for your quick response here.
But i am afraid the solaris 11 i am talking is a latest solaris distro from vendor oracle and i have tried along similar lines earlier which didnt work for me.
chainloader +1 after setting root to (hd1,11) in my case( as i had to currently boot from a backup device which is hd0 and my solaris partition is on hd1,11) didnt work.
i get error as : "invalid signature ..." tried with 'force' option as well. I can actually see all my partitions on my hard disk from grub2 command line at boot time along with solaris partition but grub2 of ubuntu couldnt recognize zfs filesystem . Even partition tool couldnt see label and shows unknown type. i couldnt give any label as well from solaris side as well.

Let me explain the actual setup in case it is not very clear:

On my hard disk i have:
  ubuntu on /dev/sda5
  windows 7 on /dev/sda2.
Installed solaris 11 on /dev/sda11 which had its own grub2(grub 1.99) installed as well as it had updated mbr on hard disk, ...There was no option for me here to skip mbr update as i mentioned..)

(i had earlier installed grub along with device/mbr update on another drive,a usb as a backup to rely on )

Now From usb drive whenever i boot ubuntu ,this is hd0 and my hard disk becomes hd1) i could set solaris partition root as (hd1,11) but cannot do chainload to solaris partition to make it boot.

The reason chainloader wont work as of now for me i guess is that the solaris 11 install neither allowed me to skip mbr update nor i could see a forced boot code install into its own partition when i installed it. Only if i could force bootloader install into its own partition i guess chainloader would make sense i guess. Please correct me if i am wrong...

I think only way out is to force ubuntu grub reinstall on my hard disk into its own partition and then try either chainload/natively boot ubuntu from solaris grub. Or do some more searching the doc on solaris side to do a force update into its own partiton and chainload from ubuntu side.
GIven that recognizing solaris zfs partition itself is an issue for me now i guess i dont want to waste time on trying to boot via configfile/natively solaris from ubuntu side.

i am goin to update here as "problem solved" but though i am not really happy with the promise of grub2 being able to support non-linux/windows ones that also bring some grub2....

thanks anyway

Read this:


You will need to run

sudo blkid

in Ubuntu to find the UUID value for your ZFS partition.

Here is the output on my PC:

$ sudo blkid
[sudo] password:
/dev/sda1: UUID="7EDAFD03DAFCB90B" TYPE="ntfs"
/dev/sda3: LABEL="tank0" UUID="1335490240434827866" UUID_SUB="16466737803330615519" TYPE="zfs_member"
/dev/sda5: UUID="09e634b8-5443-4954-bd97-f9117f861c5b" TYPE="ext4"
/dev/sda6: UUID="a67c3514-2d4d-4bcd-9e7a-5fa63ea66fbc" TYPE="swap"

Then you need to add the line

 search --no-floppy --fs-uuid --set <enter correct UUID value here> in your /etc/grub.d/40_custom configuration file....

Hi Mark
  In my case "sudo blkid" from ubuntu doesnt list /dev/sda11 at all. Even the GParted tool of ubuntu shows unknown type and no label for the solaris zfs partition on sda11 as well.
Is there a way we can update "label" and/or get this UUID somehow from ubuntu side in particular. I can get UUID populated from the menu entry of solaris 11 but i guess it wont help if i try to boot solaris from ubuntu grub as at boot time it may still not recognize solaris partition ...

THis is the menu entry and i can get UUID for the solaris partition from there though:

menuentry "Oracle Solaris 11.1" {
        insmod part_msdos
        insmod part_sunpc
        insmod part_gpt

        insmod zfs

        search --no-floppy --fs-uuid --set=root c11913cb9253f7d5
        zfs-bootfs /ROOT/solaris/@/ zfs_bootfs
        set kern=/platform/i86pc/kernel/amd64/unix
        echo -n "Loading ${root}/ROOT/solaris/@$kern: "
        $multiboot /ROOT/solaris/@/$kern $kern -B console=graphics -B $zfs_bootfs
        set gfxpayload="1024x768x32;1024x768x16;800x600x16;640x480x16;640x480x15;640x480x32"
        insmod gzio
        echo -n "Loading ${root}/ROOT/solaris/@/platform/i86pc/amd64/boot_archive: "
        $module /ROOT/solaris/@/platform/i86pc/amd64/boot_archive

Then I guess - not certain about it - that Solaris does not want to be booted from Ubuntu's grub2 bootloader (strange), even though I am sure that PC-BSD 9.1 (also with ZFS partition) does work well with Ubuntu.

In my opinion, this is a major flaw in the installation routine of Solaris 11.

So I guess you will need to install Solaris' grub bootloader in the MBR on /dev/sda and add a custom menu entry for Ubuntu in Solaris' grub config file....

Here at Launchpad, we only provide support for using utilities contained in the Ubuntu distribution.

We do not give advice on configuring the bootloaders from totally different operating systems like PC-BSD or Solaris....

i think i should satisfy myself to add some entry from solaris side and make ubuntu bootable. I had spent much time already with grub2.
I am not complaining about ubuntu here but inability/(disappointing) of grub2 to support a clean/easy coexistence of ubuntu&solaris The problem is also aggravated by the vendor/oracle's UI installer not giving any options and possibly some minor differences in zfs related modules in grub2 flavors....

Thanks Mark for your links anyway and i would wait for a day so that someone else has any suggestions to try as well. Else i would mark closed.

Thanks Mark Rijckenberg, that solved my question.

kostya_berger (bergerkos-3) said : #9

Yes, I think Solaris' GRUB2 version is just more capable and that's all. It includes support for everything the opensource GRUB2 does plus additional options. For example, Solaris' ZFS is more advanced than the opensource one.

...Yes, regardless of the fact that "leading ZFS developers left Oracle to work at open-source ZFS version!!!", the latter is almost where it was, while the former has advanced significantly...
Anyway, whatever be our personal feelings, for this very reason linux' GRUB2 can look into FreeBSD zfs pool, but can't into Solaris' -- superior ZFS version, "unknown partition type"...

However, Oracle's GRUB2 menu is easier to customize than ubuntu's. You just add a file "custom.cfg" to the same directory where grub.cfg resides: generally it's "/rpool/boot/grub/custom.cfg". That file is editable and you place there your custom GRUB2 entries you wish to add to Solaris' GRUB2 boot menu. After that you don't even need to recreate grub.cfg -- the new custom entries just appear in the menu on next reboot. No need to create boot environments using beadm or bootadm utilities.

I remember always having to use Solaris bootloader in multi-OS boot configuration, even before they started using GRUB at all. Thankfully they accepted GRUB2 instead of their native one!

...So, the present situation when their GRUB2 is absolutely usable for other OS's without limitations is not bad at all. Otherwise such situations are soluble with good old dd utility. You just let them install their stuff onto HDD, then copy their installed bootloader (the whole boot sector) using dd unto your linux partition and use that file as "chainloader" file. After which you can reinstall your own GRUB2 as the main bootloader if you don't like to have Solaris' GRUB2 ugly menu as main bootloader. Really for their enterprise level they could make fonts look better than this.