Long title I know…
So I finally setup a NAS using Ubuntu Intrepid (8.10) Desktop, at first I was looking into using a pre-built solution such as FreeNAS or Openfiler but that limited the boxes ability to do other things (like serving up webpages using LAMP, etc.) besides I like having a Desktop GUI that I can play with if things go wrong. So after figuring out what version of Ubuntu to use (Hardy for it’s LTS or Intrepid for latest and greatest) I decided on Intrepid.
My setup:
MoBo: Intel D865GBF Desktop Board
CPU: P4 3.0Ghz
RAM: 4×1GB G.Skill Sticks
VIDEO: FX5200 AGP card
IDE1: Seagate 250GB (ST380013A)
IDE2: Maxtor 250GB (Diamond Max Plus9)
SATA1: Western Digital 320GB (WD3200JD-22KLB0)
SATA2: Seagate 200GB (ST300822AS) – ***UBUNTU INSTALLED ON THIS ONE***
So I will be using IDE1,IDE2, & SATA1 for my RAID5 Array.
After a quick shout to the Ubuntu Community I found this wonderfully simple guide on setting up a RAID5 array using mdadm: http://bfish.xaedalus.net/?p=188
I did however run into one problem with the guide:
sudo mdadm –detail –scan >> /etc/mdadm/mdadm.conf
Which adds the following to my mdadm.conf file:
ARRAY /dev/md0 level=raid5 num-devices=3 metadata=00.90 UUID=13f95aef:9c364189:75b10d3a:87a53e2f
but after I’ve added that to the mdadm.conf and when I run the following:
sudo mdadm –examine –scan
mdadm: metadata format 00.90 unknown, ignored.
ARRAY /dev/md0 level=raid5 num-devices=3 UUID=13f95aef:9c364189:75b10d3a:87a53e2f
Notice: mdadm: metadata format 00.90 unknown, ignored.
So I had to remove “metadata=00.90” from my mdadm.conf file and I no longer get that message.
Anyone know why the metadata entry isn’t working?
And now on to setting up email notifications via Gmail – The easy way…
After spending literally hours trying to get postfix working and running into problems getting the SSL CA certificates working I gave up on postfix all together and started looking for an alternative, and after a few google searches I found one: http://www.manu-j.com/blog/wordpress-exim4-ubuntu-gmail-smtp/75/
This guide walks you thru setting up exim4 to work with Gmail, and it works perfectly, the only problem I ran into with this guide was that you need to comment out the whole “login:” section of /etc/exim4/exim4.conf.template like so:
#Commented out so that Gmail’s Public_name can equal “LOGIN”
#login:
# driver = plaintext
# public_name = LOGIN
#.ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
# Return empty string if not non-TLS AND looking up $host in passwd-file
# yields a non-empty string; fail otherwise.
# client_send = “<; ${if and{\
# {!eq{$tls_cipher}{}}\
# {!eq{PASSWDLINE}{}}\
# }\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}”
#.else
# Return empty string if looking up $host in passwd-file yields a
# non-empty string; fail otherwise.
# client_send = “<; ${if !eq{PASSWDLINE}{}\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}”
#.endif
#####################################################
### end auth/30_exim4-config_examples
#####################################################
Now simply edit your /etc/mdadm/mdadm.conf file to read:
# instruct the monitoring daemon where to send mail alerts
MAILADDR {YourEmailAddress_Where-you-want-mdadm-notifications-sent@email.com}
Now you should be all set give it a test by running:
sudo mdadm –monitor –scan –test
And you should have an email within minutes
January 4, 2009 at 4:56 pm |
Here is another way of getting eMail from your system .. seem to be even more simple method. And works great with mdadm.
http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/
January 4, 2009 at 10:24 pm |
Thanks Jari,
I wish I would’ve found that post earlier, as it does seem a bit easier to implement…
Maybe I use this solution on the next rig I setup, but for now exim4 works for me
Thanks again,
-BassKozz
February 16, 2009 at 9:13 pm |
Hey basskozz!
My server is sending email through Gmail like the guide you you showed in here. I also notice that you were having problems with the server sending local mail like (root@yourserver or username@yourserver) to Gmail. Were you able to fix this?
March 16, 2009 at 9:30 am |
@ Patrick,
Nope still haven’t figured it out
April 22, 2009 at 2:08 am |
I can tell that this is not the first time you mention this topic. Why have you decided to touch it again?
April 22, 2009 at 3:20 pm |
Not sure what exactly your referring to?
June 5, 2009 at 3:35 am |
Thanks for this post Basskozz.
Just a thought, instead to remove “metadata=00.90” from your mdadm.conf file, replace it by “metadata=0.90”. mdadm will work fine. This error seems related to a bad metadata formatting by mdadm when it is called to write raid array information on mdadm.conf. It should be fixed on next 2.6.8 release.
Have a look on this post for more informations: http://ubuntuforums.org/showthread.php?t=1007464
August 26, 2009 at 10:40 am |
A better email solution is to create a file named “.forward” (that’s “dot-forward”) in root’s root directory (that is, the file should be /root/.forward).
The content of this file is a single line… your complete “real” email address in the outside world.
Now, when ANYTHING in the server wants to send administrative email (which it sends to root), it will be re-directed to your real email address.
-eof-
August 26, 2009 at 5:21 pm |
Thanks Roger,
I’ll give that a shot.
-BassKozz
October 4, 2009 at 11:23 pm |
Thanks for the guide!