Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RAID] HPT372 IDE RAID Controller (PCI) [SOLVED]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
coax
Apprentice
Apprentice


Joined: 08 Sep 2003
Posts: 231
Location: Antwerp - Belgium

PostPosted: Tue Apr 13, 2004 11:50 am    Post subject: Reply with quote

It is my experience that trying to get hardware raid to work usually isn't worth the hassle since it's not really hardware raid. (you still need os support)
Here at home, I put my two sata disks in software raid, and that works like a charm.
Code:
root@homer coax # hdparm -Tt /dev/md0

/dev/md0:
 Timing buffer-cache reads:   3840 MB in  2.00 seconds = 1919.33 MB/sec
 Timing buffered disk reads:  272 MB in  3.01 seconds =  90.38 MB/sec

_________________
- There is no such thing as having too many computers -
Back to top
View user's profile Send private message
Hoshimaru
Apprentice
Apprentice


Joined: 09 Nov 2003
Posts: 225
Location: Belgium

PostPosted: Tue Apr 13, 2004 1:00 pm    Post subject: Reply with quote

This looks promising ^^
Gonna test it asap I come back from my work.

Thx for the link Icer.

Shouldn't this be working, then I'll probably install it using md raid as coax and you suggested.


Last edited by Hoshimaru on Thu Feb 03, 2005 10:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hoshimaru
Apprentice
Apprentice


Joined: 09 Nov 2003
Posts: 225
Location: Belgium

PostPosted: Tue Apr 13, 2004 7:20 pm    Post subject: Reply with quote

It didn't work either... and I've found another problem:

dmesg: http://users.skynet.be/bs978384/livecd.txt

Check the hdc part >.<

And windows is running from that disk. No errors reported.
Back to top
View user's profile Send private message
Hoshimaru
Apprentice
Apprentice


Joined: 09 Nov 2003
Posts: 225
Location: Belgium

PostPosted: Tue Apr 20, 2004 8:53 am    Post subject: Reply with quote

Wiiiiiiiieee

I run Gentoo Linux on software raid. Worked out to be great ^^
You still have to patch 2 files to get that HPT372A Rev. 2 running. (bad timings and stuff like that)

I'll post a howto / guidelines when I'm back home and fixed the keyboard issue with Xorg.
Back to top
View user's profile Send private message
Icer
Guru
Guru


Joined: 26 Aug 2003
Posts: 395
Location: @home

PostPosted: Tue Apr 20, 2004 7:32 pm    Post subject: Reply with quote

Congrats on your succesful install! :D
Back to top
View user's profile Send private message
tacker
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jul 2004
Posts: 85
Location: Offenbach, Germany

PostPosted: Thu Feb 03, 2005 1:15 pm    Post subject: Reply with quote

Hoshimaru wrote:
I'll post a howto / guidelines when I'm back home and fixed the keyboard issue with Xorg.


Can you do that, please!
Back to top
View user's profile Send private message
Hoshimaru
Apprentice
Apprentice


Joined: 09 Nov 2003
Posts: 225
Location: Belgium

PostPosted: Thu Feb 03, 2005 10:06 pm    Post subject: Reply with quote

I completely forgot to write something... my apologies for that.
Ok then, here we go :)

The second part only applies to kernel 2.4.25-gentoo-r2.
It might work with another 2.4.25, but I can't guarantee that.
HPT372A works out of the box with kernel 2.6.9. I tested it with 2.6.9-gentoo-r4

Part One - Installing with Linux Software RAID-0 with 2 disks
Filesystem setup
The installation for software raid is pretty much the same as with the regular installation.
Boot your computer with the LiveCD. Once you entered the system, type:
Code:
$ modprobe md

Continue to follow the manual until you arrive at the steps for prepare your file system.
Follow the step in the manual for creating the BOOT, ROOT and SWAP partitions, but do exactly the same on BOTH hard disks.
Be carefull with the partition types. Select Linux - 83 for /boot partition as Linux cannot boot on RAID. Swap partitions should be type swap - 82.
Your large root partition must be of type Linux RAID autodetect - FD.

Next, create an /etc/raidtab file. This file maps virtual RAID drives to physical
partitions, and is required for your array to function. If your drives are of
different sizes (which is not recommended), the smaller of the two drives should
be raid-disk 0 in this file.
Code:
# / partition
raiddev /dev/md0 # raid device name
raid-level 0 # raid 0
nr-raid-disks 2 # number of disks in the array
chunk-size 32 # stripe size in kilobytes
persistent-superblock 1
device /dev/hda3 # device that comprises the raid array
raid-disk 0 # disk positing index in array
device /dev/hdc3 # device that comprises the raid array
raid-disk 1 # disk position index in array

Now you're ready to complete to file system.

Filesystem creation
Run the mkdraid command to create the RAID device:
Code:
# mkraid --really-force /dev/md0

If you get freaky warnings, don't worry. Just ignore them.

Now check if the operation has finished successfully:
Code:
# cat /proc/mdstat

This command shows the details of your raid drive. Example:
Code:
Personalities : [raid0]
read_ahead 1024 sectors
md0 : active raid0 ide/host0/bus1/target0/lun0/part3[1]

ide/host0/bus0/target0/lun0/part3[0]
74100352 blocks 32k chunks

Next create standard filesystems for the /boot and RAID virtual drive. You're free to choose your own here. I took ext2 for boot and reiserfs for root.

Code:
# mkreiserfs /dev/md0
# mke2fs /dev/hda1

Create the swap space on each physical drive and turn it on:
Code:
# mkswap /dev/hda2
# swapon /dev/hda2

# mkswap /dev/hdc2
# swapon /dev/hdc2

Note: swap space will not be RAID'ed, but used efficiently by the kernel
via an entry we will make in /etc/fstab.

Proceed with chroot and following steps
Mounting the partitions:
Code:
# mount /dev/md0 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mount /dev/hda1 /mnt/gentoo/boot

Copy the /etc/raidtab file your created into the Gentoo chroot:
Code:
# cp /etc/raidtab /mnt/gentoo/etc/raidtab

Now follow the instruction in the gentoo manual until the kernel compilation step.

Part Two - Patching the kernel
Once you've extracted or merged the kernel source code, you've to download a small patch, that solves the HPT372A problem.
Appearantly the HPT36x/HPT37x module in the kernel have a timing problem accessing the hard disks attached to a HPT372A controller. Due to this small 'error', you run into a null pointer dereference error at boot. Don't lose your time playing with settings and parameter, only this patch solves it.

Download & Decompress
Code:
$ cd /usr/src/linux-2.4.25-gentoo-r2
$ wget http://www.be.kernel.org/pub/linux/kernel/people/hedrick/ide-2.4.25/hpt366-0.37.patch.gz
$ gzip -d hpt366-0.37.patch.gz

A file called hpt366-0.37.patch will be located in this directory. Now we Download & Decompress
Code:
$patch -p0 < htp366-0.37.patch

The source directory is hard coded in this patch, so you'll have to type the full path to the file location.
Code:
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- linux-2.4.25/drivers/ide/pci/hpt366.c.orig Mon Aug 25 04:44:41 2003
|+++ linux-2.4.25/drivers/ide/pci/hpt366.c      Fri Mar 19 19:17:08 2004
--------------------------
File to patch:

Type: /usr/src/linux-2.4.25-gentoo-r2/drivers/ide/pci/hpt366.c
The program will ask you if you want to apply the patch. Say yes.

The second file to pathc is:
/usr/src/linux-2.4.25-gentoo-r2/drivers/ide/pci/hpt366.h

I didn't copy the output here, because my system is already patched and the prompt is now completely different, asking me if I want to reverse the applied patch. Tacker, do you mind copying the normal output, to complete this?

Ok, you're done with the patch. Now let's configure the kernel.

Kernel configuration
In the Block devices section, select this:
Code:
  │ │        [*] Multiple devices driver support (RAID and LVM)           │ │
  │ │        <*>  RAID support                                            │ │
  │ │        < >   Linear (append) mode                                   │ │
  │ │        <*>   RAID-0 (striping) mode                                 │ │
  │ │        < >   RAID-1 (mirroring) mode                                │ │
  │ │        < >   RAID-4/RAID-5 mode                                     │ │
  │ │        < >   Multipath I/O support                                  │ │
  │ │        < >  Logical volume manager (LVM) support                    │ │
  │ │        < >  Device-mapper support   


In ATA/IDE/MFM/RLL support make sure to select.
Code:
<*> ATA/IDE/MFM/RLL support

And in IDE, ATA and ATAPI Block devices don't forget to select
Code:
  │ │ <*>     HPT36X/37X chipset support                                  │ │


After you configured & compiled your kernel, you can reboot your system and enjoy linux software raid 0 on a HPT372A controller.

Warning: This patch does NOT enable the native RAID 0 or 1 mode that this controller provides under windows!

Part Three - Finishing the installation
/etc/fstab
Because we're working with a RAID device, we need modify fstab slightly.
Modify it like the example shown below, but don't forget to use your own settings. Be really careful and doublecheck everything. Failing this makes iit real hard to reassemble the RAID array with the LiveCD. It's possible with mdadm though, but we don't want to do that anyway.
/etc/fstab:
Code:
dev/hda1 /boot ext2 noatime 1 2
/dev/md0 / reiserfs noatime 0 1
/dev/hda2 swap swap defaults,pri=1 0 0
/dev/hdc2 swap swap defaults,pri=1 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0

The two swap partions have the "pri=1" flag set. Setting a
priority of 1 tells the kernel to use each swap space with equal priority, and to balance the load between them on a round-robin basis.

Continue the Gentoo installation as described in the manuel until you arrive at the bootloader part.

GRUB
My favourite bootloader is grub, so I'll stick with it for the howto. Honestly, I've no idea how it works with lilo. If someone knows, just post ^^

Install grub like you would do it on a regular system, but modify grub.conf to match your RAIDed system:
Code:
The grub.conf file needs to look like this:

default 0
timeout 10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Gentoo Linux RAID
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/md0

Congratulations. You're system is ready to be rebooted.

When logged in, issue
Code:
# cat /proc/mdstat

to verify that everything runs fine.

Ok, that's pretty much everything I can remember about it. I hope it will help you installing Gentoo. Once more, should there be an error, let us know.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum