# [CLOSED] Recovered from drive failure. Dual CPU/drives.

## trossachs

Yep, the server cacked itself this evening on the secondary drive. Bloody Maxtor's yet again. All working now, mail, www, sql, but have decided to build a mammoth workhorse to rise from the ashes to sit alongside the current box. Dual 3.0Ghz processor and 2GB RAM. Luckily did not lose any data, but the shock and scare was enough to de-rail established plans in favour of this new path.

How do I get Gentoo to work harmoniously with 2 CPU's and possibly a mirrored drive system?

I am looking at mirroring the drive system, but is this only possible with IDE or can I mirror two SCSI units? I am assuming that full RAID will be cost prohibitive. The box itself is starting to host "paying" customers so I cannot go thru this again and luckily no one noticed any downtime.Last edited by trossachs on Sun Dec 05, 2004 3:52 pm; edited 1 time in total

----------

## GeoffOs

I just compiled in RAID into the kernel and used Webmin to create the raid set.

I could not believe how easy it was.

----------

## trossachs

Out of interest, what drives did you use for your RAID set, IDE or SCSI and what size and speed? Normally drives run at 7200 rpm, but I am looking at faster units for a faster return of web pages; especially for large maildirs in webmail.

----------

## GeoffOs

I used two 80Gb IDE 7200RPM

They were only £38 each, so went for two mirrored.

```

#hdparm -Tt /dev/md0

/dev/md0:

 Timing buffer-cache reads:   1128 MB in  2.00 seconds = 563.44 MB/sec

 Timing buffered disk reads:  172 MB in  3.02 seconds =  56.86 MB/sec
```

But I have yet to check if this can be improved on, but it is quite acceptable for me.

----------

## trossachs

Looks good, I am looking for 10,000RPM drives for a faster return of web pages. Am I assuming that if one of the drives should fail, then the other immediately takes over without ANY loss of service whatsoever? 

What flag or signal is given to advise the administrator if one of the drives has failed?

----------

## GeoffOs

Good question,

I have no idea, though I will look into it.

If I find it, I will post back here.

----------

## kashani

Assuming you're running software RAID you'd want to cat /proc/mdstat every day or so in a script and have it email you if one of your drives has failed. 

kashani

----------

## ewan.paton

softwair raids are dead simple, the advantages scsi has over ide is if a dirve goes it woulnt take the bus out meaning no unexpected down time, with sca 80 pin drives you can hotswap on the fly, that said you could probably build 2 ide raid pcs networked over gigabit with fallover for the same price 

as a hint 3ghz xeons will cost more than opterons and unless you need need a realy high clock for stuff like encoding the opterons will kill them in web serving etc, not to mention they have one hell of an upgrade path to 4core processors giving you an 8 way server

----------

## trossachs

ewan.paton, I never use Intel only AMD stuff. Am busy buying up all the requirements so will let you know when done. Is there a Howto on RAID and mirroring I can be looking at?

----------

## ewan.paton

 *JulesF wrote:*   

> ewan.paton, I never use Intel only AMD stuff. Am busy buying up all the requirements so will let you know when done. Is there a Howto on RAID and mirroring I can be looking at?

 

sorry i just assumes because amd dont make 3ghz processors, i think theres a lvm guide in docs section bit which you may want to check out theres is also a raid howto in the documentation tips and tricks

 the external networked raid stuff was either on these or www.2cpu.com  as a discusion alternative for big san's though it was interesting in theory and alternative to the new sas disks but probably a bit much at your level

http://www.gentoo.org/doc/en/lvm2.xml

----------

## GeoffOs

Found this handy script to run as a cron job to check the status of the raid

```

#!/bin/sh

#

# monitor raid-devices (every night at 4 am)

# cron automatically sends mail if there's an error

#

# http://homex.subnet.at/~max/

# 

# checking for stuff like [_U] or [U_]:

/bin/grep -q '\[.*_.*\]' /proc/mdstat

if [ $? == "0" ]; then

 # found something like [_U]:

 

 mdstat=`/bin/cat /proc/mdstat`

 machine=`/bin/hostname`

 

 /bin/echo "WARNING for ${machine}: Some RAID arrays are running in degraded mode!"

 /bin/echo "Below is the content of /proc/mdstat:"

 /bin/echo

 /bin/echo "$mdstat"

fi

# checking for (F):

/bin/grep -q '\(F\)' /proc/mdstat

if [ $? == "0" ]; then

 # found (F):

 

 mdstat=`/bin/cat /proc/mdstat`

 machine=`/bin/hostname`

 

 /bin/echo "WARNING for ${machine}: Some disks seem to have failed!"

 /bin/echo "Below is the content of /proc/mdstat:"

 /bin/echo

 /bin/echo "$mdstat"

fi
```

----------

## trossachs

I guess I should just add a line, requesting to be sent a mail when the cronjob is complete?

----------

## GeoffOs

I though that if there was output from a cronjob then it would email you anyway?

Though now that you have said that, I think I will check

----------

## GeoffOs

I thought so, I checked by creating a script just echoing hello, which was then sent to me.

Though I do have a MAILTO enviroment variable set for cron, which means the output lands in my maildir

----------

## trossachs

It is this MAILTO environment I was thinking of using.

----------

