Solved Grub install on a UFS partition

I like the idea of installing Grub as it provides an easy way of loading numerous OSes, but to install it you need to have a Linux partiion where the Grub files are installed, so I always create a small partition on which I install some flavour of Linux. But I was wondering if Linux can access UFS partitions then maybe I could grub-install onto a UFS partition.

Anyone know?
 
Using the linux grub bootloader it goes like this,
Code:
menuentry "FreeBSD" {
    insmod part_bsd
    insmod part_gpt
    insmod part_msdos
    insmod ufs2
    insmod chain
    root=(hd0,gpt1)
    kfreebsd /boot/loader
}
 
I like the idea of installing Grub as it provides an easy way of loading numerous OSes
I'm confused by this. There are other OSes besides FreeBSD? If so "why"? :) I'm kidding.

It's been a while since I've looked at /used GRUB, but it should be relatively OS independent. Natively it may not speak FreeBSD filesystems (that's why Alain De Vos has the insmod ufs2) and it may not understand FreeBSD disk nomenclature (meaning you may have to translate /dev/ada0p1 to something Linux-like), but I think it should work for FreeBSD stuff.
 
It even knows zfs
To use it,
Code:
menuentry "ZFS ON ROOT CHAINLOADING" {
 insmod part_msdos
 insmod part_gpt
 insmod zfs
 search -s -l MYZPOOL
 kfreebsd /ROOT/default/@/boot/zfsloader
}
 
  • Thanks
Reactions: mer
It sounds like I haven't made myself clear. I know you load FreeBSD from a Linux partition via Grub. I do that all the time. What I meant was can you install Grub on a UFS partition?

There are two parts to installing Grub:-

grub-install --boot-directory=/mnt/boot /dev/sda

The boot loader goes into the device's boot partition, but, I'm presuming since I don't know for certain, this boot loader will know where to locate the Grub images and grub.cfg , so my question is would the loader be able find these images on a UFS partition?

I suppose I can find out for myself.

Incidentally I'm assuming this command is being run from a Linux system.
 
Good question.
There is boot-directory, which filesystem and how it is mounted.
There is also the flag root-directory.
Normally insmod gpt for the partition table, and insmod ufs2 for the filesystem.
"should" work.
There is also something like the active partition.
My buggy hp-bios only wants to boot from MBR.
 
Problem is you cannot mount an ufs filesystem in linux in the first place. There is no ufs driver. So this will never work with grub in linux.
This works but it is zfs oriented,
Code:
menuentry "ZFS ON ROOT CHAINLOADING" {
insmod part_msdos
insmod part_gpt
insmod zfs
search -s -l MYZPOOL
kfreebsd /ROOT/default/@/boot/zfsloader
}
 
Back
Top