Friday, August 19, 2011

SSH Productivity Tips for Working with Remote Servers

SSH has many features which are helpful when working regularly with files on remote servers; together they can give a vast increase in productivity over the bare use of SSH. If you regularly use SSH, it’s worth spending a little time learning about these and configuring your environment to make your life easier.

Saturday, May 3, 2008

LiveCDs & DVDs of OpenBSD 4.3-release

The Basic LiveCD has no 3rd party applications at all. An optional ISO image containing the Dillo browser is available.

The FluxBox LiveCD includes the FluxBox window manager and the Dillo browser.

The XFCE LiveCD includes the complete XFCE environment and the Dillo browser.

The KDE LiveDVD includes the complete KDE environment, including Koffice and the Konqueror browser. The i18n internationalizations are not included.

The Gnome LiveDVD includes the complete Gnome environment, including the Epiphany browser.

http://jggimi.homeip.net/

Other Live CDs

Friday, April 25, 2008

Turn on Mac mini in "server mode"

# Magic tweak to put a Mac mini in "server mode" meaning it will

# reboot after a power failure. Requires machdep.allowaperture=1
# (or better)
#
if [ -x /usr/X11R6/bin/pcitweak ]; then
/usr/X11R6/bin/pcitweak -w 00:1f:0 -b 0xa4 0x00
if [ "$(/usr/X11R6/bin/pcitweak -r 0:1f:0 -b 0xa4)" = "0x00" ]; then
echo -n ' server-mode'
fi
fi

// marc

Courtesy

Saturday, November 10, 2007

Running Linux binaries on OpenBSD Howto - example Skype

I did this on a 4.1/i386.
For other versions it would be similar however since we are going to
use the Skype Linux Binary we will need an x86 system. Linux emulation
is available only for x86 systems.

1) Enable Linux Emulation option in kernel

You will have a line

#kern.emul.linux=1 # enable running Linux binaries

in your "/etc/sysctl.conf" file. You need to uncomment it ( remove the
# in the begining ) and make it look like

kern.emul.linux=1 # enable running Linux binaries

In the next step when you install the "fedora_base-4.0p2.tgz" pakage
it will automatically enable this option temporarily in the running
kernel but if the change has to last after a reboot you need to do the edit
mentioned above in "/etc/sysctl.conf" :-)

2) Install "fedora_base-4.0p2.tgz" package.

#export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.1/packages/i386/
#pkg_add fedora_base-4.0p2.tgz

We do this to get most of the required Linux library files that the
Skype Linux Binary will need. Though their website says it is
statically linked we will soon find out that this is not the case :-(

At this point if you are more interested in details you can read

http://www.openbsd.org/cgi-bin/man.cgi?query=compat_linux&sektion=8
or
$man 8 compat_linux


3) Download the Skype Linux Binary.

====================================================
#cd /tmp
#ftp http://www.skype.com/go/getskype-linux-static
Trying 204.9.163.136...
Requesting http://www.skype.com/go/getskype-linux-static
Redirected to http://download.skype.com/linux/skype_static-1.4.0.99.tar.bz2
Trying 130.117.72.89...
Requesting http://download.skype.com/linux/skype_static-1.4.0.99.tar.bz2
0% | | 0 --:-- ETA
====================================================

After the download is over on the OpenBSD System you are working on
you need to put the files in the appropriate places.

====================================================
#pwd
/tmp
#bunzip2 skype_static-1.4.0.99.tar.bz2
#tar -xvf skype_static-1.4.0.99.tar
#mv skype_static-1.4.0.99 skype
====================================================

If you want there is a README file inside the "skype" directory now.
It explains some things other things have to be guessed :-)
So continuing our setup

====================================================
#pwd
/tmp
#mv skype /emul/linux/usr/share
#cd /emul/linux/usr/share/skype
#mv skype /emul/linux/usr/bin
#mkdir /emul/linux/etc/skype
#mv skype.conf /emul/linux/etc/skype
====================================================

Now at this point if you start skype it will give an error.

====================================================
$ /emul/linux/usr/bin/skype
/emul/linux/usr/bin/skype: error while loading shared libraries:
libasound.so.2: cannot open shared object file: No such file or
directory
====================================================

So now investigating this problem we will find that

1) Skype Linux Binary is not fully statically linked as their website says
2) Even the "fedora_base-4.0p2.tgz" package we installed earlier does
not provide all the library files required to run skype.

====================================================
$ ldd /emul/linux/usr/bin/skype
/emul/linux/usr/bin/skype:
libasound.so.2 => not found
librt.so.1 => /lib/librt.so.1 (0x48874000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x5635f000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4ef0a000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x4f700000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x4960d000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x4b7ad000)
libXfixes.so.3 => /usr/X11R6/lib/libXfixes.so.3 (0x4f1c4000)
libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x4cd49000)
libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0x4c147000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x4b546000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x4b22b000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4dee6000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x53161000)
libdl.so.2 => /lib/libdl.so.2 (0x4f1b9000)
libpthread.so.0 => /lib/libpthread.so.0 (0x514e9000)
libsigc-2.0.so.0 => not found
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x56a43000)
libm.so.6 => /lib/libm.so.6 (0x5171b000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x50840000)
libc.so.6 => /lib/libc.so.6 (0x55057000)
/lib/ld-linux.so.2 (0x53a9e000)
libz.so.1 => /usr/lib/libz.so.1 (0x51f77000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x52c4d000)
$ ldd /emul/linux/usr/bin/skype |grep not
libasound.so.2 => not found
libsigc-2.0.so.0 => not found
$
====================================================

So "libasound.so.2" and "libsigc-2.0.so.0" are not in the OpenBSD system.

We can get it from any recent Linux System.
I used my Debian Etch. Martynas Venckus also provided me with the files.
If you have no access to a Linux system I can send the files to you :-)

Now on the Linux System we check for these libraries.

====================================================
$ ssh root at 172.16.2.0
root at 172.16.2.0's password:
# cat /proc/version
Linux version 2.6.18-5-686 (Debian 2.6.18.dfsg.1-13etch2)
(dannf at debian.org) (gcc version 4.1.2 20061115 (prerelease) (Debian
4.1.1-21)) #1 SMP Thu Aug 30 02:19:07 UTC 2007

#locate libasound.so.2
/usr/lib/libasound.so.2
/usr/lib/libasound.so.2.0.0

# file /usr/lib/libasound.so.2
/usr/lib/libasound.so.2: symbolic link to `libasound.so.2.0.0'
#ls -l /usr/lib/libasound.so.2
lrwxrwxrwx 1 root root 18 2007-03-12 15:13 /usr/lib/libasound.so.2 ->
libasound.so.2.0.0

# locate libsigc-2.0.so.0
/usr/lib/libsigc-2.0.so.0
/usr/lib/libsigc-2.0.so.0.0.0

# file /usr/lib/libsigc-2.0.so.0
/usr/lib/libsigc-2.0.so.0: symbolic link to `libsigc-2.0.so.0.0.0'
# ls -l /usr/lib/libsigc-2.0.so.0
lrwxrwxrwx 1 root root 20 2006-11-02 11:45 /usr/lib/libsigc-2.0.so.0
-> libsigc-2.0.so.0.0.0
====================================================

so we find that "libasound.so.2" and "libsigc-2.0.so.0" are actualy
symbolic links to "libasound.so.2.0.0" and "libsigc-2.0.so.0.0.0"
respectively.

We then need to get the actual files "libasound.so.2.0.0" and
"libsigc-2.0.so.0.0.0" to our OpenBSD system.

So on the OpenBSD system you can use scp to fetch these files from the
Linux System to "/emul/linux/usr/lib" and create appropriate symbolic
links

====================================================
# cd /emul/linux/usr/lib
# scp root at 172.16.2.0:/usr/lib/libasound.so.2.0.0 .
root at 172.16.2.0's password:
libasound.so.2.0.0 100% 766KB 765.6KB/s 00:00
# scp root at 172.16.2.0:/usr/lib/libsigc-2.0.so.0.0.0 .
root at 172.16.2.0's password:
libsigc-2.0.so.0.0.0 100% 18KB 18.2KB/s 00:00
#ln -s libasound.so.2.0.0 libasound.so.2
#ln -s libsigc-2.0.so.0.0.0 libsigc-2.0.so.0
====================================================

Now Checking if everything is fine again on the OpenBSD system

====================================================

$ ldd /emul/linux/usr/bin/skype
/emul/linux/usr/bin/skype:
libasound.so.2 => /usr/lib/libasound.so.2 (0x502c4000)
librt.so.1 => /lib/librt.so.1 (0x537c0000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x53f81000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4c089000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x56bb5000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x4c7db000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x4fde0000)
libXfixes.so.3 => /usr/X11R6/lib/libXfixes.so.3 (0x50a47000)
libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x518ac000)
libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0x4caaf000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x4c494000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x52b3c000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x521a1000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x49204000)
libdl.so.2 => /lib/libdl.so.2 (0x56cdc000)
libpthread.so.0 => /lib/libpthread.so.0 (0x573c6000)
libsigc-2.0.so.0 => /usr/lib/libsigc-2.0.so.0 (0x57c6f000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x4c5b6000)
libm.so.6 => /lib/libm.so.6 (0x4b201000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4cfcb000)
libc.so.6 => /lib/libc.so.6 (0x578f3000)
/lib/ld-linux.so.2 (0x49fd7000)
libz.so.1 => /usr/lib/libz.so.1 (0x4e6a1000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x50745000)
$
====================================================

Things are fine. There is no "not found" message for any :-)

Just start skype now. It should come up :-)))))))))))

#/emul/linux/usr/bin/skype

You can chat but if you try to make a call the skype window will give
you the error

"Call Failed: Problem with Audio Playback"

and in the terminal you will find

===================================================
$ /emul/linux/usr/bin/skype
ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL default
ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL default
ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL default
ALSA lib control.c:910:(snd_ctl_open_noupdate) Invalid CTL default
===================================================

Also if you quit skype and try to start it again it will give an error

"Another Skype instance may exist"

So just delete the .Skype in your home directory
$rm -rf ~/.Skype

and it should start again.

Thanks a lot again Martynas :-))))))))))

Sunday, August 5, 2007

Booting From RAIDFRAME in multiuser before Parity re-write

Continuation of

Software RAID on OpenBSD using RAIDFRAME


Greg Oster ( RAIDFRAME Developer ) writes at misc@openbsd(.)org on how to deal with long parity writes that keep the system from booting to multi user for a long time.

====================================================================

RAIDframe, like hardware RAID and rsync, is just another tool.
Understand the pros and cons of each, but be willing to accept the
risks associated with whatever you choose... (if you think hardware
RAID is riskless, then you've never had a 2TB RAID set suddenly
decide that all components were "offline" and mark them as such!)

For the folks who dislike the "long parity checks"... If you're
willing to accept a window during which some of your data *might* be
at risk, change:
raidctl -P all
to something like
sleep 3600 ; raidctl -P all &
------------------------------------------------
correction from Greg it should be:
(sleep 3600 ; raidctl -P all) &
------------------------------------------------
in /etc/rc . This will, of course, delay the start of the parity
computation for an hour or so, giving your system a chance to do the
fscks and get back to multi-user as quickly as possible.

The risk here is as follows (this is for RAID 1.. risks for RAID 5
are slightly higher):
1) even though parity is marked 'dirty', it might actually be in
sync. In this case if you have a component failure, your data is
fine.
2) until the parity check is done, only the 'master' component is
used for reading. But any writes will be done are mirrored to both
components. That means that when the fsck is being done, any
problems found will be fixed on *both* components, and writes will
keep the two in sync even before parity is checked.
3) Where the risk of data loss comes in is if the master dies
before the parity check gets done. In this case, data on the master
that was not re-written or that was out-of-sync with the slave will
be lost. This could result in the loss of pretty much anything.

The important thing here is for you to evaluate your situation and
decide whether this level of risk is acceptable... For me, I use the
equivalent to 'sleep 3600' on my home desktop.. and slightly modified
versions of it on other home servers and other boxen I look after..
But don't blindly listen to me or anyone else -- learn what the risks
are for your situation, determine what level of risk you can accept,
and go from there...

Later...

Greg Oster

================================================
Greg does a minor correction
it should actually be

(sleep 3600 ; raidctl -P all) &

What I do id I comment out

raidctl -P all

in /etc/rc

and put

(sleep 600; raidctl -P all) &

at the end of /etc/rc.local.

So the parity rebuild starts only 10 minutes after the system is up an
running from the master disk.
=============================================

Wednesday, August 1, 2007

BIND 9 cache poisoning vulnerability does not affect OpenBSD due to Proactive Security Steps

From the OpenBSD Journal

Jakob Schlyter (jakob@) wrote to misc@:

as some of you may have noticed, a new weakness in BIND 9 has
recently been discovered. using this weakness, an attacker can
remotely poison the cache of any BIND 9 server. the attacker can do
this due to a weakness in the transaction ID generation algorithm used.

when BIND 9 was first imported into OpenBSD, we decided not to use
the default ID generation algorithm (LFSR, Linear Feedback Shift
Register) but to use a more proven algorithm (LCG, Linear
Congruential Generator) instead. thanks to this wise decision, the
BIND 9 shipped with OpenBSD does not have this weakness.

the proactive security of OpenBSD strikes again,

jakob

ref: http://www.trusteer.com/docs/bind9dns.html

Wednesday, March 7, 2007

Software RAID on OpenBSD using RAIDFRAME

Thankyou so much Vijay :-) You saved me just in time with this post!
Posted here for others.

===================================================================
Good day,

I set up RAIDFRAME on HP DL380 G4 servers sometime in 2004 because we
had problems with hardware RAID (SmartArray 6402 controller with 15000
rpm drives). We are no longer using RAIDFrame because OpenBSD 3.9
support for RAID on our machines is excellent and we no longer have
problems with 15K rpm drives. So unfortunately, I am not able to get you
a dmesg from this specific server when it was running RAIDFRAME.

Anyways, here is a cut and paste of what may be useful from my write up
at that time. It was written for operators whose primary expertise is
not OpenBSD, and the objective was just to help us rebuild our OpenBSD
servers quickly if there were any hardware failures. So it just shows
the steps to take within our environment and may not be appropriate for
your situation. Sorry that it looks a bit disjointed but I had to delete
all material that was specific to the data center. Hopefully it is still
readable. If you want the OpenOffice version of this document, please
let me know as well.

Hope this helps,

Vijay

FROM THE SERVER CONFIGURATION DOCUMENT

BASICS

Install OpenBSD, using 4GB for /, 2GB for swap, and leave the rest for
RAID

Install KDE Base

Make sure base installation is working properly.

I modified the generic kernel with the following changes -- RAID
support, a number of kernel optimizations including DUMMY_NOOPS, removal
of support for 386/486/586 processors, no math emulation, and support
for RAID Auto-configuration. I then built two custom kernels, one for
single processors (bsd.vijay.sp) and one for SMP machines
(bsd.vijay.mp). The objective was to provide similar or better
performance than the Solaris boxes. Copy the two custom kernels built
(bsd.vijay.mp and bsd.vijay.sp) to /


Rename /bsd as /bsd.original and rename bsd.vijay.mp as /bsd


I had copied the kernels to /home/vijay. So in this situation, I typed
in the following commands:


honyp34# cd /

honyp34# mv bsd bsd.original

honyp34# cp /home/vijay/bsd.vijay.mp /bsd


This will replace the generic kernel with a custom kernel that supports
RAID and is optimized for the Proliant DL380 G4 Server.


Now comes the slightly complicated part.


DISKLABEL
disklabel sd0 > disklabel.sd0


You will get output as follows:


# /dev/rsd0c:

type: SCSI

disk: SCSI disk

label: BF07288576

flags:

bytes/sector: 512

sectors/track: 723

tracks/cylinder: 4

sectors/cylinder: 2892

cylinders: 49158

total sectors: 142264000

rpm: 15000

interleave: 1

trackskew: 0

cylinderskew: 0

headswitch: 0 # microseconds

track-to-track seek: 0 # microseconds

drivedata: 0


16 partitions:

# size offset fstype [fsize bsize cpg]

a: 8389629 63 4.2BSD 2048 16384 416 # Cyl 0*- 2900

b: 4193400 8389692 swap # Cyl 2901 - 4350

c: 142264000 0 unused 0 0 # Cyl 0 - 49192*

d: 129672483 12583092 RAID # Cyl 4351 - 49189*


Now copy this to disklabel.sd1 and edit the new file so that we have:


# /dev/rsd1c:

type: SCSI

disk: SCSI disk

label: BF07288576

flags:

bytes/sector: 512

sectors/track: 723

tracks/cylinder: 4

sectors/cylinder: 2892

cylinders: 49158

total sectors: 142264000

rpm: 15000

interleave: 1

trackskew: 0

cylinderskew: 0

headswitch: 0 # microseconds

track-to-track seek: 0 # microseconds

drivedata: 0


16 partitions:

# size offset fstype [fsize bsize cpg]

a: 8389629 63 4.2BSD 2048 16384 416 # Cyl 0*- 2900

b: 4193400 8389692 swap # Cyl 2901 - 4350

c: 142264000 0 unused 0 0 # Cyl 0 - 49192*

d: 129672483 12583092 RAID # Cyl 4351 - 49189*


MATCH DRIVES

fdisk -i sd1


-----------------------------------------------------

------ ATTENTION - UPDATING MASTER BOOT RECORD ------

-----------------------------------------------------


Do you wish to write new MBR and partition table? [n] y


disklabel -R -r sd1 disklabel.sd1

# using MBR partition 3: type A6 off 63 (0x3f) size 142255512
(0x87aa598)


Now, set up the new filesystem using the commands:


newfs /dev/sd1a

newfs /dev/sd1d


Create and save a file called raid0.conf in /etc with the following
contents:


START array

1 2 0

START disks

/dev/sd0d

/dev/sd1d

START layout

128 1 1 1

START queue

fifo 100


mount /dev/sd1a /sd1


cd /


pax -r -w -p e -v .profile bin boot bsd bsd.original dev dvd etc home
mnt root sbin sd0 sys tmp usr var stand altroot /sd1/


dump -0f - / | restore -rf b is another alternative and is recommended
by many people. I had problems with this command, when implementing a
graphical OpenBSD. So resorted to the less popular pax.


After the restore is completed successfully, copy the boot sectors to
the second hard drive:


/usr/mdec/installboot -v /sd1/boot /usr/mdec/biosboot sd1


Do not forget to edit fstab on the second hard drive so
that /sd1/etc/fstab looks like:


/dev/sd1a / ffs rw 1 1


Reboot so that we use the custom, RAID-enabled kernel.


SET UP RAID

If you followed all the steps listed above breligiouslyb then most
probably you wonbt get too many errors. Most probably if you are running
your commands from the console you may notice the following errors.
Since raidctl ignores them, you can safely ignore them too!


honyp34# raidctl -C /etc/raid0.conf raid0

Jun 21 10:19:33 honyp34 /bsd: vnode was NULL

Jun 21 10:20:19 honyp34 /bsd: Hosed component: /dev/sd0d.

Jun 21 10:20:19 honyp34 /bsd: Hosed component: /dev/sd0d.

Jun 21 10:20:19 honyp34 /bsd: raid0: Ignoring /dev/sd0d.

Jun 21 10:20:19 honyp34 /bsd: raid0: Ignoring /dev/sd0d.

honyp34# Jun 21 10:20:19 honyp34 /bsd: raid0: Component /dev/sd1d being
configured at row: 0 col: 1

Jun 21 10:20:19 honyp34 /bsd: raid0: Component /dev/sd1d being
configured at row: 0 col: 1

Jun 21 10:20:19 honyp34 /bsd: Row: 16 Column: 24 Num Rows: 1200 Num
Columns: 184

Jun 21 10:20:19 honyp34 /bsd: Row: 16 Column: 24 Num Rows: 1200 Num
Columns: 184

Jun 21 10:20:19 honyp34 /bsd: Version: 0 Serial Number: 0 Mod Counter: 8

Jun 21 10:20:19 honyp34 /bsd: Version: 0 Serial Number: 0 Mod Counter: 8

Jun 21 10:20:19 honyp34 /bsd: Clean: Yes Status: 1119363391

Jun 21 10:20:19 honyp34 /bsd: Clean: Yes Status: 1119363391

Jun 21 10:20:19 honyp34 /bsd: Row out of alignment for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: Row out of alignment for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: Column out of alignment for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: Column out of alignment for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: Number of rows do not match
for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: Number of rows do not match
for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: Number of columns do not match
for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: Number of columns do not match
for: /dev/sd1d.

Jun 21 10:20:19 honyp34 /bsd: raid0: There were fatal errors

Jun 21 10:20:19 honyp34 /bsd: raid0: There were fatal errors

Jun 21 10:20:19 honyp34 /bsd: raid0: Fatal errors being ignored.

Jun 21 10:20:19 honyp34 /bsd: raid0: Fatal errors being ignored.

Jun 21 10:20:19 honyp34 /bsd: raid0 (root)

Jun 21 10:20:19 honyp34 /bsd: raid0 (root)


honyp34# raidctl -I 100 raid0

Jun 21 10:20:38 honyp34 /bsd: raid0: no disk label

Jun 21 10:20:38 honyp34 /bsd: raid0: no disk label


honyp34# raidctl -iv raid0

Parity Re-Write status:

3% |* | ETA: 13:36 |


honyp34# disklabel -E raid0

Jun 21 10:37:44 honyp34 /bsd: raid0: no disk label

Jun 21 10:37:44 honyp34 /bsd: raid0: no disk label

disklabel: Can't get bios geometry: Device not configured


Initial label editor (enter '?' for help at any prompt)

> a a

offset: [0]

size: [129672320] 4g

FS type: [4.2BSD]

> a b

offset: [8388608]

size: [121283712] 2g

FS type: [swap]

> a d

offset: [12582912]

size: [117089408] 4g

FS type: [4.2BSD]

> a e

offset: [20971520]

size: [108700800] 8g

FS type: [4.2BSD]

> a f

offset: [37748736]

size: [91923584] 8g

FS type: [4.2BSD]

> a g

offset: [54525952]

size: [75146368]

FS type: [4.2BSD]

> w

> q

No label changes.


The following commands will set up new file systems on the RAID array.
Please note that rraid stands for raw raid, a convention adopted from
standard UNIX practice. For example, rsd0a stands for raw sd0a.


newfs /dev/rraid0a

newfs /dev/rraid0d

newfs /dev/rraid0e

newfs /dev/rraid0f

newfs /dev/rraid0g


I have included the five newfs commands above in the file
construct-filesystems-1.sh so that you donbt have to type it in. This is
the first step (as indicated by the -1 in the scriptbs name).


Next, enter the following commands:


mount /dev/raid0a /mnt

cd /mnt

mkdir tmp

mkdir var

mkdir usr

mkdir home

mount /dev/raid0d /mnt/tmp

mount /dev/raid0e /mnt/var

mount /dev/raid0f /mnt/usr

mount /dev/raid0g /mnt/home


I entered these commands in the file mount-raid-2.sh and you can
alternately run that file to mount the partitions. This is step 2,
indicated by the -2 in the file name. Then


cd /

pax -r -w -p e -v .profile bin boot bsd bsd.original dev dvd etc home
root sbin sd0 sys tmp usr var stand altroot /mnt/


will copy OpenBSD installation.


Carefully edit the file system table in /mnt/etc/fstab so that it looks
like the following:


/dev/raid0a / ffs rw 1 1

/dev/raid0b none swap sw 0 0

/dev/raid0d /tmp ffs rw,nodev,nosuid,softdep 1 2

/dev/raid0e /var ffs rw,nodev,nosuid,softdep 1 2

/dev/raid0f /usr ffs rw,nodev,softdep 1 2

/dev/raid0g /home ffs rw,nodev,nosuid,softdep 1 2


You may want to copy the file /home/vijay/script/fstab using the
following command:


honyp34# cp fstab /mnt/etc/fstab


Now, we should make the RAID partitions bootable using the command:


honyp34# raidctl -A root raid0


raid0: Autoconfigure: Yes

raid0: Root: Yes

CHECKS

Checks
Before proceeding further, do the following checks. You should not have
any problems with each of the following reboots. If you do, first figure
out what is wrong, fix it, and then do the checks again:


1. Reboot

2. Remove the first hard drive and reboot

3. Remove the second hard drive and reboot

4. Boot from hd1a:/bsd

5. Boot from hd0a/bsd



With each of the checks:


1. You should be able to logon on as root

2. You should be able to start X-Windows

3. You should be able to start KDE

--
Vijay Sankar, M.Eng., P.Eng.
ForeTell Technologies Limited
59 Flamingo Avenue, Winnipeg, MB, Canada R3J 0X6
Phone: 204 885 9535, E-Mail: vsankar > @ < foretell.ca