RAID 6 Backup Server with SAMBA (windows sharing), E-MAIL Monitoring (Ubuntu), and Remote Desktop


Hey,

Today I’m posting to list the tutorials / steps I used to create the a backup server for the Multimedia, Knowledge, and Web Technologies Group at Athens Information Technology – Athens.

A server resulting from the use of the tutorials below will:

  • be accessible from windows PCs.
  • be able to withstand two disk failures without loss of data.
  • e-mail the administrator upon disk failure within the RAID array to take preventive steps.
  • e-mail the administrator on a scheduled basis with disk statuses outlining bad sectors.

So on to the actual good stuff…

Steps/Tutorials

1) Setting up Raid
http://www.ainer.org/raid-5-6-install-setup-configuration-guide-for-ubuntu-10-04-lts-lucid-lynx

2) Raid Monitoring with SSMT (E-Mail)
http://blog.agdunn.net/?p=383

3) Testing RAID Failure
http://www.jfamiglietti.com/john/?p=213

4)Setup SAMBA SERVER
http://www.liberiangeek.net/2011/04/share-files-folders-ubuntu-11-04-natty-narwhal/

5)Hard-Drive-Monitor-Script:
http://www.howtogeek.com/51848/hard-drive-monitor-script-for-headless-linux-servers/
For 5) I modified the script to e-mail me every day at 12 with the bad sectors of each disk regardless of a threshold, but ofcourse this is up to each person’s preference:

#!/bin/bash
########Email function########
email_admin_func()
{
/usr/sbin/ssmtp -t < $temp_email_file
echo “Sent an Email to the Admin”
}

init_to_temp_func()
{
echo “To: me@domain.com” > $temp_email_file
echo “From: server@domain.com” >> $temp_email_file
echo “Subject: MKWT ” $1 >> $temp_email_file
echo “” >> $temp_email_file
}

write_to_temp_func()
{
    echo $1 >> $temp_email_file;
}

smartc_func()
{
/usr/sbin/smartctl -A /dev/$1 | grep Reallocated_Sector_Ct |tr -s ‘ ‘|cut -d’ ‘ -f11
}

########End of Functions########

########Set working parameter########
temp_email_file=/tmp/smart_monitor.txt
allowed_threshold=5 #set the amount of bad sectors your willing to live with, recommended 5.

########Engine########
init_to_temp_func
for i in sda sdb sdc sdd sde sdf ; do # Add or subtract disk names from this list as appropriate for your setup.
    write_to_temp_func “$i has “`smartc_func $i`” bad sectors.”
done
email_admin_func
cat $temp_email_file

In order to modify what the e-mail contains, the smartc_func() function can be modified which calls smartctl and pipes it to grep.

6)Remote Desktop
http://scarygliders.net/2011/09/23/install-xrdp-and-x11rdp-the-comprehensive-howto-for-ubuntu-and-debian-based-systems/

The installation went fine but there were authentication issues due to the .Xauthority file missing. For those facing this problem the following from(http://ubuntuforums.org/showthread.php?t=1138337) will help:

“Create a blank .Xauthority file in the home directory of the user you are connecting with. Be sure to log in as that user (either graphically, or via the terminal), then run:

touch ~/.Xauthority
chmod 600 ~/.Xauthority” - TwistedLincoln

7) Configure RAID Autostart / Automount

There is a possibility you may turn on your Server and see the RAID is not mounted. In this case the threads below are very useful:
I can not autostart and automount software RAID -http://ubuntuforums.org/showthread.php?t=1312539
Auto Mounting RAID Arrays on Linux Server Startup-http://www.linuceum.com/Server/srvRAIDAuto.php

It took some time to configure but was well worth the effort!

Some Pictures:

Happy Server Building,

Menelaos


About these ads
By Menelaos Bakopoulos Posted in Servers

7 comments on “RAID 6 Backup Server with SAMBA (windows sharing), E-MAIL Monitoring (Ubuntu), and Remote Desktop

  1. Menelaos, greetings!

    Likewise,glad my RDP article was also useful :)

    What version of Ubuntu are you using? Since I wrote that article, I produced an updated one based on Ubuntu 11.10.

    Regards from Scarygliders

    • Hey kevin.

      I used 10.04 LTS…latched onto “long term support :D though I guess it’s old now.
      Only remaining issue I have is I’ve been trying to get the clipboard working when connecting from Windows 7 –> XRDP… but zip. I admit though I haven’t had time to debug/search fully yet – it’s on the list.

      Cheers for the article – going to check the new one also!
      Menelaos

  2. Pingback: Not bad for a setup on an old IBM thinkcenter A50 | Menelaos Bakopoulos

  3. This is really interesting, You are a very professional blogger.
    I’ve joined your feed and look forward to looking for extra of your fantastic post.

    Additionally, I have shared your web site in my
    social networks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s