The below is a collaboration of useful information I’ve found while attempting to build and maintain a RAID5 array consisting of 4 HDDs. This tutorial is a work in progress and I’m learning everything as I go. I’ve left relevant links in each section for more information and if you spot anything that could be done better or that I’m missing let me know in the comments below!
Installing RocketRaid 2760a drivers on Ubuntu 12.10
So I don’t forget, here’s a tutorial on installing the RocketRaid 2760a drivers and management utilities on Ubuntu 12.10. I’m using 64-bit but 32-bit should be the same – just substitute where appropriate.
Installing the Driver
The installation disc comes with an out of date version of the driver and kernel module. The way the installation works, we need to download and compile the kernel module then download the driver installer, drop the module into place and run the installer. Make sure you have appropriate compiler tools installed – to be safe just run
sudo apt-get install ubuntu-dev-tools |
Download and extract the ones with kernel 3.x support from the HighPoint website:
mkdir ~/driver cd ~/driver # driver wget http://www.highpoint-tech.com/BIOS_Driver/RR276x/linux/Ubuntu/rr276x-ubuntu-11.10-x86_64-v1.1.12.0502.tgz tar -xvzf rr276x-ubuntu-11.10-x86_64-v1.1.12.0502.tgz # kernel module mkdir module cd module wget http://www.highpoint-tech.com/BIOS_Driver/RR276x/linux/RR276x-Linux-Src-v1.1-120424-1734.tar.gz tar -xvzf RR276x-Linux-Src-v1.1-120424-1734.tar.gz |
Build and compress the kernel module for our driver installer:
cd rr276x-linux-src-v1.1/product/rr276x/linux/ make # Ignore the warning about not being able to find him_rr2760x.o...doesn't seem to matter gzip rr276x.ko mv rr276x.ko.gz ~/driver/boot/rr276x$(uname -r)$(uname -m).ko.gz |
And finally install the driver
cd ~/driver sudo bash preinst.sh |
This step succeeded! Now you can press ALT+F1 to switch back to the installation screen!
sudo bash install.sh |
Update initrd file /boot/initrd.img-3.5.0-17-generic for 3.5.0-17-generic
Please reboot the system to use the new driver module.
sudo shutdown -r now |
That should be everything! You can now test with
cat /proc/scsi/rr276x/* |
Installing the RAID Management Software
Annoyingly the RAID management console is difficult to install to say the least. The GUI deb packages error when trying to install and HighPoint don’t even provide a deb for the command line version and to top it off the version of the command line utility on the driver CD is newer than the version on their site! For this reason I’ve provided the newer command line RPMs here.
Let’s get this thing installed.
Web version:
mkdir ~/driver/utility mkdir ~/driver/utility/console mkdir ~/driver/utility/web cd ~/driver/utility/web echo "rr276x" | sudo tee -a /etc/hptcfg > /dev/null wget http://www.highpoint-tech.com/BIOS_Driver/GUI/linux/WebGui/WebGUI-Linux-v2.1-120419.tgz tar -xzvf WebGUI-Linux-v2.1-120419.tgz sudo apt-get -y install alien sudo alien -d hptsvr-https-2.1-12.0419.$(uname -m).rpm sudo dpkg -i hptsvr-https_2.1-13.0419_amd64.deb |
Command Line version:
cd ~/driver/utility/console wget http://www.flynsarmy.com/wp-content/uploads/2012/11/LinuxRaidUtilityConsole.tar.gz sudo alien -d hptraidconf-3.5-1.$(uname -m).rpm sudo alien -d hptsvr-3.13-7.$(uname -m).rpm sudo dpkg -i hptraidconf_3.5-2_amd64.deb |
Run the web server:
sudo hptsvr |
You should now be able to connect to it from your browser by navigating to http://localhost:7402 with username RAID and password hpt.
Further Reading
HOWTO: Get GUI hptsvr & hptraid 3.13 working on Ubuntu
HighPoint driver download page for RocketRaid 2760a
Partitioning and Formatting New Disks in Linux
The below is a quick guide to creating partitions on a newly purchased, unformatted disk. For this guide I’ll be formatting a new WD 2TB Black.
Find the disk you want to partition
# lsblk |
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 55.9G 0 disk
├─sda1 8:1 0 53.6G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 2.3G 0 part [SWAP]
sdb 8:16 0 1.8T 0 disk
sdc 8:32 0 1.8T 0 disk
Partitions appear as subitems. Notice sdb and sdc have no partitions – those are the disks I want to format.
Create the partition
# sudo fdisk /dev/sdb |
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd3e43840.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won’t be recoverable.Warning: invalid flag 0×0000 of partition table 4 will be corrected by w(rite)
Command (m for help):
Below I’m using the default values to create one large partition for the whole disk.
n |
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extendedSelect (default p):
Using default response p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-3907029167, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3907029167, default 3907029167):
Using default value 3907029167Command (m for help):
All done? Write!
w |
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
That’s all for partitioning! Take a gander at your fancy new partitions:
# lsblk |
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 55.9G 0 disk
├─sda1 8:1 0 53.6G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 2.3G 0 part [SWAP]
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 1.8T 0 part
sdc 8:32 0 1.8T 0 disk
└─sdc1 8:33 0 1.8T 0 part
Format to NTFS
I’m choosing a quick format. You may choose instead to remove the -f argument for a proper one instead.
# sudo mkntfs -f /dev/sdb1 |
Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.
Optional: Name the drives
Because I’m running NTFS I can give the drives labels. Make sure you have ntfsprogs installed then enter:
# sudo ntfslabel -f /dev/sdb1 YourLabel |
More Information
For more information on partitioning check out Chris Wakefield’s post here.
For a short and sweet howto on formatting as NTFS check here.
Information on NTFS labels here.
Remove a PPA and roll back changes in Debian
If you’re a Ubuntu user, you may be familiar with ppa-purge. It’s a handy little automated script to remove a PPA and roll back the version of any apps installed from that PPA. Debian doesn’t have this nicety by default but there’s a relatively simple way to get something close.
Firstly, remove your PPA from /etc/apt/sources.list or from the /etc/apt/sources.list.d/ directory.
Do an update:
1 | sudo apt-get update |
Find any packages that are now obsolete:
1 | aptitude search '?obsolete' |
For me this returned the following:
# aptitude search '?obsolete' i A libmysqlclient18 - MySQL database client library i A mysql-client-5.5 - MySQL database client binaries i A mysql-server-5.5 - MySQL database server binaries and system database setup i A mysql-server-core-5.5 - MySQL database server binaries i A ruby-passenger - Rails and Rack support for Apache2 and Nginx |
Now just remove the listed packages with apt-get remove and reinstall as necessary. It’s not quite the automated tool that ppa-purge is, but it’s a pretty good start.
A few handy Exim commands
I’ve been getting alot of frozen messages with Exim and needed to find out what they were so figured I’d document a few handy commands for doing so:
List messages in queue:
1 | exim -bp |
Show message header/body:
1 2 | exim -Mvh <id> #For header exim -Mvb <id> #For body |
Delete all messages in queue:
1 | exim -bp | exiqgrep -i | xargs exim -Mrm |
How to add an application to the ‘Other Applications’ list in Ubuntu
It seems Gnome 3 removed the button allowing users to add specified applications into the ‘Other Applications’ list under ‘Open With’ in file properties. Until the functionality is restored, you can add applications manually by doing the below:
cp /usr/share/applications/gedit.desktop ~/.local/share/applications/your_app.desktop |
Modify the contents of your_app.deskop to look something like the below:
[Desktop Entry] Name=your_app GenericName=Your App Comment=Edit text files Keywords=Plaintext;Write; Exec=your_app %U Terminal=false Type=Application StartupNotify=true MimeType=text/plain; Icon=accessories-text-editor Categories=GNOME;GTK;Utility;TextEditor; Actions=Window;Document; X-Ubuntu-Gettext-Domain=your_app |
You can copy any .desktop file from /usr/share/applications so pick the one that closest resembles the application you’re adding. Below you can see komodo added to mine:
Change default ‘From’ email name from www-data in PHP
I’ve been seeing up an Amazon EC-2 server with Debian Squeeze and used tasksel to install Web Server and Mail Server. Like all things debian, this worked pretty well after the installation completed and everything ‘just worked’ however I wasn’t happy with the default from name and email address assigned to emails sent by PHP – www-data <[email protected]>.
I discovered a quick and simple fix to change these defaults for all mail sent with PHP:
Open /etc/php5/apache2/php.ini and set
sendmail_path = '/usr/sbin/sendmail -t -i [email protected] -Fno-reply' |
You can see a list of sendmail arguments and what they do here.
Restart apache and you’re good to go:
sudo service apache2 restart |
Use Apache Alongside Nginx Without Requiring a Subdomain
I’ve been looking for ways to speed up my site recently and came across this interesting article on seamlessly integrating nginx with Apache to handle asset files without requiring a CDN subdomain. This works by checking the requests file extension for .js, .jpg, .pdf etc and if not found, proxies the request to Apache and serves the results.
Benefits
You won’t need to modify all your pages/posts updating asset locations to point to a subdomain! Everything will ‘just work’.
Issues/Drawbacks
There are 2 issues I’ve found with this setup:
- Because Apache is now running on port 8080, your mod_rewrite redirects will now redirect to that port. You won’t be able to use RedirectMatch anymore, however below is the solution I came up with:
RewriteEngine on RewriteRule ^foo.php$ http://%{HTTP_HOST}:80/bar.php [R=301,L]
- You can no longer use .htaccess redirects for any asset files nginx is serving. Instead, use nginx redirects. Below is an example:
rewrite ^/foo.jpg$ http://173.255.221.210/bar.jpg permanent;
For more information on nginx redirects, see the official documentation.
Forward Email from a Specified Address
A couple of times now we’ve needed to forward [email protected] to [email protected]. If you’re running postfix here’s how to do that.
nano /etc/postvix/virtual |
Add
then run
postmap /etc/postfix/virtual |
If the above doesn’t work, make sure you have the following line in /etc/postfix/main.cf:
virtual_alias_maps = hash:/etc/postfix/virtual |
and type
service postfix reload |
Thanks to Matt Simmons of ServerFault for his answer.
Hide the Attention Button in Pidgin
Ever since the developers added the Attention button to Pidgin, one of the most common questions asked is how to remove it. I finally set some time aside to answer this question.
- Download the plugin that does exactly this from the Pidgin developer page.
- Install the Pidgin developer dependencies if you haven’t already:
sudo apt-get install ubuntu-dev-tools subversion g++ pidgin-data libpurple0 libpurple-dev pidgin-dev libgtk2.0-dev
This step is important or you’ll receive errors like the following:
$ make [CC] hide_attention_button.o Package pidgin was not found in the pkg-config search path. Perhaps you should add the directory containing `pidgin.pc' to the PKG_CONFIG_PATH environment variable No package 'pidgin' found Package purple was not found in the pkg-config search path. Perhaps you should add the directory containing `purple.pc' to the PKG_CONFIG_PATH environment variable No package 'purple' found Package gobject-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gobject-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gobject-2.0' found Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found hide_attention_button.c:24:20: fatal error: plugin.h: No such file or directory compilation terminated. make: *** [hide_attention_button.o] Error 1
- Drop the .c and Makefile into a folder and in a terminal run the following commands:
make sudo make install
If all went well you’ll see:
$ make [CC] hide_attention_button.o [SHLIB] hide_attention_button.so $ sudo make install mkdir -p /`pkg-config --variable=prefix purple`/lib/purple-2 install hide_attention_button.so /`pkg-config --variable=prefix purple`/lib/purple-2
Restart pidgin and enable the plugin under Tools – Plugins – Hide Pidgin Attention Button.
Close but not Perfect
Although this plugin really does hide your Attention button, it still exists if you hover over where it used to be:
At least it’s much smaller now and less likely to be accidentally clicked!


