# raid filesystem

## rlz

Hi

Ive created a raid 0 array with 2 disks that is setup as md0, everything looks fine and I can run hdparm to test the speed which is all working perfectly fine.  However when I try to run mke2fs -j /dev/md0 it will get to writing inode tables and get to about 150-300ish of 7000 and then just freeze.  Does anyone have any ideas why this would happen ?

Cheers for any help

----------

## rlz

after some more fiddling around with settings ive managed to get it to run up to 3000 ish on occassion, ive also tested both hard drives by themselves not in raid configuration and they work fine. the motherboard is an asus p4p800 and im pretty sure i have all the drivers needed so i cant figure out why they wont just work in a raid config.

----------

## rlz

ok it just froze at 7393/7453 and i almost cried... but anyway I guess this could be a hardware issue, something to do with the sata controller not liking both drives being accessed.  it seems weird that both drives work perfectly fine not in a raid configuration.

----------

## NeddySeagoon

rlz,

What drives, what controller and what kernel?

Can you make any fs at all on the raid ?

----------

## rlz

its two samsung 500gig drives

the controller is the onboard one on the p4p800s-x (ICH5) which I have included in the kernel and surely if this wasnt working the drives wouldnt work by themselves 

the kernel is the gentoo 2.6.15

ive tried to create both ext2 and ext3 but i havent tried any others yet.. ill go have a go now.

----------

## NeddySeagoon

rlz,

I'm not aware of any issues with that combination.

----------

## rlz

ok ive tried using linear raid mode and that does the same. 

let me post my raidtab file just to make sure its ok

raiddev /dev/md0

raid-level 0

nr-raid-disks 2

chunk-size 32

persistant-superblock 1

device /dev/sda

raid-disk 0

device /dev/sdb

raid-disk 1

then i just ran mkraid /dev/md0 and then i tried to create the filesystem using mke2fs -j  /dev/md0

I just wanna check im not doing anything really stupid here am I?

----------

## NeddySeagoon

rlz,

Its raidtools is picky about the ordeing of some lines in /etc/raidtab but I would expect the breakage to occur before you got as far as mkfs.

My raidtab includes

```
raiddev                 /dev/md1

raid-level              0    # it's not obvious but this *must* be

                             # right after raiddev

persistent-superblock   1    # set this to 1 if you want autostart,

                             # BUT SETTING TO 1 WILL DESTROY PREVIOUS

                             # CONTENTS if this is a RAID0 array created

                             # by older raidtools (0.40-0.51) or mdtools!

chunk-size              16   # Thats 16kb

nr-raid-disks           2

nr-spare-disks          0

device                  /dev/sda5

raid-disk               0

device                  /dev/sdb5

raid-disk               1
```

By the way, raidtoods is depreciated in favour of mdadm now but I don't thing thats the issue either.

----------

## rlz

well i reordered the file and rebuild md0 just incase but that made no difference... however i just tried using reiserfs and it seems to work. is it possible that their is some bug with ext3 that makes it crash while creating the filesystem?

----------

## NeddySeagoon

rlz,

There is a kernel race problem for ext3 in 2.6.19 (recently fixed) but I don;t know how far back it goes nor if it affects mkfs.

I have been using a 600Gb raid0 with ext3 for 18 months or so now.

Creating it just worked for me.

----------

## rlz

yeh ive had a 600gig ext3 raid array running on a 2.6.9 kernel for a while and had no problems, can you update the mke2fs program without changing the kernel? if not is reiserfs any good for large file use? ive never used reiserfs before so i dont really know alot about it.

----------

## DrAgOnTuX

Hi there,

I have been using a 855G Raid5 with ext3 for 3months or so now.

Never get in touch with this problem.

Used Kernels: 2.6.17-gentoo-r*, 2.6.18-no2 (now using and works just fine)

----------

## rlz

I just found out even though reiserfs seems to work theres still errors from the drives.. this is from dmesg

ata1: translated ATA stat/err 0x51/84 to SCSI SK/ASC/ASCQ 0xb/47/00

ata1: status=0x51 { DriveReady SeekComplete Error }

ata1: error=0x84 { DriveStatusError BadCRC }

ata2: translated ATA stat/err 0x51/84 to SCSI SK/ASC/ASCQ 0xb/47/00

ata2: status=0x51 { DriveReady SeekComplete Error }

ata2: error=0x84 { DriveStatusError BadCRC }

I found this page http://gentoo-wiki.com/HARDWARE_SATA which says to add irqpoll to the kernel boot parameters but this didnt seem to help.

----------

## DrAgOnTuX

looks like a hardware or a sata driver failure, I don't think it's fs related.

 *rlz wrote:*   

> 
> 
> ive also tested both hard drives by themselves not in raid configuration and they work fine.
> 
> 

 

so I don't think the harddrives are going crazy...

which sata driver did you choose?

correct me if I'm wrong, there were some "upgrades" in 2.6.18 about sata support, right?

try a newer kernel (e.g. 2.6.18 ) instead of your "old" 2.6.15

OR

what happens when u try a

```
dd if=/dev/zero of=/dev/md0
```

??

does it crash or not?

----------

## NeddySeagoon

rlz,

I just noticed your raidtab again ...

```
device /dev/sda

raid-disk 0

device /dev/sdb

raid-disk 1 
```

you are passing whole disks, not partitions. It should work but the kernel will not be able to auto assemble your raid, as you have no partition table.

Try making a single partition on each drive, of type fd, and making the raid set on the partitions.

From your last post, it looks like an interface error, which may be fixed in software, so I would try the most recent kernel you can get your hands on. 

Lastly, depending in your chipset, you may find that both the ACHI and PIIX SATA drivers work but one is better than the other. Thats something else to play with.

----------

## rlz

I tried kernel 2.6.19 and I still had the same problem, also I did have it set up using partitions instead of whole disks but had exactly the same problem then.

I didnt actually try using the other SATA driver only the PIIX/ICH one but right now ive given up for the time being with this and im running them in another pc without any problems.

Thanks for your help

----------

## MC Reen

I think the CRC error messages from the kernel are related to DMA. Try disabling auto-DMA in the kernel and configure it manually for each drive with hdparm. You can use the hdparm service and set parameters for each drive in /etc/conf.d/hdparm.

----------

## mbar

and replace SATA cables with new ones

----------

## rlz

Well ive given up on this and installed the hard drives into another pc, but when I saw the response about dma I thought id give it a go with another sata hard drive I had laying around.  However hdparm -d /dev/sda didnt return anything about whether dma is on or off, I dont know if thats because sata drives work differently or something but obviously that stops me from manually turning dma on.  

Thanks

----------

## NeddySeagoon

rlz,

DMA is a non optional part of the SATA specification. Its always on.

Under IDE, DMA was a bolt on 'go faster' goodie. The original IDE interface was (and still is) a cut down ISA slot with only PIO support. Different vendors grafted on DMA in different ways over the years.

If you can find some IDE (not EIDE) drives, they will still work

----------

