[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problems creating RAID 5 using mdadm


I've been messing around with problem for over a week now and did not find any solution, so this is why I hope to find help in this way...

I have a fresh debian sarge installation (kernel 2.6.8-2-386) on a RAID 1 array (this array was created during the installation process using the debian setup routine). The RAID1 array /dev/md0 consists of 2 different hard disks and works fine.

Now I have 4 separate hard disks (400 GB each) and I want to to use them in a RAID 5 array. So I did create a blank "Linux raid autodetect" partition on each of the 4 hard disks using fdisk, this is what "fdisk -l" gives me:
fdisk -l /dev/sda

Disk /dev/sda: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1 1 48641 390708801 fd Linux raid autodetect
(same for /dev/sdb, /dev/sdc and /dev/sdd)

Then I did:
mdadm --create --force /dev/md1 --level=raid5 --chunk=64 -- parity=left-symmetric --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 / dev/sdd1

After the sync had finished, I wrote the new mdadm config file:
mdadm --detail --scan > /etc/mdadm/mdadm.conf
I added a DEVICE line, becaus I read this would help the arrays to be recognized. This is how the mdadm.conf looks like:
DEVICE /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/hda1 /dev/hdb1
ARRAY /dev/md1 level=raid5 num-devices=4 UUID=a2e5426c:b2830333:accac389:9393124d
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b5e33bba: 3509dbed:aed82fc4:46628aec

Then I created the file system:
mkfs.ext3 -b 4096 -R stride=16 /dev/md1

I edited the /etc/fstab, it looks like this:
# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/md0 / ext3 defaults,errors=remount-ro 0 1
/dev/md1        /pacs           ext3    defaults        0       2
/dev/hda3       /tmp            ext3    defaults        0       2
/dev/hdb3       /tmp2           ext3    defaults        0       2
/dev/hda2       none            swap    sw              0       0
/dev/hdb2       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
(the /pacs mount point exists)

When rebooting, the fsck fails, giving me the following warning:
fsck.ext3: Invalid argument while trying to open /dev/md1
The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

I continue the boot process, then the /proc/mdstat looks like this:
Personalities : [raid1]
md0 : active raid1 hda1[0] hdb1[1]
      39061952 blocks [2/2] [UU]

unused devices: <none>

Then I do "mdadm -A -s", it gives:
mdadm: /dev/md1 has been started with 4 drives.

and the /proc/mdstat:
Personalities : [raid1] [raid5]
md1 : active raid5 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      1172126208 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]

md0 : active raid1 hda1[0] hdb1[1]
      39061952 blocks [2/2] [UU]

unused devices: <none>

This is what I get with "mdadm --examine /dev/sda1":
          Magic : a92b4efc
        Version : 00.90.00
           UUID : a2e5426c:b2830333:accac389:9393124d
  Creation Time : Tue May  9 09:33:20 2006
     Raid Level : raid5
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 1

    Update Time : Tue May  9 18:52:03 2006
          State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
  Spare Devices : 0
       Checksum : defd3829 - correct
         Events : 0.12

         Layout : left-symmetric
     Chunk Size : 64K

      Number   Major   Minor   RaidDevice State
this     0       8        1        0      active sync   /dev/sda1

   0     0       8        1        0      active sync   /dev/sda1
   1     1       8       17        1      active sync   /dev/sdb1
   2     2       8       33        2      active sync   /dev/sdc1
   3     3       8       49        3      active sync   /dev/sdd1

I can mount the array without problems, but I cannot read/write on it:
mount -t ext3 /dev/md1 /pacs

Can you please help me with that?

Thank you _very_ much in advance!

Best regards,


Reply to: