Hello,

I've been having a real bugger of a time getting this to work.  Here's
my situation:

I have a machine with one IDE drive and two identical Seagate ST39102LW
drives, each plugged into two identical Adaptec 2940U2W SCSI cards with
identical LVD SCSI cables.

Redhat 6.0 is installed normally on the IDE drive and everything boots
up and runs fine.  I would like to mount /home and our CVS repository
onto the two SCSI disks which are mirroring each other.

I recompiled the kernel with all the necesary options, selected the
apropriated drivers for the SCSI, and it seems to work quite well.
Linux detects both cards:

scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.1.17/3.2.4
       <Adaptec AHA-294X Ultra2 SCSI host adapter>
scsi1 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.1.17/3.2.4
       <Adaptec AHA-294X Ultra2 SCSI host adapter>


and both drives:

(scsi0:0:0:0) Synchronous at 80.0 Mbyte/sec, offset 15.
  Vendor: SEAGATE   Model: ST39102LW         Rev: 0004
  Type:   Direct-Access                      ANSI SCSI revision: 02
Detected scsi disk sda at scsi0, channel 0, id 0, lun 0
(scsi1:0:0:0) Synchronous at 80.0 Mbyte/sec, offset 15.
  Vendor: SEAGATE   Model: ST39102LW         Rev: 0006
  Type:   Direct-Access                      ANSI SCSI revision: 02
Detected scsi disk sdb at scsi1, channel 0, id 0, lun 0


I have partitioned the drive into 4 identical partitions on each.  1 for
swap (which will not be RAIDed, just two swap partitions) and three for
various partitions that I want to mirror.  The partitioning works, and I
can create ext2 filesystems on all of them and mount them directly like
any other drive and they work fine.

This is the confusing part:

I had to d/l the raidtools-0.90 source code to find the latest docs.
The 'Software-RAID HOWTO' that's floating around is very outdated.
After reading those docs, I got to figuring that my raidtab should be
so:

raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        chunk-size      4

        device          /dev/sda2
        raid-disk       0
        device          /dev/sdb2
        raid-disk       1


I left out md1 and md2 for brevity, but their setups are very similar,
just different partitions.

So now I go to try and mkraid the /dev/md0 device:

[root@korak raidtools-0.90]# mkraid --really-force /dev/md0
DESTROYING the contents of /dev/md0 in 5 seconds, Ctrl-C if unsure!
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/sda2, 2048287kB, raid superblock at 2048192kB
disk 1: /dev/sdb2, 2048287kB, raid superblock at 2048192kB
mkraid: aborted


So I looked into the source and found that, ALL error conditions result
in 'mkraid: aborted'.  In every case where an error is attempted to be
detected, they all 'goto abort' and the abort code section just prints
'mkraid: aborted'  THIS DROVE ME NUTS.

So I rewrote parts of the code to print a useful error message for each
error condition.  What is happening is, at or about line 118:

   ret = ioctl(file, SET_ARRAY_INFO, (unsigned long)&cfg->array.param);

This call is failing, and 'errno' is being set to 22, which is EINVAL
(invalid data structure).  Right above this line I see:

#if 0
    printcfg(cfg);
#endif

So I change this so that it calls this function if a command line option
is passed, which results in:

     major_version:      0
     minor_version:      90
     patch_version:      0
             ctime:      932996232
             level:      1
              size:      0
          nr_disks:      2
        raid_disks:      2
          md_minor:      0
             utime:      932996232
             state:      0
      active_disks:      2
     working_disks:      2
      failed_disks:      0
       spare_disks:      0
            layout:      0
        chunk_size:      4096

            number:      0
             major:      8
             minor:      2
         raid_disk:      0
             state:      6

            number:      1
             major:      8
             minor:      18
         raid_disk:      1
             state:      6
ioctl failed with 22
mkraid: aborted


I would be very thankful if someone could point out somewhere along the
line where I messed up here.  I would also be happy to contribute back
the changes I made to the tool so that it returns useful error messages
and some other cosmetic but very useful changes.

-Michel Pelletier
[EMAIL PROTECTED]

Reply via email to