Tag Archives: Ubuntu

Check hardware RAID array status on Ubuntu Server

Here’s a post I’ve been sitting on for a bit over two years.  I was doing some clean-up/organization on my hard drive today and I ran across the text file with the notes that I made.  :-P

We have some Dell servers running Ubuntu Server on a RAID array.  It is necessary to be able to check on the status of the RAID array programmatically and fire off alerts if one of the disks fails.

This is actually pretty easy to accomplish.

First, install the mpt-status package (sudo aptitude install mpt-status).

Then, load the mptctl kernel module (sudo modprobe mptctl).

Find the SCSI ID for your disk array (sudo mpt-status -p).  For me, it was “2.”

Get a RAID status report with mpt-status -i 2 (where “2” is the SCSI ID from the previous step).  mpt-status should be run as the root user. You can add the -n flag to get some additional information in the output, including the percent completion of an in-progress rebuild operation.

The exit code for mpt-status will be 0 if everything looks good or something else if there is a problem.

Upgrade from Ubuntu 11.10 “Oneiric” to Ubuntu 12.04 LTS “Precise” fails with error: “Couldn’t configure pre-depend libtinfo5 for libncurses5, probably a dependency cycle.”

…Of course, the error doesn’t come until after a few hours of downloading all of the new packages.

Yet another Ubuntu upgrade bug not solved in time for release.  The details are in the bug report here.  I don’t understand how this bug has been known since February and not fixed in time for release.

The workaround: Download and install the Ubuntu 12.04 versions of libtinfo5, libncurses5, and libncursesw5 (in that order).  You will have unresolved dependencies until you install all three, but you should be able to do them one by one with dpkg -i.  (Do not just double-click and use the graphical Ubuntu software manager; use dpkg -i from the terminal.) After they are installed, run the distribution upgrade like normal.

Migrating an Ubuntu installation from BIOS to UEFI

For this article, I am assuming that you are comfortable getting around Linux in general and Ubuntu in particular, and are familar with the ins and outs of disk partitioning. I will be describing the steps that I took to make this happen, but not going into too much detail for each individual step. See the bottom of this post for some useful links if you’d like to read up on the topic first. Note that it is very possible to lose your partitions when doing this sort of work so proceed carefully and do not blame me if something goes awry.

Continue reading Migrating an Ubuntu installation from BIOS to UEFI

Plesk 10 on Ubuntu 10.04 – Can’t restart DNS service error

Today, I installed the new Parallels Plesk 10.0.1 on Ubuntu Server 10.04. This is the first release of Plesk that supports any version of Ubuntu newer than 8.04. Anyway, after the install, I went to log in and filled out the initial setup information, and was then given this error:

Unable to restart Named: dnsmng failed: dnsmng failed: dnsmng: Service /etc/init.d/bind9 failed to restart

(What a great error message.)

Whoops. Turns out there’s a problem with the default Plesk configuration of the DNS server BIND (run it in a chrooted environment) and Ubuntu’s configuration (run it with AppArmor, explicitly configuring which files it is allowed to open). You have to give BIND permission to open the files in its chroot environment. The solution to this problem is to edit the file /etc/apparmor.d/usr.sbin.named and add these lines before the closing brace at the end of the file:

/var/named/run-root/etc/* rw,
/var/named/run-root/var/* rw,
/var/named/run-root/dev/* rw,

Then, reboot the machine and you should be good to go.

Automatic Security Updates Not Happening in Ubuntu Server (10.04)

I’ve actually run into two separate causes of this problem during my time running Ubuntu Server machines. And while I am discussing Ubuntu Server in this post, I see no reason why this same problem couldn’t affect the desktop version of Ubuntu, or maybe other Ubuntu variants (Kubuntu, Xubuntu, etc.).

The problem: You’ve enabled automatic security update installation, and yet, security updates are not being automatically installed.

Continue reading Automatic Security Updates Not Happening in Ubuntu Server (10.04)

MySQL, Tomcat 6, and Ubuntu 9.10: Blah

Trying to set up a JSP application on Ubuntu 9.10, using Tomcat 6 and MySQL 5.1 (both from the Ubuntu repositories).  I was getting a curious error when trying to get a connection to the MySQL database from the JDBC DriverManager:

SQLException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
SQLState: 08S01
VendorError: 0

After searching for a while and going through some solutions that didn’t work for me, I found the answer here.  I’m re-posting it because that answer is posted in Spanish.  :-P

All you have to do is open /etc/init.d/tomcat6 in your favorite text editor (as root), find the line that looks like TOMCAT6_SECURITY=yes, and change it to TOMCAT6_SECURITY=no.  Then, restart the Tomcat server (sudo service tomcat6 restart).  Ta da!!  MySQL connections are now working.

Now, there’s probably a better way to do this that doesn’t involve completely turning off “TOMCAT6_SECURITY,” but this seems fine for a small test project which is what I’m working on (it will eventually be deployed on the JBoss server).  I’ll be sure to update this post if I find it… or if you know anything, leave a note in the comments below.

Moving an Ubuntu Server install to another machine – where’d my network connection go?

Alright, this is actually a pretty simple problem, but only once you know which configuration files to look at.

I recently replaced the machine that powers this very web site with a better one.  This was my first migration since switching to Ubuntu Server last winter.  I essentially took the hard drive out of the old machine and plopped it in the new one, booted it up, and hoped for the best.  Since Linux is not as picky as Windows about being moved to a new set of hardware, I figured it would work out fine.

Sure enough, Ubuntu booted right up on the new machine without so much as a complaint.  However, network connectivity was gone.  The old machine was using a PCI Ethernet card, while the new machine had an on-board controller that I hoped to use.  Anyway, I took the PCI card from the old machine and put it in the new machine, and then the network connectivity was back.

Why wouldn’t Ubuntu just start using the on-board controller, though?

Continue reading Moving an Ubuntu Server install to another machine – where’d my network connection go?

FreeNX on Ubuntu 9.04 (jaunty) – What happened to my GNOME theme?

I have a home server that sits in my closet running Ubuntu 9.04. I regularly access it using NX. About a week ago, I arrived back from an extended trip, and noticed that a security update to the kernel had been installed and it was waiting for me to approve a reboot. After I rebooted, I logged back in, and… my GNOME theme was all messed up.

Continue reading FreeNX on Ubuntu 9.04 (jaunty) – What happened to my GNOME theme?