Installing NetBSD from GNU/Linux

tested on ubuntu/bionic and slackware14.2

Introduction

fsck_ext2fs has been enhanced therefore this is now possible since netbsd-current Sun Mar 31 13:16:52 2019 UTC (revs 1.36 - 1.39)

The script has been tested against XEN/PV, XEN/HVM and bare-metal.

Requirements

mkdir -p /data/kernels/netbsd9/
cd /data/kernels/netbsd9/

Get the necessary sets (no X11 required)

#remote=rsync://rsync.fr.netbsd.org/NetBSD/NetBSD-9.0/amd64
remote=rsync://mirror.os3.su/NetBSD/NetBSD-9.0/amd64

rsync -avz --delete-after --exclude 'binary/sets/x*.tar.xz' \
    $remote/ amd64/

See the PXE // NetBSD guide for tracking daily

Deploy

bare-metal

cd ~/

XEN PV or HVM

guest=netbsdext2fs

xl des $guest
rm -f /data/guests/$guest/
mkdir -p /data/guests/$guest/
cd /data/guests/$guest/

and prepare the script

wget https://pub.nethence.com/bin/bsd/netbsd.install.bash.txt
cp netbsd.install.bash.txt netbsd.install.bash
chmod +x netbsd.install.bash

point to either previously fetched current or release branch and define network parameters that will be pushed into the guest image

cat ~/.ssh/id_*.pub

mkdir $guest/
cd $guest/
vi network.conf

sets=/data/kernels/netbsd9
kernel=/data/kernels/netbsd9
#sets=/tftpboot/netbsd9/amd64/binary/sets
#kernel=/tftpboot/netbsd9/amd64/binary/kernel

pubkey="YOUR-PUBKEY-HERE"
#internal network goes to second nic
netif=xennet1
host=netbsdext2fs
cidr=x.x.x.x/xx
#may be empty
gw=x.x.x.x
#dns="208.67.222.222 208.67.222.222"
dns="62.210.16.6 62.210.16.7"

the script will mount and unmuont /mnt/ from either /dev/sda1

./netbsd.install.bash -h
#./netbsd.install.bash baremetal

or from <guest>.sparse

../netbsd.install.bash pv $guest
#../netbsd.install.bash hvm $guest

TODO

things to check

Resources

Partitioning

Disk partitioning https://en.wikipedia.org/wiki/Disk_partitioning

Partition type https://en.wikipedia.org/wiki/Partition_type

NetBSD

EXT2

GRUB

Troubleshooting


HOME | GUIDES | BENCHMARKS | html