Hi,

went through the same nightmare lately, but you can succeed...

Below are newsgroup postings and infos that helped.

Check the archive for the "zero_page" fix, your kernel comilation might
terminate and you have to insert a line in the makefile

by Chris Price:


Hey;

What follows is my own raid1 howto, the info below I derived from reading
several hundred emails in the archives. One was especially helpful(and
provided most of the content for this howto), but I forget the original
authors name (hey, credit where credit is due).

Quick & Dirty Raid howto for RedHat 5.2 on x86 and kernel 2.0.36 (jan25/99)
1) cd /usr/src/ and rm -rf the current linux source tree. ftp ‚pristine'
2.0.36 kernel sources to /usr/src and untar. I tried skipping this step, but
this process seemingly *must* have pristine sources.
2) while still in /usr/src, get the most recent dated raid0145-1999xxxx.gz
file from ftp.kernel.org/pub/linux/daemons/raid/alpha, ungzip it, and
patch -p0 < raid0145-1999xxxx  into the linux source tree
3) cd linux, make menuconfig, and under ‚Floppy, IDE and other block
devices' select:'multiple device driver support', ‚autodetect RAID
partitions' ‚Linear (append) mode', ‚RAID 0', ‚RAID 1', ‚RAID4/5',
‚Translucent' and ‚Logical Volume Maneger Support'. *NOTE* I did not select
these as modules, so if you choose to do so, your process/results may be
different than mine.
4) make zImage, make install, make modules, make modules_install
4.5) We need to remove the raidtools rpm that shipped with Redhat5.2
(raidtools ver 0.50 beta) before we make the new raidtools (ver 0.90).  I
accomplished this with a simple rpm -qa|grep raid to get the name of the
raid package, and then a rpm -e to uninstall the package.
5) cd to your fav working directory ( I did this in /root), and retreive via
ftp from ftp.kernel.org/pub/linux/daemons/raid/alpha/, the file:
raidtools<latestdate>.tar.gz, once you have the file, tar zxvf it into your
working directory. cd raidtools<latestdate> and ./configure, make and make
install.
6) fdisk your scsi disks into identical partitions (so I have done, as it
was what I read). In my case I had two Segate Hawk 4gb drives: /dev/sdb and
/dev/sdc. While in fdisk program, use the ‚t' option to change file type fd
(just enter ‚fd' when it asks for filesystem type instead of usual 83 or 82
or etc). Each raid partition *MUST* be of type ‚fd' for raid to work at
boottime.
7) reboot with new kernel. You will see (at least I did) complaints about
bad raid superblocks, which it should since we have not yet created raid
superblocks on our raid drives.
8) Create the file /etc/raidtab, here is my ultra-simple version:
<begin>
ls -l /etc/raidtab
* rw-r-r--   1 root     root          346 Jan 24 18:12 /etc/raidtab

more /etc/raidtab
raiddev                 /dev/md0
# General parameters
        raid-level              1
        nr-raid-disks           2
        chunk-size              256

# RAID disks
        device                  /dev/sdb1
        raid-disk               0
        device                  /dev/sdc1
        raid-disk               1
<end>
If you want raid-0 or raid4/5, you will have to read the man pages on
raidtab as there are a myriad of values you may have to insert into
/etc/raidtab.
9) Run ‚mkraid /dev/md0' (and thru to /dev/mdX if your have more than one
raid device to setup - my case was a simple ‚mkraid /dev/md0'). You *WILL*
see an error message. Just read the error message and do what it tells you
to do.
10) do a ‚raidstart /dev/md0' (again thru to /dev/mdX of that is the case)
11) Raid only supports the ext2 filesystem currently, so do not try to make
anything else -> ‚mke2fs -c /dev/md0' (or whatever checking switches you
like)
12) if you got this far, ‚mount -t ext2 /dev/md0 <mountpoint>' on your fav
test mount point (in my case, /raidtest).
13) I did a ‚dd if=/dev/zero of=/raidtest/bigfile count00000' to create a
512mb file in /raidtest. I then copied this back and forth a couple times,
deleted it, created a smaller one, deleted it and so on until I felt
comfortable that my raid1 device was error free.
14) I guess the last point would be to edit /etc/fstab to permanently mount
the drive for every reboot.
*NOTE* Everything I have read about RAID (and more specifically, Linux RAID
says that a system with a raid array *OF ANY KIND* should be UPS protected
with some sort of UPS montoring software enabled. No sense in going to the
effort of building a raid array only to lose all/some of your data to a
power failure.
Of course, YMMV....
Chris Price
Sysadmin
Western Computer Link
Saskatoon, Saskatchewan

then a message from Martin Bene ([EMAIL PROTECTED]) about setting up lilo
(extreely important, helpfull "must have", and some other things: Is around
feb 5 in the archive subject Re: root-raid howtos

my hint: (didn't find it out myself but forgot who gave me the info: when
setting up the RAID1, you must not mark the partitions fd as in the example
of Martin. You must first mkraid /dev/md0 and then run fdisk (I hope this
sequence is correct.... sorry)

message from Bruno Prior Dec 8 Re:Help with root mounted RAID1

Hope this helps

Till

-----Ursprüngliche Nachricht-----
Von:    [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] im Auftrag von Penio
Penev
Gesendet am:    Mittwoch, 3. März 1999 18:40
An:     [EMAIL PROTECTED]
Cc:     [EMAIL PROTECTED]
Betreff:        Re: How to use liear raid nowadays?


On Wed, 3 Mar 1999 [EMAIL PROTECTED] wrote:

| On Wed, Mar 03, 1999 at 02:53:30AM -0500, Penio Penev wrote:
| > I've been trying to set up a linear raid for about three days now-there
| > are no clear instructions as to what needs to be done.
|
| Read   http://ostenfeld.dk/~jakob/Software-RAID.HOWTO/
|
| The docs are not completed, but at least they are fairly up to date.
|

This did seem quite more useful than the "official" HOWTO (modulo the fact
that It is not accessible from parts of the US right now).
Nevertheless, the stage I'm stuck at is described there as "get the latest
raidtools and kernel patches, apply them and compile them."
Fair enough, but this is what I have bee trying to achieve the last four
days.
Quick question first:  I need linear to get the data off and old setup.  In
that case, do I need to patch the kernel?  I.e., are there raidtools that
can use the kernel as is to get linear?
I would assume, yes; otherwise, why would anything be included in the kernel
to begin with.
In that case, which raidtools (or mdtools, for that matter) should I use?  I
tried quite a few of the ones at pub/linux/daemon/raid , and none compiled
out of the box.  With some coaxing, some compiled, but they use a special
ioctl command for startraid that is not in the unpatched kernels.

Modulo unpatched kernels.,, here is my experience with patching:
On Wed, 3 Mar 1999, Penio Penev wrote:
| In addition to what is said below, I did some experiments with
| kernel 2.2.1 + raid0145-19990128-2.2.0 , of which only the mmap.c patch
| failed, ignored as advertised here:
|
| The kernel dies in IO_trace(0x17,0x300,0,0xC017EB5E,0) which is called
| from bread(0x300,0,0x400) which is called from msdos_partition from
| check_partition.  I don't have time to do more tracing today.

| On Mon, 1 Mar 1999, Perry Harrington wrote:
|
| | > OK, I tried various patchings:
| |
| | I used kernel 2.2.1 with the 2.2.0 patch.  The mm/mmap.c patch failure
can
| | be ignored, as the patch in the raid patch is the same end result as the
virgin
| | 2.2.1 (read, the raid patch included a patch that was already in 2.2.1).
| |
| | Apply 2.2.0 raid patch to 2.2.1 and recompile, use the .9 raidtools from
kernel.org
| | and you should be fine.
|
| I did that.  Let me make sure that I'm doing it right:
|
| bunzip2 -c dist/linux-kversion.tar.bz2 | tar xf -
| cd linux
| bunzip2 -c /path-to-raid-dist/raid0145-date-pversion.bz2 | patch -s -p1
|
| Is this the procedure?  If this, I have to say that I am lost.
|
| {kversion = 2.2.1 , date-pversion = 19990128-2.2.0} compiled but
| segfaulted on "partition check" when booted.
|
| {kversion = 2.2.0 , date-pversion = 19990128-2.2.0} compiled but
| segfaulted on "partition check" when booted.
|
| {kversion = 2.0.36 , date-pversion = 19990128-2.0.36} did not compile
|
| ---
|
gcc -D__KERNEL__ -I/mnt/p2/usr/src/linux/include -Wall -Wstrict-prototypes -
O2 -fomit-frame-pointer -fno-strength-reduce -pipe -m486 -malign-loops=2 -ma
lign-jumps=2 -malign-functions=2 -DCPUX6  -c -o setup.o setup.c
| setup.c: In function 'setup_arch':
| setup.c:129: 'empty_zero_page' undeclared (first use this function)
| setup.c:129: (Each undeclared identifier is reported only once
| setup.c:129: for each function it appears in.)
| setup.c:125: warning: 'memory_end' might be used uninitialized in this
function
| setup.c:127: warning: 'memory_alt_end' might be used uninitialized in this
function
| make[1]: *** [setup.o] Error 1
| make[1]: Leaving directory '/mnt/p2/usr/src/linux/arch/i386/kernel'
| make: *** [linuxsubdirs] Error 2
| ---

I did see some reference to the 2.0.36 patches earlier in the archives, I
will definitely try it, but I am not holding my breath at this point.
Is liear raid so complicated, or am I missing something obvious?

--
Penio Penev <[EMAIL PROTECTED]> 1-212-327-7423


Reply via email to