Boot OpenBSD and NetBSD from Grub2

OpenBSD and NetBSD are two popular BSD operating systems. You can boot, install OpenBSD and NetBSD from Grub2 without losing data.

The way to do it here is similar to how to do it with FreeBSD. We also use Partition Image Mapper to avoid data loss. Please refer to the related articles for more details.

Boot OpenBSD and NetBSD from Grub2

Download

First we will download OpenBSD and NetBSD. Note that you need to download the images of its USB. The OpenBSD disk image is named installXX.fs.

Once downloaded, we will use 7-Zip to open and extract the image files of its partition. We just need to extract the largest size partition.

  • OpenBSD: 1.img
  • NetBSD: 0.img

Partition Image Mapper

Partition Image Mapper is part of AIO Boot. We will use this tool to MAP the partition image above as the real partition.

  1. Rename, copy the above partition image files to the AIO Boot drive.
  2. Copy PartIMGMapper.exe to another drive (eg C :).
  3. Run PartIMGMapper.exe
    OpenBSD and NetBSD

    1. Select Grub2.img in the first row. This is the partition image of Grub2. We will use Grub2 to boot into OpenBSD and NetBSD.
    2. Select the partition image file that you copied in step 1.
    3. In the Type section, select the corresponding format.
  4. Click the MAP button to use the images above as a real partition.
  5. The tool will back up the partition table information for later restoration. The file has .MBR extension in the same directory as PartIMGMapper.exe.
  6. Once used, run PartIMGMapper.exe, click UNMAP and select the previously backed up MBR file. All data and partitions will be restored as before.

Grub2

This is the Grub2 menu for those who want to do it manually.

OpenBSD:

menuentry "OpenBSD" {
	set root=hd0,msdos2
	kopenbsd /bsd
}

NetBSD:

menuentry "NetBSD" {
	set root=hd0,msdos2
	knetbsd /netbsd
	insmod regexp
	knetbsd_module_elf /*/installation/miniroot/miniroot.kmod
}

This also works for other BSD operating systems based on OpenBSD and NetBSD. Wish success!

Share this...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on PinterestShare on RedditShare on TumblrShare on VKBuffer this pageDigg thisEmail this to someone
Flattr the authorPrint this pageShare on StumbleUponShare on Yummly