You might have read that you can recover the root password in OpenBSD through single user mode because it gives you root access automaticly. That isn't secure enough for me, so edit /etc/ttys(5) and change the console from secure to insecure. Remember your password though. There is no way to recover it if you lock yourself out of single user mode.
To do this you must add a line in /etc/gettytab(5). Change the current section:
P|Pc|Pc console:\
:np:sp#9600:
adding the line ":cl=\E[H\E[2J:" at the end, so that it ends up looking like this:
P|Pc|Pc console:\
:np:sp#9600:\
:cl=\E[H\E[2J:
#:/home> cd /
#:/> sudo config -e -o bsd.new bsd
OpenBSD 3.2 (GENERIC) #25: Thu Oct 03 22:06:37 CDT 2002
deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
Enter 'help' for information
ukc> nmbclust 8192
nmbclusters = 8192
ukc> quit
Saving modified kernel.
#:/> sudo cp bsd bsd.old && sudo mv bsd.new bsd
#:/> sudo reboot
tech specs:
-----------
- Duron 1.1Ghz
- 512MB of Micron RAM
- 2 identical IBM 40GB IDE ATA100 hard disks (resp. wd0 and wd1). Each sitting
on its own IDE channel as primary.
- dc NIC
- system = openbsd 3.1 -release
goals:
------
- maximise throughput by setting swap and /tmp as RAID 0 partitions
- continued service in degraded mode for /, /usr, /var, /home if one disk fails
with RAID 1
steps:
------
- step 1:
installed three disks on the server: wd0 and wd1 (see above). wd2 (a Seagate
Barracuda 10GB UDMA 4) as secondary slave. wd2 has been used initially for the
operating system to prepare the raid sets and dump openbsd to the raid devices.
after this, wd2 should be removed.
- step 2:
installed openbsd 3.1 -release on wd2 then booted with:
boot> boot wd2a:/bsd
- step 3:
compiled a custom kernel with:
pseudo-device raid 4
option RAID_AUTOCONFIG
option DUMMY_NOPS
option NMBCLUSTERS=8192
option BUFCACHEPERCENT=35
commented:
option I386_CPU
option I486_CPU
option I586_CPU
option XSERVER
option APERTURE
option COMPAT_SVR4
option COMPAT_IBCS2
option COMPAT_BSDOS
rebooted with new kernel.
- step 4:
used disklabel on wd0 and wd1. disklabel -E wd0c and then exported wd0c's
disklabel to wd1c (disklabel -R). setup:
wd[01]a 50M 4.2BSD
wd[01]d 1G 4.2BSD
wd[01]e 36.7G RAID (will hold /, /usr, /var, /home)
wd[01]f 1G RAID (will hold swap and /tmp)
the wd[01]a partitions will serve to hold the kernel and 'boot' as written in
the raidctl(8) manpage:
1. wd0a - a small partition, which contains a complete, bootable, basic OpenBSD installation. 2. wd1a - also contains a complete, bootable, basic OpenBSD installa- tion.wd[01]d is a lame workaround for a weird problem I stumbled upon while using raidctl. If I don't create this partition (which doesn't serve any particular purpose), I am greeted with the following error when initialising the raid devices (raidctl -I, raidctl -i): metapod# raidctl -I 1234561 raid1 Aug 3 03:42:45 metapod /bsd: raid1: disk label I/O error Aug 3 03:42:45 metapod /bsd: raid1: disk label I/O error - step 5: created /etc/raid0.conf: START array 1 2 0 START disks /dev/wd0e /dev/wd1e START layout 128 1 1 1 START queue fifo 100 - step 6: raid0 init: raidctl -C raid0.conf raid0 raidctl -I 4563210 raid0 raidctl -iv raid0 - step 7: disklabel -E raid0c: raid0d 512M 4.2BSD (/) raid0e 7.5G 4.2BSD (/usr) raid0f 7.5G 4.2BSD (/var) raid0h 21.5G 4.2BSD (/home) - step 8: newfs: newfs -c 32 -b 65536 -f 8192 /dev/rraid0[defh] newfs /dev/rwd[01]a - step 9: mounted filesystems: mount /dev/raid0d /r mount /dev/raid0e /r/usr mount /dev/raid0f /r/var mount /dev/raid0h /r/home mount /dev/wd0a /r/kernel0 mount /dev/wd1a /r/kernel1 - step 10: dump wd2 data (/bin, /etc, /sbin, /usr, ...etc) to the new RAID partitions: cd /bin; dump 0f - . | (cd /r; restore -rf -) ... - step 12: copied /bsd, /bsd.orig (default kernel) and /boot to /r/kernel0 and /r/kernel1. Don't know if this is correct to have a working basic installation as said in the quoted part of the raidctl manpage (see above). - step 13: installboot on wd0a and wd1a -step 14: created /etc/raid1.conf: START array 1 2 0 START disks /dev/wd0f /dev/wd1f START layout 64 1 1 1 START queue fifo 100 - step 15: see step 6. used another serial number for raid1. - step 16: disklabel -E raid1c: raid1b 512M swap raid1d 512M 4.2BSD (/tmp) - step 17: newfs: newfs -c 32 -b 65536 -f 8192 /dev/rraid1d - step 18: raid activation: raidctl -A root raid0 raidctl -A yes raid1 - step 19: modified /r/etc/fstab to reflect the new mount points - step 20: sync; halt - step 21: removed wd2 and booted read the thread I've started few weeks ago. it shows you exactly how to do this. the only thing that's missing is the correct way to install the boot block in wd0a and wd1a. the thread ref is here: http://marc.theaimsgroup.com/?l=openbsd-misc&m=102973585503213&w=2 The correct installboot commands are as follows: ./installboot -v /r/kernel0/boot ./biosboot wd0 ./installboot -v /r/kernel1/boot ./biosboot wd1 /r/kernel[01] are mount points for /dev/wd[01]a.