Fix for bad write performance with LUKS + RAID5

After setting up a new fileserver with an LUKS encrypted dataset on top of Linux software RAID5 I did some benchmarks and reliability testing before filling it up with “real” data… but it turns out write performance was quite horrible. Only a fraction of what the “raw” RAID5 could do, all while having the CPU mostly idle. So what’s going on?

Apparently only small blocks of data get written to the disks when using LUKS encrypted volumes (mostly default settings) therefore dramatically reducing write performance (figured it out thanks to this) on my RAID 5 volume. Setting the stripe_cache_size from 256 to 8192 increased throughput from roughly 50-70 MB/sec to well above 200 MB/sec.

echo 8192 > /sys/block/md0/md/stripe_cache_size

To permanently set it, so you don’t have to manually adjust it after every reboot, consider setting up a udev rule like this:

/etc/udev/rules.d/md-stripe-cache.rules

SUBSYSTEM=="block", KERNEL=="md*", ACTION=="change", TEST=="md/stripe_cache_size", ATTR{md/stripe_cache_size}="8192"

CUPS and Canon Pixma: Printer hangs after first page

After updating my Ubuntu desktop to a more recent release (12.04 / Precise Pangolin), my rarely used Canon Pixma MP190 stopped working. Not completely, but in a rather annoying way: Printing a single page works fine, but printing multiple pages / copies causes the printer to hang. Hard. As in, you have to pull the power plug to reset it, as no button will do anything anymore.

Apparently there was a bug introduced with CUPS a while ago, or rather a change in behavior of CUPS which triggers a bug in the printer Firmware. Took me a couple hours to find and had me on the brink of throwing out the whole printer.

And it looks like it affects quite a few other USB printers as well:  Epson NX130, Canon i550, i560, ip4200, ip4300, ip5200, MP180, MP160, MP210, MP450, MP500, MP520, …

To save you from reading through all the comments: Till Kamppeter came up with a workaround that worked perfectly for me and others.

In a terminal window, run the command

lpadmin -p  -o usb-unidir-default=true

with  being the name of your printer as displayed
by the "lpstat -p" command.

Now turn off and turn on your printer, then try to print several jobs.

 

After that I was able to print a couple hundred envelopes without a hitch.

 

Fallout New Vegas, Honest Hearts: No more sound using wine-1.3

After installing the Honest Hearts DLC for Fallout New Vegas, all of the sudden the in-game sound stops working the second I load a savegame. Running FalloutNV.exe from the console, I get tons of these as soon as the game goes mute:

fixme:quartz:Parser_QueryInterface No interface for {2dd74950-a890-11d1-abe8-00a0c905f375}!
fixme:quartz:Parser_QueryInterface No interface for {2dd74950-a890-11d1-abe8-00a0c905f375}!
fixme:quartz:Parser_QueryInterface No interface for {2dd74950-a890-11d1-abe8-00a0c905f375}!
fixme:quartz:Parser_OutputPin_QueryInterface No interface for {56a868a5-0ad4-11ce-b03a-0020af0ba770}!
fixme:quartz:Parser_OutputPin_QueryInterface No interface for {56a868a5-0ad4-11ce-b03a-0020af0ba770}!
fixme:quartz:Parser_QueryInterface No interface for {2dd74950-a890-11d1-abe8-00a0c905f375}!
fixme:quartz:Parser_QueryInterface No interface for {2dd74950-a890-11d1-abe8-00a0c905f375}!

As a quick workaround, go into your Wine configuration, create a custom application setting for Fallout if you haven’t already, click the Libraries tab and add an override for quartz.

Native then Builtin did the trick for me.

HP ProLiant management tools for Ubuntu / Debian based server

So you just got yourself a brand new and shiny HP ProLiant server to play with, installed your favorite distribution and life is good. Except… unless your distribution of choice is RHEL or SuSE, there’s no way to monitor or even configure all those nice little gadgets that made you go with a ProLiant server instead of some random white box server.

If you go to the HP support site to download drivers and software, usually all you get is a choice between various versions of Windows, NetWare (anyone still using that?), Solaris, VMware ESX and for Linux: RHEL and SuSE. Sure, you can convert the RPM packages to deb using alien, but it’s kind of a PITA and doesn’t necessarily work reliably. Wouldn’t it be much nicer if there were packages for Ubuntu or Debian?

Guess what? There are packages for Debian based systems. There’s even a repository containing all the versions and architectures you need. But for some reason unbeknown to man, HP decided not to put it in there with the other OSes, but hide it instead.

Just add this to your APT sources (/etc/apt/sources.list or equivalent):

deb http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/ lucid current/non-free

(nothing for Maverick yet, but the packages for Lucid worked just fine for me)

Then run apt-get update and install any of the packages you might need:

cpqacuxe
hp-health
hpsmh
hp-smh-templates
hp-snmp-agents
hpacucli
hponcfg

Say you want to monitor your servers temperatures using Monitorix or check your fan-status and PSU redudancy:

# apt-get install hp-health
# hplog -t
ID     TYPE        LOCATION      STATUS    CURRENT  THRESHOLD
 1  Basic Sensor I/O Zone        Normal   114F/ 46C 158F/ 70C
 2  Basic Sensor Ambient         Normal    68F/ 20C 102F/ 39C
 3  Basic Sensor CPU (1)         Normal    86F/ 30C 260F/127C
 4  Basic Sensor CPU (1)         Normal    86F/ 30C 260F/127C
 5  Basic Sensor Pwr. Supply Bay Normal   123F/ 51C 170F/ 77C
 6  Basic Sensor CPU (2)         Normal    86F/ 30C 260F/127C
 7  Basic Sensor CPU (2)         Normal    86F/ 30C 260F/127C

Or take a look at your internal cciss RAID configuration, see if all disks are still in working condition or change your array setup without having to reboot your server to do it at the BIOS level:

# apt-get install hpacucli
# hpacucli ctrl all show status
 Smart Array P400 in Slot 1 
 Controller Status: OK
 Cache Status: OK 
 Battery/Capacitor Status: OK

Change your iLO parameters or reboot the management processor if it got stuck for some reason?

apt-get install hponcfg
# hponcfg -h
Firmware Revision = 1.94 Device type = iLO Driver name = hpilo
HPONCFG RILOE II/iLO setup and configuration utility
Version 3.1.0 (c) Hewlett-Packard Company, 2010

hponcfg  -?
hponcfg  -h
hponcfg  -m minFw
hponcfg  -r [-m minFw ]
hponcfg  [-a] -w filename [-m minFw]
hponcfg  -g [-m minFw]
hponcfg  -f filename [-l filename] [-s namevaluepair] [-v] [-m minFw]
hponcfg  -i [-l filename] [-s namevaluepair] [-v] [-m minFw]

-h,  --help           Display this message
-?                    Display this message
-r,  --reset          Reset the RILOE II/iLO to factory default
-f,  --file           Get/Set RILOE II/iLO configuration from "filename"
-i,  --input          Get/Set RILOE II/iLO configuration from the XML input
                      received through the standard input stream.
-w,  --writeconfig    Write the RILOE II/iLO configuration to "filename"
-a,  --all            Capture complete iLO configuration to the file.
                      This should be used along with '-w' option
-l,  --log            Log replies to "filename"
-v,  --xmlverbose     Display all the responses from RILOE II/iLO
-s,  --substitute     Substitute variables present in input config file
                      with values specified in "namevaluepairs"
-g,  --get_hostinfo   Get the Host information
-m,  --minfwlevel     Minimum firmware level

Way better than having to unwrap the documentation packages and pop in a CD or having to find and download a RPM, upload it to your server, convert it with alien and hope it kinda works, isn’t it?

Getting Fallout New Vegas to work with Wine

If you can’t wait to play the newest iteration of Fallout, yet don’t want to boot Windows to do it – with a little effort you can get it running under Wine as well.

It doesn’t seem to work out of the box, even with a very recent release (Failed to initialize renderer. Unknown error creating the GamebryoRenderer.)

But if you don’t mind adding a little patch and compiling Wine yourself, you should be able to get Fallout New Vegas up and running in no time.

WineHQ Bug 24831 describes the problem and someone else came up with a fix just a few hours later. But if you’re running Ubuntu 10.10, sadly the patch doesn’t apply right away. To manually fix it, just get the Wine source package and edit the file ‘dlls/d3d9/directx.c’, go to line 477, remove or comment out this part

*device = NULL;

return D3DERR_DRIVERINTERNALERROR;

and substitute it with this:

return IDirect3D9Ex_CreateDevice(iface, adapter, device_type, focus_window, flags, parameters, (void *)device);

Save the file and run ‘dpkg-buildpackage’ and when finished, install the resulting .deb.

(Or just download my modified directx,c and save it to wine1.2-1.2.1/dlls/d3d9/directx.c before compiling)

That’s it. Enjoy your stay in New Vegas. :)