File:  [NetBSD Developer Wiki] / wikisrc / grub2.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Fri Apr 10 16:24:15 2020 UTC (3 months ago) by gutteridge
Branches: MAIN
CVS tags: HEAD
Grammar fixes

    1: # How to install GRUB2 on NetBSD
    2: 
    3: This how-to explains the steps needed to install GRUB2 on an existing i386/AMD64
    4: NetBSD installation. The steps should work on a properly chroot'ed system too.
    5: Tested on NetBSD 6.0 AMD64:
    6: 
    7: First of all, either download the package, using `pkgin install grub2`, or build 
    8: it yourself from package sources (`/usr/pkgsrc/sysutils/grub2`).
    9: 
   10: After that, generate a GRUB configuration file, which tells GRUB the positions 
   11: of the operating system(s). The following command will generate such a file, 
   12: while adding your NetBSD system into its list.
   13: 
   14:     # grub-mkconfig -o /grub/grub.cfg
   15: 
   16: Now, install GRUB into your hard drive's master boot record (MBR).
   17: You have to know its device name for this step (e.g. `/dev/rwd0a`).
   18: Exchange `/dev/rwd0a` with your desired device name, then change `/dev/rXXXa` 
   19: to `/dev/rwXXXd` to access the raw disk, as in the following example:
   20: 
   21:     Device name :   /dev/rwd0a
   22:     Direct access : /dev/rwd0d
   23: 
   24: The appropriate `grub-install` command for this drive would be:
   25: 
   26:     # grub-install --no-floppy /dev/rwd0d
   27: 
   28: Hopefully, it should return : `Installation finished. No error reported.`
   29: If it does so, simply reboot the system and you should be greeted by a nice
   30: OS-selector.
   31: If not, recheck your device names, if that doesn't fix it, search the web for 
   32: the error message.
   33: Even though there aren't that many resources about *GRUB on NetBSD*, you'll
   34: find a lot of information at GNU/Linux-related sites which apply to this 
   35: scenario as well.

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb