Archive for the ‘server’ Category

Flashing an LSI 9211-8i IR card with IT Firmware

November 9th, 2014 No comments

I purchased a brand new, sealed LSI 9211-8i card from a vendor on eBay at a much better price than at my normal (ie Newegg, Amazon) places. Unfortunately, when I went to flash it from IR to IT firmware I kept receiving a “Failed to Validate Mfg Page 2” error.

Lots of Googling later, I finally found a method that worked to revive the card. Since my process was slightly different from the dozens of methods I found, I’m going to add another revision to the internet (and for my future reference).

The card was probably an OEM design, misleadingly sold as a retail LSI card, but I decided to keep it because I was able to get it working reliably.

Here’s my firmware update process:

  1. create a bootable USB flash drive using Rufus
  2. copy the following items to the bootable flash drive
    1. Megarec DOS utility and Dell SBR file from (Toolset_PercH310 to
    2. DELL 6gbtsas firmware and DOS flash utility from (Firmware Package Version:
    3. LSI 9211-8i P7 firmware and DOS flash utilty from LSI website (navigate to downloads for 9211-8i, choose archived)
    4. LSI 9211-8i P19 firmware and DOS flash utility from LSI website (navigate to downloads for 9211-8i, choose current)
  3. Follow the instructions at with the following changes:
    1. get the SAS address
      1. megaoem -AdpAllInfo -aAll -page 20
    2. flash a dell sbr file with megarec
      1. megarec -writesbr 0 sbrempty.bin
    3. clear the flash with megarec
      1. megerec -cleanflash 0
    4. hard reboot
    5. flash the Dell firmware using the Dell utility
    6. hard reboot
    7. flash using the P7 dos utility and firmware
    8. flash using the p19 DOS utility, firmware, and bios
    9. hard reboot
    10. set the SAS address
    11. verify with sas2flsh -list

To perform this process I _had_ to use a DOS bootable USB flash drive because of the P7 DOS utility. It appears that the P7 UEFI utility is either missing or never existed on the internet. Also the DOS megarec utility was a requirement, the process didn’t work without the erase and sbr commands. Another requirement was a motherboard which was compatible with both the sas2flsh.exe DOS utility and the 9211-8i card. After PAL errors on four motherboards (3 intel, one AMD), I found an AMD motherboard which worked, the ASUS M2N-MX.

The entire process was time consuming and a frustrating experience. Here’s hoping LSI releases a simple, raidless, affordable 8+ port SATA card in the future.

Update (2016-04-17)

I successfully flashed a Dell H310 using the instructions and files at using a UEFI firmware desktop.



Categories: hardware, server

Ubuntu 12.04 LTS on an Apple Mac Mini (Late 2012)

November 4th, 2012 28 comments

I’m switching my web hosting to a Mac Mini running Ubuntu Linux. These are my notes for getting it set up.

Here’s the hardware specs:

  • Apple Mac Mini 6,2 (Late 2012)
  • Intel Core i7-3615QM 2.3 GHz quad-core processor
  • 16 GB DDR3-1600 memory
  • 128 GB solid state drive
  • 1 TB 5400 RPM hard drive

The Mac Mini is built to run OS X 10.8, but Ubuntu 12.04.1 runs nicely with a couple of tweaks.

  • Installing required the “noapic” flag (F6 when at the boot menu)
  • Set “Boot after power failure” by running the following, and adding it to /etc/rc.local:
    setpci -s 0:1f.0 0xa4.b=0
  • Fan control doesn’t work without applesmc and macfanctld installed from Ubuntu’s Mactel PPA
  • the network card doesn’t work out of the box, you need to download/compile a new version of the tg3 module from Broadcom

For networking, I didn’t want to have to remember to recompile the module after reinstalling each kernel. I setup DKMS to take care of it automatically.

  • Download the Linux “tg3” driver from Broadcom (version 3.124c (10/18/12) at the time of this writing)
  • Extract it
  • Navigate to Server/Linux/Driver/tg3-3.124c.tar.gz
  • Extract that file to /usr/src/tg3-3.124c/src/
  • Create a file called /usr/src/tg3-3.124c/dkms.conf with the following contents:
CLEAN="make -C src/ clean"
MAKE="cd src/ && make BUILD_KERNEL=${kernelver} KVER=${kernelver}"
  •  Add the module to DKMS so that it’s automatically built for new kernels:
sudo dkms add -m tg3 -v 3.124c
sudo dkms build -m tg3 -v 3.124c
sudo dkms install -m tg3 -v 3.124c
  • The module is now ready, either load it with “modprobe tg3” or reboot
  • If you need to remove it at a later time, do:
sudo dkms remove -m tg3 -v 3.124c --all

After these changes the Mac Mini is working great. I didn’t test Wi-Fi, Thunderbolt, or Sound, since I won’t be using them. USB works as far as being able to connect a keyboard and mouse, and Ubuntu’s 12.04.1 LiveCD boots into the full desktop.


Ubuntu has released 12.04.2 install/live CDs based on kernel version 3.5. I have not tested the above instructions with kernel 3.5, so if you’re following them you probably want to stick with the 12.04.1 install ISOs with kernel 3.2. If you install from 12.04.1, you will automatically stay on 3.2 even when updating to 12.04.2.

Update 2 (2014-10-05):

Ubuntu 14.04 and 12.04 with the Trusty hardware enablement stack (installed by default from the 12.04.5 ISO) have the required tg3 driver and do not need the custom DKMS config above.


Categories: server

Web Hosting on a Mac Mini

November 4th, 2012 No comments

The new Mac mini is out (Late-2012 model), and I’m going to give Macminicolo a try. I’m moving from the dedicated server I’ve been on for the last two years:

  • quad-core 2.83 GHz (Intel Q9550)
  • 8 GB DDR2-800
  • dual 500 GB 7200RPM SATA drives with a hardware mirror (RAID 1)
  • Ubuntu 10.04 LTS

to the faster Mac mini:

  • quad-core 2.3 GHz (Intel Core i7-3615QM)
  • 16 GB DDR3-1600
  • 128 GB SSD
  • 1 TB SATA
  • Ubuntu 12.04 LTS

I’m moving because it’s less expensive and faster. Due to having to buy the Mini, my break-even point is in 12 months, but after that I’m saving money.

Compared to Amazon EC2, after two years I will have paid roughly the same as a Medium instance (2 CPU, 4GB RAM) with the 1/year reservation discount. The Mac Mini is much faster, but then, Amazon offers a lot more (paid) services and options.

The downside is that there’s no redundancy built into the Mac mini, and I become responsible for hardware failures. There’s a year of warranty built into the Mini, but after that there’s a chance I’ll be buying a new one, and my predicted savings will be pushed back a year. In case of a hardware failure, I’ll temporarily move to Amazon EC2. Being instantly available is worth the extra cost in that case.




Categories: server, websites

Linux Software RAID10 Benchmarks

January 31st, 2010 1 comment

Tests are done across four 7200RPM SATAII drives on a PCI-X card sitting on a PCI (32-bit, 133MB/sec theoretical max) bus, probably the slowest bus configuration possible, and then again after being moved to a motherboard with dual PCI-X slots. Server is running Ubuntu 9.10 AMD64 Server.

Benchmark is a simple ‘dd’ sequential read and write.

write: dd if=/dev/zero of=/dev/md2 bs=1M
read: dd if=/dev/md2 of=/dev/null bs=1M

mdadm –create /dev/md2 –verbose –level=10 –layout=n2 –raid-devices=4 /dev/sd[ftlm]1

write: 13.2 MB/s 144 MB/s
read: 4.0 MB/s 89.3 MB/s

mdadm –create /dev/md2 –verbose –level=10 –layout=f2 –raid-devices=4 /dev/sd[ftlm]1

write: 48.3 MB/s 131 MB/s
read: 92.7 MB/s 138 MB/s

mdadm –create /dev/md2 –verbose –level=10 –layout=o2 –raid-devices=4 /dev/sd[ftlm]1

write: 47.4 MB/s 135 MB/s
read: 98.7 MB/s 142 MB/s

And more comparisons:


write: 38.9 MB/s
read: 64.8 MB/s

Single Disk (PCI)

write: 59.4 MB/s
read: 71.9 MB/s

Categories: file systems, server

Tripwire on Ubuntu 6.06

December 23rd, 2007 No comments

Quick instructions to getting Tripwire installed and running on Ubuntu 6.06 LTS (Dapper Drake). For more detailed instructions check out this site.

1. Install Tripwire. Say Yes to everything, and create some passwords.

% sudo apt-get install tripwire
% sudo tripwire -m i

2. Fix the policy. I was getting many errors that looked like:

### Warning: File system error.
### Filename: /root/.Xauthority
### No such file or directory

I removed the non-existent files from the policy file with the following commands:

% sudo cp /etc/tripwire/twpol.txt /etc/tripwire/twpol.txt.bak
% sudo vim /etc/tripwire/twpol.txt
% sudo tripwire --update-policy -Z low /etc/tripwire/twpol.txt

Later, when you need to update the database, such as after running updates (adjust the date and number from then end of the file, or sometimes you can just drop the whole -r flag):

% sudo tripwire -m u -r /var/lib/tripwire/report/closetbox64-20071223-133927.twr

By default, Tripwire will be set to email whenever it sees changes. To quickly check the status, run:

% sudo tripwire --check

Categories: howto, server

Run a Command on Boot for Ubuntu

October 10th, 2007 No comments

I used this to start fetchmail on an Ubuntu 7.10 server running Request Tracker.

Edit /etc/rc.local, add your command, make sure it doesn’t create any output. This is my command:

su rt -c “fetchmail -d 300” > /dev/null 2>&1

It starts a background fetchmail process as the “rt” user, just as the Request Tracker documentation states.

Categories: server

Speed Up Rebuilding Linux Software RAID Arrarys

May 16th, 2007 No comments

# cat /proc/mdstat

md0 : active raid5 sdf1[7] sdb1[0] sde1[5] sdg1[4] sdh1[3] sdd1[2] sdc1[1]
1465175424 blocks level 5, 64k chunk, algorithm 2 [7/6] [UUUUUU_]
[>………………..] recovery = 1.3% (3331200/244195904) finish=2357.0min speed=1700K/sec

Ouch. Two files are used to control the speed of rebuilding RAID arrays in Linux.


Even though my _max file is set to 200,000K/sec and my system is not doing anything, my RAID 5 rebuild process is hovering around the _min rebuild speed, of 1,000K/sec. With my setup this will take approximately 40 hours to complete, which is too long for me to wait. So, I pushed the _min speed up to 10,000K/sec, which will now take 6 hours to finish, and use slightly more of my system’s idle resources.

root# echo “10000” > /proc/sys/dev/raid/speed_limit_min

Later I set _min to 50,000K/sec, and the rebuild speed topped out at 25,000K/sec.

#cat /proc/mdstat

Personalities : [raid5]
md0 : active raid5 sdf1[7] sdb1[0] sde1[5] sdg1[4] sdh1[3] sdd1[2] sdc1[1]
1465175424 blocks level 5, 64k chunk, algorithm 2 [7/6] [UUUUUU_]
[=>……………….] recovery = 5.1% (12661840/244195904) finish=149.9min speed=25726K/sec

The rebuild took less than 3 hours, down from the original 40.

Categories: file systems, server

Bug #59269 in lighttpd (Ubuntu): “lighttpd fails to restart during logrotate script”

November 4th, 2006 No comments

I had my first Ubuntu bug report confirmed and fixed by the Ubuntu team. The bug I encountered kept Lighty from coming back up when being restarted. Since the default logrotate scripts had Lighty restarting every night, this bug hit my Rails apps quite often. Extending the logrotate script’s rotate frequency helped, and I was about to install Monnit, but now it looks like I can skip that knowing the restart bug has been fixed. Hooray for well managed open source projects.

Categories: rails, server

Installing Django on Ubuntu 6.06

August 31st, 2006 3 comments

Steps for install Django on Dapper Drake with Apache2, MySQL5, and Python2.4 already installed:

  1. sudo apt-get install libapache2-mod-python python-mysqldb python-docutils
  2. wget
  3. tar xfz Django-0.95.tar.gz
  4. cd Django-0.95
  5. sudo python
  6. sudo python install
  7. start creating a Django app

Other notes:

  • python-setuptools included with Dapper is not recent enough for Django 0.95
Categories: server, software, web design

Backing Up

August 14th, 2006 1 comment

I finally ran a successful backup, which took 16 hours to grab ~750 GB of data. Future runs will be much shorter, as rsnapshot will only be grabbing changes. Scripts now run the backup when the machine is powered on, then email me the results and power the machine down. Next up, getting the machine to power up without me asking. I guess I need to invest in a WOL network card.

Categories: server