NetBSD installation without sysinst

Get to the prompt

Boot with your prefered NetBSD install media, choose language, keyboard and exit sysinst,

language : english
keyboard : your keyboard layout

Note. if you ever wish to return to sysinst, no need to (re)execute it. Simply exit the shell or type sysinst.

And define a handy variable for the purpose of this guide,

dmesg | grep ^wd
dmesg | grep ^sd
dmesg | grep ^xbd


DOS partitions

On i386 or amd64, you need to configure the MBR and DOS kind of partition table.

Initialize the MBR and make an empty DOS partition table,

fdisk -i $disk

Update the bootcode from /usr/mdec/mbr? [n] y
Should we write new partition table? [n] y

Create the first partition using the whole disk (offset: sector 63), make the first partition ‘active’ and check,

fdisk -u -0 $disk

(defaults // empty boot menu disables it)
Should we write new partition table? [n] y

fdisk -a -0 $disk

active partition: [0..4 default: 0] 
Are you happy with this choice? [n] y
Should we write new partition table? [n] y

fdisk $disk

BSD partitions

On all hardware plateforms, create a disk label,

disklabel -i $disk

Filesystem type [unused]: 4.2BSD
Start offset ('x' to start after partition 'x') [0c, 0s, 0M]: 63
Partition size ('$' for all remaining) [0c, 0s, 0M]: $

verify, write the label and quit,



(Optional) On i386 or amd64, enable swap straight away,

#swapctl -a /dev/sd0b
#swapctl -l

On all hardware plateforms, make an FFS file system and mount the root partition,

newfs /dev/r${disk}a
cd /
mount /dev/${disk}a mnt/

Mount the install media,

mkdir /cdrom
mount_cd9660 /dev/${cdrom}a /cdrom

Note. mount_cd9660 prefers absolute path destination, which is not the case for mount_ffs or mount the NFS share,

mount -t nfs x.x.x.x:/var/data/netbsd61sparc mnt2

And proceed with the installation,

cd /cdrom/amd64/binary/sets
#cd /mnt2/
tar xvzphfe kern-GENERIC.tgz -C /mnt
#tar xvzphfe kern-GENERIC.MP.tgz -C /mnt
tar xvzphfe modules.tgz -C /mnt
for set in base comp etc man misc tests text; do
    echo -n $set...
    tar xzphfe $set.tgz -C /mnt && echo done
done; unset set

Note. on sparc, kern-GENERIC.MP works for both, single and multi-cpu.

Install the boot loader, on sparc,

cp /usr/mdec/boot /mnt/
installboot -v /dev/rsd0a /usr/mdec/bootxx /boot

On i386 or amd64,

cp /usr/mdec/boot /mnt
dumpfs -s /dev/rwd0a | grep ^format
installboot -v -o timeout=3 /dev/rwd0a /usr/mdec/bootxx_ffsv1

Generate the device files,

chroot /mnt
cd dev

Further configure the system (using vi in the chrooted environment),

cd /etc
#ln -sf ../usr/share/zoneinfo/Europe/Paris localtime
ln -sf ../usr/share/zoneinfo/Europe/Moscow localtime
vi rc.conf


For a XEN guest,


cat /etc/ttys #fine already

For a normal system,


and eventually fix the wscons keyboard layout,

cd /etc/
cp wscons.conf wscons.conf.dist
vi wscons.conf

#encoding fr

Don’t forget to setup the fstab (using vi in the chrooted environment),

cd /etc/
cat > fstab <<EOF9
/dev/${disk}a   /   ffs rw,log  1 1
#/dev/sd0b  none    swap    sw  0 0

Note. add /kern if you want kernfs

Exit the chroot, finish up and reboot,

umount /mnt
umount /cdrom
#halt -p