Feb 23 2012
RAID 6 Backup Server with SAMBA (windows sharing), E-MAIL Monitoring (Ubuntu), and Remote Desktop
This is in need of an update due to dead links and deprecated content.
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: [email protected]" > $temp_email_file
echo "From: [email protected]" >> $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





February 24, 2012 @ 12:47 am
Howdy Menelaos,
I’m quite happy to hear that my guide was of use to you!
Take care, and cheers from Cascadia!
daemox
February 24, 2012 @ 2:53 am
Greeting from Greece!
Thanks, your guide was what I based my initial setup on :).
Very well written and useful indeed:D!
Hope all is well there!
Menelaos
March 6, 2012 @ 1:14 am
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
March 6, 2012 @ 1:25 am
Hey kevin.
I used 10.04 LTS…latched onto “long term support 😀 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
Not bad for a setup on an old IBM thinkcenter A50 | Menelaos Bakopoulos
August 8, 2012 @ 3:38 am
[…] 1) http://mbakopoulos.wordpress.com/2012/02/23/raid-6-backup-server-with-samba-windows-sharing-e-mail-m… 2)http://mbakopoulos.wordpress.com/2012/03/07/how-to-totally-disable-suspendhibernation-in-ubuntu-if-all-else-fails/ […]
November 25, 2013 @ 3:27 pm
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