You are not logged in.

#1 2014-01-21 17:53:08

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Can't install grub2 with presence of ufs2 partitions [Solved]

I'm trying FreeBSD in lieu of OpenBSD.  OpenBSD works fine on MBR, but FreeBSD is picky and generally wants GPT.  Was able to get FreeBSD working as long as it's protective MBR is used.  Then when I want back into Arch, I have to put syslinux gptmbr.bin back into the MBR, but FreeBSD doesn't like the dd method.  FreeBSD protects the MBR from being overwritten.  This is GPT/BIOS not GPT/UEFI.  The GPT conversion went without a hitch just fine.  I can't even emulate Arch inside FreeBSD because of the MBR bootcode.  I can however emulate FreeBSD inside Arch and even mount read-only the ufs2 partition with the following sequence:

mount -t ufs -o ufstype=ufs2 -o ro /dev/sdaxx /mnt

When I do grub-install /dev/sda from Arch I get the following message:

Installing for i386-pc platform.
grub-install: error: hostdisk//dev/sda appears to contain a ufs2 filesystem which isn't known to reserve space for DOS-style boot.  Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).

Then when I do grub-install /dev/sda --skip-fs-probe I get:

Installing for i386-pc platform.
grub-install: warning: Attempting to install GRUB to a disk with multiple partition labels.  This is not supported yet..
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.

Booting from freebsd-boot reboots the computer and trying to boot from freebsd-ufs just sits there.  I also think it sort of hard on the MBR to rewrite it each time I need to switch back and forth.  I am currently using syslinux which is fine for linux (linux didn't even notice the difference between MBR and GPT), but nothing I put in syslinux.cfg will boot FreeBSD.  FreeBSD doesn't like my wifi card (b43), but OpenBSD uses it until performance degrades to nothing. 
Adding a line to my grub.cfg for FreeBSD would be like this:

menuentry "FreeBSD" {
set root="(hd0,msdos1,bsd1)"
kfreebsd /boot/loader
}

I don't have that line in there yet, but I doubt it would take it.
Even setting aside a BIOS boot partition (ef02) or extlinux doesn't even get noticed by grub.

Last edited by nomorewindows (2014-01-21 18:31:45)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#2 2014-01-21 18:31:28

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,548

Re: Can't install grub2 with presence of ufs2 partitions [Solved]

I dd'd FreeBSD's protective MBR, and saved into a file.  I ran qemu -kernel memdisk -initrd freebsd.mbr /dev/sda and it booted.  So then how do I get it into syslinux?  I already had a chainload from OpenBSD, so I modified it slightly to use the FreeBSD's MBR from the file.

LABEL FreeBSD
MENU LABEL FreeBSD
COM32 chain.c32
APPEND file=../freebsd.mbr

Marking this as a new workaround to GPT/BIOS/FreeBSD with syslinux.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB