8

Via the loopback command, GRUB2 allows to directly boot an ISO file.

Now, I've configured the according menuentry to boot the PC-BSD Live DVD ISO, but when I try to boot it, the FreeBSD bootstrap loader outputs:

can't load 'kernel'

Here is the GRUB2 menuentry I currently use:

menuentry "PC-BSD" {
        search --no-floppy --fs-uuid --set root 0d11c28a-7186-43b9-ae33-b4bd351c60ad
        loopback loop /PCBSD9.0-RC1-x64-DVD-live.iso
        kfreebsd (loop)/boot/loader
}

Does one know how I'd need to amend that in order to be able to boot the PC-BSD live system?

1

After "can't load 'kernel'" you get dropped to the loader prompt.

It has an ls command, so you can check where your kernel is and load it with load and then boot.

Also you can try to boot the kernel directly, by trying something like kfreebsd (loop)/boot/kernel/kernel.

  • Little late, but I just saw your answer. ls gives open '/' failed: no such file or directory. I wonder how the loader works while (apparently) no root is found? – user569825 Apr 22 '12 at 20:15
0

You can try to chainload the bootloader on your image. grub2 chainloading works like this:

insmod chain
set root = (hdX,Y)
chainloader +1
0

Edit: as someone noted in this thread, the issue is that the boot process at some point wants to mount the root filesystem from the loopback device in a way that is not possible with GRUB's loopback functionality. Note that PC-BSD was renamed to TrueOS and that they now offer USB images.


I'm not too familiar with BSD and I can't find anything about BSD in Arch's Multiboot USB drive article, however they have 3 ways in their GRUB article, at least one should work when adapted to loop-mounted devices:

Chainloading the embedded boot record

menuentry 'FreeBSD' {
  insmod ufs2
  set root='hd0,gpt4,bsd1'
  chainloader +1
}

This seems to be simple and loading the appropriate filesystem module appears to be a good idea but but remember that on optical media there is ISO 9660 or UDF and there are no partitions to my knowledge but El Torito.

Running the traditional BSD 2nd stage loader

menuentry 'FreeBSD' {
  insmod ufs2
  set root='(hd0,4)'
  kfreebsd /boot/loader
}

That's almost what you did just as a static configuration without calling search.

Loading the kernel directly

menuentry 'FreeBSD' {
  insmod ufs2
  set root='hd0,gpt4,bsd1'
  ## or 'hd0,msdos4,bsd1', if using an IBM-PC (MS-DOS) style partition table
  kfreebsd /boot/kernel/kernel
  kfreebsd_loadenv /boot/device.hints
  set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0s4a
  set kFreeBSD.vfs.root.mountfrom.options=rw
}

That looks surprisingly complex. I just tarted downloading the PC-BSD 10.3 iso, hopefully I find some time playing with it to figure out how to make it work via UEFI or legacy in the next few days.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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