FreeBSD does not start on a triple boot with Grub2

Installing and upgrading FreeBSD.

FreeBSD does not start on a triple boot with Grub2

Postby Halberdier » 03 May 2011, 13:09

Hello everybody,

I would like to experiment with FreeBSD. As I already have a dual booted machine (Ubuntu 10.10 and Windows XP) with plenty of disk space, I attempted a triple boot. First, I prepared the [FILE].img[/FILE] on a USB flash. As I messed up with [FILE]dd[/FILE] from Linux, I used Image Writer from Windows XP. Then, I booted from the flash and Synopsis worked properly. When creating the partition, I refused the default geometry, and Synopsis detected the CHS combination matching with that showed by GParted in Linux. Having 300G for Linux and 100G for Windows, I allocated 100G to FreeBSD, then I clicked on A for automatic partition usage. I didn't install the FreeBSD boot manager, as I wanted to continue using Grub2.

At this point, I had warnings on all the four partitions (Linux, Windows, FreeBSD and Swap), stating that they don't start on a disk sector. The installation went on to completion, though. Now I went back on Linux. On GParted the FreeBSD partition shows as unknown. I edited the [FILE]/etc/grub.d/40_custom[/FILE] file by adding the following lines:

Code: Select all
menuentry "FreeBSD 8.2 - RELEASE amd64" {
set root=(hd0,msdos4)
chainloader +1
}


I used msdos4 mimicking the syntax that GRUB already used for the other systems, considering the partitions as numbered 1 to 4. Finally I updated [FILE]grub.cfg[/FILE] with [FILE]update-grub[/FILE]. When selecting FreeBSD from GRUB, it does not start, with a generic error message.

I think this post is long enough for now. I will add details later, as I don't know at the moment what could be useful for the experts. Thank you all in advance for your attention.
Halberdier
Junior Member
 
Posts: 15
Joined: 03 May 2011, 12:31
Location: Italy

Postby ahavatar » 03 May 2011, 13:23

Check if the FreeBSD partition is indeed the 4th partition, in other words, on GParted running on Linux, it should be "[FILE]/dev/sda4[/FILE]"

And in my case, I use [FILE](hd0,4)[/FILE] instead of [FILE](hd0,msdos4)[/FILE]. I don't know if [FILE](hd0,4)[/FILE] is same as [FILE](hd0,msdos4)[/FILE].
ahavatar
Member
 
Posts: 196
Joined: 06 Sep 2010, 21:13

Postby Halberdier » 03 May 2011, 13:48

Thank you for your prompt reply. FreeBSD is actually "[FILE]/dev/sda4[/FILE]" on GParted. I used [FILE]msdos4[/FILE], as the automatically detected boots in GRUB were compiled as [FILE](hd0,msdos1)[/FILE] for [FILE]/dev/sda1[/FILE] (Ububntu) and [FILE](hd0,msdos2)[/FILE] for [FILE]/dev/sda2[/FILE] (Windows). However, I'll try later with [FILE](hd0,4)[/FILE], to be sure.

(I am now at work, the system we are talking about is at home).
Halberdier
Junior Member
 
Posts: 15
Joined: 03 May 2011, 12:31
Location: Italy

Postby francis » 03 May 2011, 17:38

As always - I recommended a great utility; EasyBCD. It is useful especially for booting Un*x-like systems and Windows. I think that, this program is usefull for beginners.
Have fun in experimenting with FreeBSD!
[color="DarkSlateGray"]Obscurity as the foundation of Security =[/color] [color="DarkRed"]Bad[/color]
[color="SlateGray"]Obscurity in addition to Security =[/color] [color="DarkGreen"]Good[/color]
User avatar
francis
Junior Member
 
Posts: 90
Joined: 23 Nov 2010, 14:45

Postby Halberdier » 03 May 2011, 18:19

Thank you, I'll try it. For the record, [FILE](hd0,4)[/FILE] did not work, just the same as [FILE](hd0,msdos4)[/FILE]. The error message, immediately after the GRUB selection, is:

Code: Select all
error: not an assignment.
error: invalid signature.

Press any key to continue...
Halberdier
Junior Member
 
Posts: 15
Joined: 03 May 2011, 12:31
Location: Italy

Postby mlinuxgada » 24 Sep 2011, 07:32

Still the same problem with Grub2.
Code: Select all
error: invalid signature.

Press any key to continue...

PS:In Grub2 there's no option 'rootnoverify' ...
mlinuxgada
Junior Member
 
Posts: 8
Joined: 24 Sep 2011, 07:24

Postby mlinuxgada » 25 Sep 2011, 08:24

Fixed it. There is a bug into grub2/spec options/, with grub everything is ok.
mlinuxgada
Junior Member
 
Posts: 8
Joined: 24 Sep 2011, 07:24

Postby Halberdier » 16 Oct 2011, 11:01

Thank you all. I realized that grub2 has compatibility issues with a number of applications. I downgraded to grub for the Linux partition, then used GAG as a first stage boot loader: everything worked properly at the first attempt.
Halberdier
Junior Member
 
Posts: 15
Joined: 03 May 2011, 12:31
Location: Italy

Postby velikij » 30 May 2012, 22:06

Ubuntu (or the grub2 creators upstream) have improved OS scanning by Ubuntu 12.04. I have a system running XP, FreeBSD 8.1, and Ubuntu, and did not install a FreeBSD boot manager. Before Ubuntu 12.04, I had to create a custom [FILE]/etc/grub.d/40_custom[/FILE] file before running [FILE]update-grub[/FILE] on the Linux partition.

But now running [FILE]update-grub[/FILE] will detect my FreeBSD properly, so I was able to remove the custom file.

However I was able to use the custom file - mine looks like

Code: Select all
#!/bin/sh
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 "FreeBSD 8.1 manual by Peter" {
      set root=(hd0,3)
      chainloader +1
}

Under Ubuntu 12.04, the generated stanza for FreeBSD in [FILE]/boot/grub/grub.cfg[/FILE] is

Code: Select all
menuentry "FreeBSD 8.1-RELEASE (GENERIC) (on /dev/sda3)" --class windows --class os {
  insmod part_msdos
  insmod ufs2
  set root='(hd0,msdos3)'
  search --no-floppy --fs-uuid --set=root 4b2e8da4ae6a55e3
  drivemap -s (hd0) ${root}
  chainloader +1
}
velikij
Junior Member
 
Posts: 1
Joined: 30 May 2012, 21:11
Location: Santa Cruz, California


Return to Installing & Upgrading

Who is online

Users browsing this forum: No registered users and 0 guests