Friday, June 1, 2012

Random Reboots. Error Codes: 1000008e, 1000000a, 0000004e

SkyHi @ Friday, June 01, 2012
To stop it rebooting, go to Control Panel>System, then click "Advanced System settings" in the left-hand pane. In the System Properties dialog, click Settings under "Startup and Recovery", and then uncheck "Automatically restart". After that it will give a Blue Screen error which is easier to troubleshoot.

Then download UBCD and burn it to CD, it has all the memory testing and disk diagnostic utilities on it plus many more besides. Run MemTest and Windows Memory Diagnostic, as well as the disk utility for your brand of hard drive (or Seatools if you aren't sure). All you have to do is to boot up with the disc in the drive, select the utility that you want to use, and it will run.

Ultimate Boot CD

Increased Transmit Power Does More Harm Than Good?

SkyHi @ Friday, June 01, 2012

Currently, I run four routers, all part of the WRT54G/GL/GS series, that allow a house to receive wireless internet.  These routers provide sufficient, although not yet ideal, coverage for the house.   Since the WRT54G/GL/GS routers are built on a Linux framework, they are easily upgraded to more powerful firmware, such as the Tomato Firmware available from  Third-party firmware such as Tomato adds increased functionality to what would otherwise be considered a standard router.  One of the more interesting features that Tomato provides is the ability to increase the transmission power of the wireless signal.  The picture below shows this setting.
Tomato Transmit Power Setting
Tomato Transmit Power Setting
Recently, users had been mentioning that the Internet was unstable, with frequent reconnecting and low signal strength.  These specific users’ rooms are at the extreme ends of the house, which means that their Internet signal is the weakest.  I increased the Transmit Power of all the routers thinking this would be solution to the problem.  It was not.  As the users kept saying the Internet was unstable, I would increase the transmission power of the router.  I found that the recommended maximum transmission power level is 82 mW.
From Tomato Wikibooks : Transmit Power: Sets the transmit power in milliwatts. High settings may cause nonlinearity in the transmitter causing loss of data, interference to other users and channels, and a high “noise floor”. It may also overheat and shorten the life of the transmitter. Tomato default is 42mW, using 84mW is usually safe.
I had turned the routers up to 80 mW and the problem was still occurring.  Upon some research I found that as the Transmit power levels of the routers increased, so did the radio noise produced by the routers. I decided to turn the routers back down, to a level lower than when I first began to administer the network.  After this change, users noticed an immediate improvement in the quality of their wireless connections.  Everything was (and still is) running stable.  The users are no longer losing Internet connection and are maintaining proper network speeds.
In my personal experience, although the Transmit Power feature of the Tomato firmware may seem to be the answer to wireless coverage or wireless signal strength problems, it is not.  Not only does increasing the wireless transmission power of these routers cause more radio noise, it also reduces the life of the router.  On these routers, the settings were only at 80 mW and I was having problems.  The Tomato firmware allows a maximum setting of 250 mW.  Users with this setting will experience an unstable wireless signal, and will shorten the life of their routers.
Have you experienced any similar problems with your router?  What transmit power level are you using for your router?  What other steps have you taken to increase the signal strength of your router?  Let us know by commenting below.


HTC Desire: Set static IP

SkyHi @ Friday, June 01, 2012

HTC Desire: Set static IP

  • Hit the hard menu button on your phone and then chooseSettings
  • From there, browse to the Wireless controls section and then choose Wi-Fi Settings
  • Whilst in the Wi-Fi Settings section, push the hard menu button again and select Advanced
  • Press Use static IP to put a check in the box and then enter the network settings as per your own network

Step by step to turn off email notification sound

SkyHi @ Friday, June 01, 2012
I have the HTC G2 Andriod and this thread helped me get on the right track, but I never found a complete answer to turning off the email sound notifications. Not sure why HTC hides this so well. I finally figured it out, so here it is: 

Click on your Gmail icon. 
Press "Menu" 
Select "More"
Select "Settings"
Select the email address you'd like to change (eg
Select "Lables to Notify"
Hit the dropdown arrow next to "Inbox"
Select "Ringtone" and then select "Silent".


Unable to enumerate USB device

SkyHi @ Friday, June 01, 2012

Some hardware just don’t work with ehci_hcd on Karmic Koala. My memory stick from transcend refused to work no matter what I did. After plugging the device nothing happened, doing dmesg showed me the following error:
Apr 18 10:59:04 dpac-laptop kernel: [73668.388060] usb 1-2: new high speed USB device using ehci_hcd and address 5
Apr 18 10:59:04 dpac-laptop kernel: [73668.473034] hub 1-0:1.0: unable to enumerate USB device on port 2
After searching a lot, I came to a conclusion that my device doesn’t work with USB 2.0. So I disabled the ehci_hcd to make it work.
Since Karmic doesn’t use ehci_hcd as a module, modprobe -r ehci_hcd no longer works. The module is compiled into kernel. To disable it execute the following commands in terminal:
cd /sys/bus/pci/drivers/ehci_hcd
You will see a file with 0000:00:xx.x format. Execute the following command:
sudo sh -c 'echo -n "0000:00:xx.x" > unbind'
Replace the xx.x with the numbers displayed on your file. It should disable the ehci_hcd.
I plugged in my memory stick, and it worked.
Please note that you’ll have to do all this each time you restart.
You can now use the following script to disable ehci_hcd. It is far more simpler since it just needs you copy pasting the commands instead of a manual action. Here it goes:
cd /sys/bus/pci/drivers/ehci_hcd/
sudo sh -c 'find ./ -name "0000:00:*" -print| sed "s/\.\///">unbind'

At some moment, my USB WLAN stick stopped working, and the log was polluted by messages like:
usb 6-1: new high speed USB device using ehci_hcd and address 62
hub 6-0:1.0: unable to enumerate USB device on port 1
hub 6-0:1.0: unable to enumerate USB device on port 1
At first, I decided that the stick had broken after years of work, but out of curiousity tried to connect it to every USB port I found. It worked. The stick worked again when plugged into the keyboard, which in term was connected to the KVM.
What is funny, I did nothing, but after a few days the stick worked again correctly in its original port. I forgot about the problem. But after yet another vacations, the problem appeared again, and again disappeared in a few days.
I have no idea why.
But I finally found a solution here: [Solved] Unable to enumerate USB device (Disabling ehci_hcd). I need to disable ehci_hcd. In my case, the commands is:
# cd /sys/bus/pci/drivers/ehci_hcd
# echo -n "0000:00:1a.7" > unbind
As a side effect, I do not have USB 2.0 on this bus anymore, but it is not a problem.

24.02.2010, update

To issue the command automatically on boot, one could edit/etc/rc.local, but in my case I need to have network loaded before. The best solution (I hope) is based on advice here:
You can disable this on boot by creating a /etc/udev/rules.d/disable-ehci.rules file containing:
ACTION=="add", SUBSYSTEM=="pci", DRIVER=="ehci_hcd", \
        RUN+="/bin/sh -c 'echo -n %k > %S%p/driver/unbind'"


Tuesday, May 29, 2012

Device: /dev/sda, 1 Currently unreadable (pending) sectors

SkyHi @ Tuesday, May 29, 2012

I sometimes get these annoying messages from smartd. They only occur with Samsung HD103SIS SATA disks. According to my google research, these messages are not harmful and a Samsung speciality. One reason for me to avoid Samsung in future. The messages should disappear after a reboot. However, since the disks are built into a RAID1 on a 24x7 server I want to avoid rebooting the server. Instead I can get rid of these messages without a reboot when overwriting the whole disk with zeros. Please click here for details.



Removing the disk from the array

The first step is remove the corresponding disk from the array. This is first done by failing the disk and afterwards removing it. In my case, the disk is part of three RAID1 volumes md0, md1 and md2:
mdadm --manage /dev/md0 --fail /dev/sda1
mdadm --manage /dev/md0 --remove /dev/sda1

mdadm --manage /dev/md2 --fail /dev/sda3
mdadm --manage /dev/md2 --remove /dev/sda3

mdadm --manage /dev/md1 --fail /dev/sda4
mdadm --manage /dev/md1 --remove /dev/sda4

Zeroing the disk

Since the disk is removed from the RAID it is safe now to overwrite is with zeroes. As soon as the disk is completely zeroed out, the messages disappear. In my case, the disk is 1TB:
cat /dev/zero | pv -s 1000G | dd of=/dev/sda bs=100M

Recreate partition layout

Now you have to recreate the partition layout with fdisk or cfdisk. In my case, the two RAID1 disks are identical, so I can copy the partition layout from the other disk:
sfdisk -d /dev/sdb | sfdisk /dev/sda 
sfdisk -R /dev/sda

Adding the disk to the RAID

This is simple as before:
mdadm --manage /dev/md0 --add /dev/sda1
mdadm --manage /dev/md2 --add /dev/sda3
mdadm --manage /dev/md1 --add /dev/sda4

reinstall grub

In my case I installed grub on both disks. In case of failure of a single disk, the system is always fully bootable and running.
grub-install /dev/sda
Or if you use symbolic names (like me), just reinstall on both devices:
grub-install /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1KS300499
grub-install /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1KS300505


Smartd Error: 1 Currently unreadable (pending) sectors

SkyHi @ Tuesday, May 29, 2012
 I am encountering following error in /var/log/messages:
Aug 15 03:55:42 hostname smartd[2366]: Device: /dev/sda, 1 Currently unreadable (pending) sectors
Which cause the / partition to be mounted as read-only. The server is accessible anyway but you cant do anything much inside. Lets troubleshoot this.

Collecting Information/Troubleshooting

I see read-only filesystem mounted when creating a test file in /root directory:
$ touch /root/testfile
touch: cannot touch `/root/testfile': Read-only file system
What is SMART daemon (smartd)?
Self-Monitoring, Analysis and Reporting Technology (SMART) system built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives. The purpose of SMART is to monitor the reliability of the hard drive and predict drive failures, and to carry out different types of drive self-tests. We will use smartctl command to help us find out what is wrong with the disk.
Lets check the overall health of disk /dev/sda:
$ smartctl -H /dev/sda
smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is
SMART overall-health self-assessment test result: PASSED
It passed. But it just general information only. We need to go deeper by do self-test to the disk:
$ smartctl -q errorsonly -H -l selftest -l error /dev/sda
ATA Error Count: 2
Error 2 occurred at disk power-on lifetime: 36795 hours (1533 days + 3 hours)
Error 1 occurred at disk power-on lifetime: 31542 hours (1314 days + 6 hours)
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       60%     39255         -
When I Google up the error above, it seems like the hard disk might have hardware problem. FSCK only might not helping much since it only fix logical error in file system, not the hardware error.
Errors reported by SMARTD is related to power-on lifetime attributes which explain as below (reference):
Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state. A decrease of this attribute value to the critical level (threshold) indicates a decrease of the MTBF (Mean Time Between Failures).
However, in reality, even if the MTBF value falls to zero, it does not mean that the MTBF resource is completely exhausted and the drive will not function normally.


Since the hard disk is in read-only mode, we better do backup before proceed with any problem solving process. In this case, SCP to another server is good idea because we cannot write to the local disk at this moment. For me, “home” partition is the most important folder need to be saved:
$ scp -r /home user1@remoteserver:/home/user1/home_backup

Problem Solving Process

1. Remount the / partition:
$ mount -n -o remount /
mount: block device /dev/sda2 is write-protected, mounting read-only
2. Run e2fsck command to check ext3 file system online:
$ e2fsck /dev/sda2
e2fsck 1.39 (29-May-2006)
/: recovering journal
Clearing orphaned inode 31672817 (uid=0, gid=0, mode=0100755, size=157913)
Clearing orphaned inode 31672803 (uid=0, gid=0, mode=0100755, size=3532999)
Clearing orphaned inode 31666625 (uid=0, gid=0, mode=0100755, size=150604)
Clearing orphaned inode 31666619 (uid=0, gid=0, mode=0100755, size=383872)
Clearing orphaned inode 27885882 (uid=0, gid=0, mode=0100755, size=1011760)
Clearing orphaned inode 31666617 (uid=0, gid=0, mode=0100755, size=1141532)
Clearing orphaned inode 31665420 (uid=0, gid=0, mode=0100755, size=398180)
Clearing orphaned inode 31665416 (uid=0, gid=0, mode=0100755, size=71852)
Clearing orphaned inode 31671503 (uid=0, gid=0, mode=0100755, size=1250176)
/: clean, 80179/38273024 files, 2990728/38258797 blocks
Try remounting again the partition like step 1 but same error occurred. Proceed to next step.
3. Run full file system check using FSCK via rescue environment:
$ fsck -f -y /dev/sda2
Even the box remount correctly after that, the smartd status still haunting me up. This has force me to make final decision as my next step.
4. To avoid any sudden breakdown (since the disk already run more than 1000 days), I decided to replace the hard disk and re-install the box. Its better for me to do this as part of my maintenance task so I will not worrying much about ‘urgent’ maintenance when it breakdown during weekend or sleep time!