NetBSD installation without sysinst

suits for ext2fs and use-cases not designed by the installer

get to the prompt

boot your prefered NetBSD install media and exit sysinst

language : english
exit install system

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
dmesg | grep '] ld'

disk=xbd0
disk=ld0

cdrom=xbd1
cdrom=cd0

dos partitions

x86

initialize the MBR and make an empty DOS partition table

dd if=/usr/mdec/mbr_com0 of=/dev/rld0d

create the first partition using the whole disk (offset: sector 63)

fdisk -u -0 $disk

(defaults & empty boot menu disables it)

Should we write new partition table? [n] y

make the first partition ‘active’ and check

fdisk -a -0 $disk

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

bsd partitions

On all hardware plateforms, create a disk label,

disklabel -i $disk

E -- print disk label and current partition table
e -- unused 0 0
a

Filesystem type [unused]: 4.2BSD --or-- Linux Ext2
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,

P -- print current partition table
W
Q

(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
newfs_ext2fs /dev/r${disk}a

mount /dev/${disk}a /mnt
mount_ext2fs -o rw /dev/${disk}a /mnt

install media

–either– by cdrom

mount the install media

mount_cd9660 /dev/${cdrom}a /mnt2

cd /mnt2/amd64/binary/sets

–or– an nfs share

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

cd /mnt2/

–or– from ftp

cd /mnt/
ifconfig vioif0 192.168.122.9/24 up
ftp 192.168.122.1

bin
cd /data/kernels
get netbsd100.pfaltq
cd /data/netbsd100/
prompt
mget *

^D

deploy

finally proceed with the installation

#tar xvzphfe kern-GENERIC.tgz -C /mnt
#tar xvzphfe kern-GENERIC.MP.tgz -C /mnt
mv netbsd100.pfaltq netbsd

for set in base comp etc man misc modules text; do
    echo -n $set...
    tar xJpf $set.tar.xz -C /mnt && echo done
done; unset set
#tar xzphfe
# tests

rm -f *.tar.xz

install the boot loader

on sparc

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

note - no timeout option available on sparc note - third argument needed

on x86

cp -i /usr/mdec/boot /mnt/

# ffsv1 vs. ffsv2
dumpfs -s /dev/r${disk}a | grep ^format

ls -lhF /usr/mdec/bootxx*
installboot -v -m amd64 -o console=com0,speed=115200,timeout=3 /dev/r${disk}a /usr/mdec/bootxx_ffsv2
installboot -v -m amd64 -o console=com0,speed=115200,timeout=3 /dev/r${disk}a /usr/mdec/bootxx_ext2fs

chroot within

using vi in the chrooted environment

generate the device files

chroot /mnt
cd dev/
./MAKEDEV all

further configure the system

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

for kvm

. /etc/defaults/rc.conf
rc_configured=yes
wscons=no

#no_swap=yes
#savecore=no

grep on /etc/ttys
# ==> no ttyE*

for bare-metal

wscons=yes

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/
ls -lF fstab # no exist
cat > fstab <<EOF
/dev/ld0a   /   ffs rw,log      1 1
#/dev/ld0a  /   ext2fs  rw,async    1 1
#/dev/ld0b  none    swap    sw      0 0
EOF

note - add /kern if you want kernfs

exit the chroot, finish up and reboot

^D
cd /
umount /mnt
umount /mnt2
#reboot
halt -p

resources

Appendix B. Installing without sysinst http://www.nibel.net/nbsdeng/ap-inst.html

fdisk – MS-DOS partition maintenance program http://netbsd.gw.com/cgi-bin/man-cgi?fdisk++NetBSD-current

disklabel – read and write disk pack label http://netbsd.gw.com/cgi-bin/man-cgi?disklabel++NetBSD-current


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun