1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do you install grub2?

Discussion in 'General' started by bigtoque, Nov 30, 2010.

  1. bigtoque

    bigtoque New Member

    Messages:
    75
    Likes Received:
    0
    After compiling grub2 from ports, I try to install grub to the bootsector with the command grub-install /dev/ad4

    and I get this:

    Code:
    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?
     
  2. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,165
    Likes Received:
    7
    "no such partition" suggests you should check /dev/. Is the drive really ad4?
     
  3. bigtoque

    bigtoque New Member

    Messages:
    75
    Likes Received:
    0
    I've got two drives (ad4 and ad6). This is what shows in /dev

    Code:
    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.
     
  4. Nukama

    Nukama Member

    Messages:
    129
    Likes Received:
    0
    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 /boot?

    What kind is this Windows 7 boot partition?
    gpart show ad4

    Uhh, and what is burg?
     
  5. UNIXgod

    UNIXgod New Member

    Messages:
    1,089
    Likes Received:
    0
    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
     
  6. bigtoque

    bigtoque New Member

    Messages:
    75
    Likes Received:
    0
    FreeBSD was setup with the default settings.
    Code:
    ad4s3a /
    ad4s3b swap
    ad4s3d /var
    ad4s3e /tmp
    ad4s3f /usr

    The Windows 7 boot partition is NTFS.

    If I type gpart show ad4, I get
    Code:
    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)
     
  7. cucu007

    cucu007 New Member

    Messages:
    46
    Likes Received:
    0
    I am searching for answers too, it looks like grub2 have some nifty thing to get it going. I am still trying without success.
     
  8. gour

    gour New Member

    Messages:
    29
    Likes Received:
    0
    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?
     
  9. hedwards

    hedwards New Member

    Messages:
    189
    Likes Received:
    0
  10. UNIXgod

    UNIXgod New Member

    Messages:
    1,089
    Likes Received:
    0
    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).
     
  11. hedwards

    hedwards New Member

    Messages:
    189
    Likes Received:
    0
    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.
     
  12. gour

    gour New Member

    Messages:
    29
    Likes Received:
    0

    The above might be option in my case - having more than one xyz-BSD, but gag is so ugly. :pP
     
  13. UNIXgod

    UNIXgod New Member

    Messages:
    1,089
    Likes Received:
    0
    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.
     
  14. Beeblebrox

    Beeblebrox Member

    Messages:
    868
    Likes Received:
    1
    Try breaking the grub commands down - what is grub-probe saying?
    # grub-probe -dv /dev/ad4
    It could also be a device.map problem. After a rename or delete on the file, try running your commands again.