Next: DOS/Windows, Previous: GNU/Linux, Up: Some caveats on OS-specific issues [Contents][Index]

#### 5.4.3 NetBSD

Booting a NetBSD kernel from GRUB is also relatively easy: first set GRUB’s root device, then load the kernel and the modules, and finally run `boot`.

1. Set GRUB’s root device to the partition holding the NetBSD root file system. For a disk with a NetBSD disk label, this is usually the first partition (a:). In that case, and assuming that the partition is on the first hard disk, set GRUB’s root device as follows:

       grub> insmod part_bsd
       grub> set root=(hd0,netbsd1)

   For a disk with a GUID Partition Table (GPT), and assuming that the NetBSD root partition is the third GPT partition, do this:

       grub> insmod part_gpt
       grub> set root=(hd0,gpt3)

2. Load the kernel using the command `knetbsd`:

       grub> knetbsd /netbsd

   Various options may be given to `knetbsd`. These options are, for the most part, the same as in the NetBSD boot loader. For instance, to boot the system in single-user mode and with verbose messages, do this:

       grub> knetbsd /netbsd -s -v

3. If needed, load kernel modules with the command `knetbsd_module_elf`. A typical example is the module for the root file system:

       grub> knetbsd_module_elf /stand/amd64/6.0/modules/ffs/ffs.kmod

4. Finally, run the command `boot` (see boot).