Last confirmation about the defect disk. (Updated)

Clearing the disk

In preparation of sending the Samsung hard disk back to the dealer as a warranty issue, I cleared the whole disk with a “dd” command (dd if=/dev/zero of=/dev/sdb bs=64k). I monitored the process by running vmstat 10 in another terminal window. The resulting bo-column (block out) is reflected by the diagram to the right.

The whole operation took roughly 4 hours and 10 minutes. The drive operated at full for the first third, than things obviously got flaky. The same effect I saw with my file system copy operations. Large periods where the drive operates with only 4 — 6 Mb/s output rate.

Hopefully this will be prove enough for the dealer to replace the drive.

Zeroing replacement drive

Update: In the meantime I’ve received a replacement drive. Just to see, if this drive was ok, I repeated the zeroing of the complete drive. I’m assuming, that the minor hiccup at the beginning doesn’t mean any problems.

Heureka, I’ve found it …

Since I’ve build my PC in the beginning of 2008 I’ve been struggling with the disc write performance. Evidence of my problems are these posts: here, here and here and here.

According to the changelogs of the recently released Linux kernels, there were quite a bit of changes in the ext3/ext4 file systems. Therefore in the beginning of October I moved all my file systems from XFS to Ext4 in the hope for things to get better. Once the data was restored the situation was as bad as before, it even felt a bit worse. During this backup and restore process for the first time it dawned on me, that my Samsung F1 hard disk might be the culprit. In particular once I looked at the S.M.A.R.T. data with GSmartControl.

S.M.A.R.T. Data Hardcopy
When I looked at the data for the first time after the restore operation, the data looked much than in this screenshot. There recoverd ECC and Soft Errors in 6-7 digit numbers. However never ever did I see that the disk reported an error to the operating system.

And, what I probably should have considered earlier, that the transfer to the external ESATA drive always worked with top performance, the copy back process to the original disk than was awful again. I even went so far to copy the OS to another external USB drive to remove the OS from the equation. I booted from the USB drive and redid the backup and restore operation. Again with the same result, that the Samsung disk showed a very bad write performance. This was when I finally decided to order another hard drive. Tom’s Hardware gave Samsung Spinpoint F3 pretty good marks and that’s the one I ordered then.

Gkrellm Snapshot
And what can I say? My problems were gone, completely and utterly gone. Look at the little Gkrellm screenshots on the right. The left half shows the copy process from the old, “bad” disk (top half) to “good” new disk. As you can see, the new disk is even faster than the old one. The right half however shows the copy process from the “good” F3 disk to the “bad”, old F1 disk. Here you can observe the very low write performance of the old F1 disk (top half).

Then I obtained the Samsung hutil disk utility and did a low level reformatting of the old F1 disk and also did self diagnostic with a complete surface scan. Both operation didn’t show any problem whatsoever. I redid some copy operations to the old F1 and the new F3 disks and logged the output from vmstat and created the below diagrams.

Each time the data was copied with the following command line:

tar -c -b 128 -f - source-dir | tar -x --checkpoint=1000 -b 128 -C /destination-dir/

The data was collected with vmstat 10 | tee /tmp/logfile. Roughly 120Gb were transferred.

Optimal Performance Diagram
This the diagram for the copy process to the “good” new F3 disk (bi is “block in” for the read op, bo is “block out” for the write op). The source disk was the old F1 disk. The whole process took about 38 minutes. This is the raw text file from the vmstat command. As you can see the read performance of the old F1 disk is perfectly fine.

Bad Performance Diagram
And here is the diagram for copy process from the new F3 to the old F1 disk. Simply bloody awful write transfer rate. The whole operation took about 98 minutes. This is the raw text file from the vmstat command. The spikes are probably due to the hard disk write cache. Now wonder, that the whole desktop might get sluggish with such a bad behavior.

I’m so annoyed, that I didn’t draw the right conclusions earlier. I could have spared me more than 1½ year of frustration with Linux in general.

Sun Type 6 Keyboard

I’ve written about my issues with my SUN Type6 keyboard in the company. I’ve finally found a 100% satisfactory solution. In the end, all fiddling with xmodmap and setxkbmap didn’t really help. To really fix my issues I needed to edit the file /usr/share/X11/xkb/keycodes/evdev to shuffle some keycodes around.

In the end I made these changes (relative to the directory /usr/share/X11/xkb/keycodes):

---    2009-09-03 08:31:32.000000000 +0200
+++ keycodes.dir    2009-10-06 12:58:54.000000000 +0200
@@ -46,6 +46,7 @@
 -------- -------- sony(nwp5461)
 -d------ -------- evdev(evdev)
 -------- -------- evdev(pc98)
+-------- -------- evdev(type6)
 -d------ -------- xfree86(xfree86)
 -------- -------- xfree86(basic)
 -------- -------- xfree86(102)
-- keycodes/   2009-09-03 08:31:32.000000000 +0200
+++ keycodes/evdev  2009-10-06 12:59:32.000000000 +0200
@@ -311,3 +311,10 @@
     include "evdev(evdev)"

+// Sun Type 6
+xkb_keycodes "type6" {
+    include "evdev(evdev)"
+    <RCTL> = 108;
+    <RALT> = 134;
+    <RWIN> = 105;
--- rules/ 2009-09-03 08:31:34.000000000 +0200
+++ rules/evdev 2009-10-06 13:00:04.000000000 +0200
@@ -105,6 +105,7 @@
 ! $dvoraklayouts = br ca de ee es fr gb no pl se us

 ! model        =   keycodes
+  type6        =   evdev(type6)
   pc98     =   evdev(pc98)
   *        =   evdev

With the above changes I was additionally able to modify the file /etc/hal/fdi/policy/10-x11-input.fdi so that HAL will do the right thing, once this keyboard is plugged in (see the line with input.product).

<deviceinfo version="0.2">
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.rules" type="string">evdev</merge>
      <merge key="input.xkb.layout" type="string">de</merge>
      <match key="input.product" contains="HID 0430:0005">
        <merge key="input.xkb.model" type="string">type6</merge>

Make sure, that your desktop environment uses the system settings and doesn’t override it with session local settings, when you log into your desktop. If everything is correct, the /var/log/Xorg.0.log should contain something like this:

(II) config/hal: Adding input device HID 0430:0005
(**) HID 0430:0005: always reports core events
(**) HID 0430:0005: Device: "/dev/input/event0"
(II) HID 0430:0005: Found keys
(II) HID 0430:0005: Configuring as keyboard
(II) XINPUT: Adding extended input device "HID 0430:0005" (type: KEYBOARD)
(**) Option "xkb_rules" "evdev"
(**) Option "xkb_model" "type6"
(**) Option "xkb_layout" "de"

While the above changes may be the 100% solution, there is still the danger, that the changes are overwritten, when new keyboard tables are installed. For Gentoo Linux it is therefore advisable to extend the CONFIG_PROTECT variable in /etc/make.conf with the directories /usr/share/X11/xkb/keycodes and /usr/share/X11/xkb/rules.

The simplest solution however may be to copy the file /usr/share/X11/xkb/keycodes/evdev to a new file /usr/share/X11/xkb/keycodes/evdev-new, edit the keycode changes into this file and then load the keycodes by executing “setxkbmap -keycodes evdev-new(type6)” somewhere in the login process (.xprofile or .xinitrc or whereever).

These little (annoying) problems …

SUN Type 6 Keyboard

SUN Type6 Keyboard

In the company I’m using a SUN Type6 USB keyboard. I’ve tried a couple of keyboards, but this still has the nicest feel of them all. The Linux evdev assigns the symbols Super_R (1 in the right picture), Menu (2 in the picture) and ISO_Level3_Shift (3 in the picture) in order to the three key right of the Space key. For me personally the ISO_Level3_Shift is a little bit far to right and I’m missing a right Control key. With Xorg server 1.5.3 I was able to remap the Super_R key to ISO_Level3_Shift and the right most key to Control_R by using setxkbmap and xmodmap.

$ setxkbmap -symbols "pc+de+inet(evdev)+level3(rwin_switch)"
$ xmodmap remapctrl

The file remapctrl contains the lines:

keycode 108 = Control_R Multi_key
clear control
add control = Control_L Control_R

All good and dandy. Then I switched to Xorg server (on Gentoo Linux).

It still sort of works. When I press the remapped ISO_Level3_Shift and “q” on the keyboard I’m getting the expected “@“. The same should be true for the “~” key. However the “~” is a dead key to produce characters like “ã” with two key strokes. Here, the newly remapped ISO_Level3_Shift has no effect and the same with all other dead keys.

When I remap the Menu key to ISO_Level3_Shift however with

$ setxkbmap -symbols "pc+de+inet(evdev)+level3(menu_switch)"

then all the dead keys like “~” work again as expected. I guess to need to fiddle with /usr/share/X11/xkb/keycodes/evdev to get a final fix.

Missing icon in systray

Systray Icons

Some time in the past I switched from Amarok 1.4 to Mpd with the client Gmpc as my preferred music listening solution. Originally the icon in the Xfce4 systray looked ok as on the right side in the picture to the right (the light blue musical note).

After having installed the icon set Tango and after having switched the icon set a couple of times, I ended up with a systray, which looked like the left side in the picture (some generic icon for the Gmpc).

I then went searching, why in some icon sets the Gmpc systray icon was displayed correctly, while in others it was replaced with some generic icon.

After a bit of digging I found, that the Tango icon set, that I installed doesn’t inherit from the icon set hicolor, which appears to be the mother of all icon sets. Gmpc installs its icons in the hicolor directory structure. As I looked at the file /usr/share/icons/Tango/index.theme it read like this:

[Icon Theme]
Comment=Tango Icon Theme

After I changed “Inherits=gnome,crystalsvg” to “Inherits=hicolor,gnome,crystalsvg” everything looked fine in the systray again.

Wrong framerate on virtual consoles

Again, in the company I inherited a newer flat screen display panel compared to the old one, which had a resolution of 1280×1024. The new one now is capable of 1600×1200 pixels. After reconfiguring /etc/X11/xorg.conf and reboot into the X11 session everything was fine. However, now each time, when I’m shutting down the system or when I switch to one of the virtual Linux consoles, I’m getting an error message from the display, that the vertical and horizontal sync frequencies are out of range. Very annoying.

After some experimentation I have found a workaround. Before shutting down or changing the virtual console, I change the X11 resolution of the X11 server to the 1024×768 size with the key combination CTRL+ALT+Keypad- or CTRL-ALT-Keypad+. I’m wondering, if it has something to do with the fact, that I’m using a Nvidia graphics card. I think a came across similar problem reports in Ubuntu forums, which also mentioned Nvidia cards.

Some additional DB2 notes

In my original article I wrote, that I had some problem with the to_char() function while moving the Oracle database structure to DB2. The problem wasn’t so much about, that to_char() isn’t supported on DB2 (it is, it’s basically the same thing as varchar_formar()), but that the Migration Toolkit had generated a 3 argument version of to_char(), the 3rd argument being some I18N parameter. Apparently, what the MTK deduced from the originating database didn’t fit with DB2 9.7. Anyway, this is probably still a MTK issue.

Working with DB2 for the last weeks has been mostly a pleasant experience. First of all there comes a GUI (db2cc aka the DB2 command center, which is basically a front end to a couple of graphical tools) with the database, which simplifies most administration tasks and which also provides a SQL editor to help with the development of your SQL queries. Therefore you don’t necessarily need any 3rd party software, to make your life easier. Second, if you look up the explanation of a particular SQL error (db2 ? SQL?????N), you will receive helpful suggestions, what might have caused the problem. This was frequently good enough for me to keep going without further reading in any manuals.

However I also have an issues with db2ce, the SQL command editor. When I try to save my developed SQL query to a file only the root (/) directory is offered as the destination location. I was unable to select a different location with the file selection box. If I tried to create a directory within the file selection dialog, I received a SQL22204N error and the dump/db2dasdiag.log file contained the following:

2009-08-25- I5362G279          LEVEL: Error
PID     : 27995                TID : 3041135504
FUNCTION: DB2 Tools, DB2 administration server, db2dasFMdirectoryCreate, probe:30
CALLED  : DB2 Common, OSSe, ossDirectoryCreate
RETCODE : ECF=0x90000001 Access denied

Unfortunately there is no indication of the file path, which might cause the error.

The other issue concerns the user administration. I’m trying to give an additional system user access to some tables from the main schema. I’m received a large Java stack trace once I clicked in the respective dialog box to select the tables from the particular schema and I can’t proceed. Something like this:

    at javax.swing.JComboBox.setEnabled(
    at Source)
    at db2_udb.UserGroupAddObjectDialog.itemStateChanged(Unknown Source)
    at Source)
    at Source)
    at javax.swing.JComboBox.fireItemStateChanged(
    at javax.swing.JComboBox.selectedItemChanged(
    at javax.swing.JComboBox.contentsChanged(
    at Source)
    at javax.swing.AbstractListModel.fireContentsChanged(
    at common.JComboBoxModel.setSelectedItem(Unknown Source)
    at javax.swing.JComboBox.setSelectedItem(
    at Source)
    at javax.swing.JComboBox.setSelectedIndex(
    at Source)
    at common.ComboBox.setSelectedIndex(Unknown Source)
    at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.jav

When I’m terminating the db2cc Java even segfaults:

Unhandled exception
Type=Segmentation error vmState=0x00000000
J9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
Handler1=B7D150E5 Handler2=B7DB7A0D InaccessibleAddress=A9824680
EDI=A8B013DC ESI=00000000 EAX=A9824680 EBX=A946787C
ECX=00000000 EDX=A9824680
EIP=AA9149C8 ES=0000007B DS=0000007B ESP=A94676CC
EFlags=00010282 CS=00000073 SS=0000007B EBP=A94676DC
Module_base_address=AA8BE000 Symbol=_ZN13jdbcAEProfileD1Ev
Target=2_40_20081105_025433_lHdSMr (Linux 2.6.27-gentoo-r8)
CPU=x86 (4 logical CPUs) (0xbe195000 RAM)
----------- Stack Backtrace -----------

I guess I need to check the DB2 forums for some hints.

Originally I installed DB2 on a AMD64 server to get familiar with the software. The actual destination server however was a 32bit Intel box. There is a PDF in the DB2 9.7 documentation set, which describes the various available options. After some fiddling I choose the combination of db2look and db2move to transfer the data.

On the originating host I executed:

db2look -d httpd -z db2inst1 -dp -e -o struc.sql
db2move HTTPD EXPORT -sn DB2\*

Then the data was transferred to the destination host, where I executed the commands

db2 -tvf struc.sql 
db2move httpd import -io insert

to restore the database. The “-io insert” is important here, otherwise you would have received errors in connection with tables, which reference foreign keys.

Otherwise it’s still smooth sailing with DB2.

Steffens Big 18

Steffens Big 18

Der erste große Meilenstein ist erreicht. Sohni Steffen feiert heute seinen 18. Geburtstag.

All the very best to you.

Pünktlich zu diesem Datum war am Freitag der offizielle Führerschein in der Post. Und dann wurde mir heute Abend ganz anders, als die drei Kinder ohne uns Eltern im Auto unterwegs waren, um noch etwas zu holen, was die jüngste Tochter vergessen hatte.

Irgendwie fühle ich mich da doch alt.