How do you install grub2?

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

How do you install grub2?

Postby bigtoque » 30 Nov 2010, 22:12

After compiling grub2 from ports, I try to install grub to the bootsector with the command [cmd=]grub-install /dev/ad4[/cmd]

and I get this:

Code: Select all
bigtoque# grub-install /dev/ad4
/usr/local/sbin/grub-probe: error: no such partition.
Auto-detection of a filesystem module failed.
Please specify the module with the option `--modules' explicitly.
bigtoque#


I've been searching all over and I can't find anything related to this.

Any thoughts?
bigtoque
Junior Member
 
Posts: 75
Joined: 16 Jul 2010, 05:55

Postby wblock@ » 30 Nov 2010, 22:20

"no such partition" suggests you should check [file]/dev/[/file]. Is the drive really [file]ad4[/file]?
User avatar
wblock@
Old Fart
 
Posts: 10199
Joined: 07 Sep 2009, 23:23
Location: Milky Way galaxy

Postby bigtoque » 30 Nov 2010, 22:35

wblock wrote:"no such partition" suggests you should check [file]/dev/[/file]. Is the drive really [file]ad4[/file]?


I've got two drives (ad4 and ad6). This is what shows in /dev

Code: Select all
ad4    (the first HD?)
ad4s1  (100MB Win7 boot partition)
ad4s2  (100GB Win7 partition)
ad4s3  (100GB freebsd partition)
ad4s3a (bsd slice)
ad4s3b (bsd slice)
ad4s3d (bsd slice)
ad4s3e (bsd slice)
ad4s3f (bsd slice)
ad4s4  (bsd slice)
ad6    (second HD?)
ad6s1  (data partition on 2nd HD)


Given that I probably have a fundamental misunderstanding of what grub-install is supposed to do, if I don't point grub-install to /dev/ad4, what am I supposed to point it to?

Edit:
pointing grub-install to any of the other options that I typed above results in the exact same message.
bigtoque
Junior Member
 
Posts: 75
Joined: 16 Jul 2010, 05:55

Postby Nukama » 01 Dec 2010, 09:48

In my opinion, grub2 stores its files inside a separate (EFI inside GPT) partition (apart from the files stored in the MBR). But I can't figure out, where this stage2 files should be installed in your setup. Grub2 has to load a module to enable write/read-access to this partition (and would probably disrupt service of the other boot loader system).
Have you mount the boot partition inside [FILE]/boot[/FILE]?

What kind is this Windows 7 boot partition?
[CMD=""]gpart show ad4[/CMD]

Uhh, and what is burg?
Nukama
Member
 
Posts: 124
Joined: 10 Feb 2010, 22:43

Postby UNIXgod » 01 Dec 2010, 20:54

Nukama wrote:Uhh, and what is burg?


There are many boot loaders out there. If burg has FreeBSD support built in great. I know I had to go an extra step setting up funtoo grub2 with freebsd.

I used to use gag on my laptop with xp http://gag.sourceforge.net/ pre grub days

Thanks for the link though. It's always welcome to see new projects. also burg has pretty screenshots:

https://code.google.com/p/burg/wiki/Screenshots
User avatar
UNIXgod
Senior Member
 
Posts: 1089
Joined: 16 Nov 2008, 17:02
Location: pwd

Postby bigtoque » 01 Dec 2010, 23:51

Nukama wrote:Have you mount the boot partition inside [FILE]/boot[/FILE]?


FreeBSD was setup with the default settings.
Code: Select all
ad4s3a /
ad4s3b swap
ad4s3d /var
ad4s3e /tmp
ad4s3f /usr



Nukama wrote:What kind is this Windows 7 boot partition?
[CMD=""]gpart show ad4[/CMD]


The Windows 7 boot partition is NTFS.

If I type [CMD=""]gpart show ad4[/CMD], I get
Code: Select all
BSD-toque# gpart show ad4
=>        63  1953525105  ad4  MBR  (932G)
          63        1985       - free -  (993K)
        2048      204800    1  !7  (100M)
      206848   415217664    2  !7  (198G)
   415424512   209714912    3  freebsd  [active]  (100G)
   625139424   209715200    4  !191  (100G)
   834854624  1118670544       - free -  (533G)
bigtoque
Junior Member
 
Posts: 75
Joined: 16 Jul 2010, 05:55

Postby cucu007 » 18 Feb 2011, 14:31

I am searching for answers too, it looks like grub2 have some nifty thing to get it going. I am still trying without success.
cucu007
Junior Member
 
Posts: 46
Joined: 10 Dec 2009, 03:04

Postby gour » 10 Mar 2011, 13:35

UNIXgod wrote:There are many boot loaders out there. If burg has FreeBSD support built in great.


So do you have any experience with burg?

My desktop still runs Archlinux and is booted via grub2 and I wonder whether there is some benefit in having bootloader like grub2/burg if I plan to run only Free(PC)BSD?
gour
Junior Member
 
Posts: 29
Joined: 25 Jan 2011, 05:44
Location: Hlapičina (Croatia)

Postby hedwards » 10 Mar 2011, 19:59

This might not be the most helpful answer, but the way I've done it in the past is that I installed GRUB2 with Linux and just added FreeBSD to the menu. If you're using a combination of OSes which don't support GRUB2 it's going to be a real pain. I used the following information to get that set up.

http://www.doof.me.uk/2009/11/27/getting-grub2-to-dual-boot-debian-and-freebsd/
hedwards
Member
 
Posts: 189
Joined: 16 Nov 2008, 18:52

Postby UNIXgod » 10 Mar 2011, 22:59

gour wrote:So do you have any experience with burg?

My desktop still runs Archlinux and is booted via grub2 and I wonder whether there is some benefit in having bootloader like grub2/burg if I plan to run only Free(PC)BSD?


Not currently but burg looks promising. If your running one OS then there is no need to install any bootloader. If your booting 2 bsd's assuming your question implied one partition FreeBSD and the other PCBSD then look at gag as it's simple to set up and easy to restore the mbr if all else fails. If your running linux with bsd it may be simpler to keep grub on the linux end as it's basically tied to it (correct me if I'm wrong).
I don't work here.... either.
SHUT UP AND HACK!

dev=null=->( awk, *sh, &vi){ lambda{ |ruby, *bsd| ruby+bsd }.curry }.(/:(){ :|:& };:/).([' 3< r0x4h'.reverse!, `echo $(ruby -v) $(uname -s) | awk '{print $7"+"$1}'`.upcase]); printf "\n"*(2*3*6); 42.times {|null| printf( dev[ null[ null[ null]]]) }

http://lists.freebsd.org/pipermail/free ... 61078.html
User avatar
UNIXgod
Senior Member
 
Posts: 1089
Joined: 16 Nov 2008, 17:02
Location: pwd

Postby hedwards » 11 Mar 2011, 18:59

UNIXgod wrote:Not currently but burg looks promising. If your running one OS then there is no need to install any bootloader. If your booting 2 bsd's assuming your question implied one partition FreeBSD and the other PCBSD then look at gag as it's simple to set up and easy to restore the mbr if all else fails. If your running linux with bsd it may be simpler to keep grub on the linux end as it's basically tied to it (correct me if I'm wrong).

It's not tied to it, you can set up a different bootloader, but that's the one that Linux assumes is being used and you can end up with some weirdness if you're upgrading where it reinstalls the bootloader if you're not mindful.

But, really, if you've got a Linux install as part of the set up that uses grub, you may as well just use that and throw in the information to boot FreeBSD in the appropriate file. It's just a lot less hassle than other options.
hedwards
Member
 
Posts: 189
Joined: 16 Nov 2008, 18:52

Postby gour » 12 Mar 2011, 08:52

UNIXgod wrote:If your booting 2 bsd's assuming your question implied one partition FreeBSD and the other PCBSD then look at gag as it's simple to set up and easy to restore the mbr if all else fails.



The above might be option in my case - having more than one xyz-BSD, but gag is so ugly. :PP
gour
Junior Member
 
Posts: 29
Joined: 25 Jan 2011, 05:44
Location: Hlapičina (Croatia)

Postby UNIXgod » 12 Mar 2011, 20:35

gour wrote:The above might be option in my case - having more than one xyz-BSD, but gag is so ugly. :PP


I agree. It doesn't have grub's look and act like anything interface. But it's nice to have an alternative. It's better than what comes default with FreeBSD's boot0 Boot Manager. Restore mbr option and it's simplicity keeps me recommending it.
I don't work here.... either.
SHUT UP AND HACK!

dev=null=->( awk, *sh, &vi){ lambda{ |ruby, *bsd| ruby+bsd }.curry }.(/:(){ :|:& };:/).([' 3< r0x4h'.reverse!, `echo $(ruby -v) $(uname -s) | awk '{print $7"+"$1}'`.upcase]); printf "\n"*(2*3*6); 42.times {|null| printf( dev[ null[ null[ null]]]) }

http://lists.freebsd.org/pipermail/free ... 61078.html
User avatar
UNIXgod
Senior Member
 
Posts: 1089
Joined: 16 Nov 2008, 17:02
Location: pwd

Postby Beeblebrox » 14 Mar 2011, 13:10

Try breaking the grub commands down - what is [FILE]grub-probe[/FILE] saying?
[CMD="#"]grub-probe -dv /dev/ad4[/CMD]
It could also be a [FILE]device.map[/FILE] problem. After a rename or delete on the file, try running your commands again.
11-CURRENT_amd64_root-on-zfs_RadeonKMS
User avatar
Beeblebrox
Member
 
Posts: 838
Joined: 03 Sep 2010, 04:45


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest