Sunday, February 22, 2009

Upgrade Thinkpad X200 Harddisk and Keep Service Partition Safe By Puppy Linux.

I bought a Thinkpad X200 with 80 GB harddisk 2 months ago. I'm very impressed with this thinkpad. Now I'd like to upgrade my harddisk from 80 GB to 320 GB because I need more space.
The usual procedure , replace it with a new harddisk and format, is fine but that procedure will blow your Service partition away. In term of Thinkpad , this kind of partition is called "Predesktop Area".
Predesktop Area or you'll see a partition named "Service003" in Computer is needed for booting your Thinkpad in Rescue And Recovery mode by Press Blue ThinkVantage at the boot time.
This mode can format your harddisk and recover it to the factory-installed state.
So I'd like to keep Service partition. Many people in the forums recommend to use Acronis True Image to clone the whole disk. It's a good application. I tried it and succeeded the cloning process. It works except booting in Rescue And Recovery mode.
So I searched for another way. and found the PuppyLinux is a good way.
Disclaimer : Do it at your own risk!!!. It works for me but I can't gurantee it'll work for your X200 or other model too.
Objective : To migrate all the data in the old harddisk to the new bigger harddisk and all data must remains. Can boot to windows with no problem and boot to Rescue and Recovery mode by pressing the blue button at the boot time.
Tools :

  • New bigger harddisk.

  • The USB externel harddisk enclosure.

  • PuppyLinux CD

  • A Screwdriver
Environment : In my old harddisk I have layout like this.



Method :
  1. [optional but recommend] Create the Product Recovery Media (if you've created it) by Start->All Programs -> ThinkVantage -> Create Product Recovery Media
    The Product Recovery Media needs 1 blank CD for start CD and 2 blank DVD. It's for using to rescue system when you cannont boot to your harddisk or you want to recovery your whole disk to factory-installed state (I think it includes Service partition).
    ** Product Recovery Media can create only once. It you lose it, you may contact Lenevo Support to have a new one.(maybe free or not)

  2. [optional] Recover the Lenevo Partition (after create Product Recovery Media) by double click on this parition in Computer and choose Recover space.

  3. Reboot to Puppy Linux CD. (you may have to select boot order by press F12 at the boot time)

  4. Wait for the system is ready.

  5. Integrate the new harddisk with the external HD enclosure.

  6. Plug the external to the Thinkpad. Puppy may see new the drive if it was formatted.

  7. Run Pudd (Menu -> Utility -> Pudd copy drive/partition) to clone the internal harddisk to usb external harddisk. The main point is that cloning the all partition from disk to disk in "As is" mode that means the partition size will not expand propotionally. From 80 GB to 320 GB, you'll see the unallocated area 240GB approx in the rest of the external harddisk.

  8. It takes about half an hour for clone the disk. The limitation of Pudd is that no progress showing. Please wait patiently and wish it's working.

  9. When Pudd finished his work, run GParted (Menu -> System -> Gparted). You'll see the partition layout of the external harddisk as same as the old 80GB one.

  10. Now using the GParted to resize/move/create/delete some partitions except Service partition as you like.

  11. This is mine. (you'll see the 1 MB unallocated area at the beginning of disk. I think this results in why Acronis didn't works. )
  12. Shut down the computer.

  13. Switch the harddisk 80GB and 320GB. You may need a good screw driver. Do it by the Thinkpad Manual. It's very easy.

Now you can continue working with the new bigger space.
Wish it works for you too.

Monday, January 26, 2009

My favourite Dijkstra's epigrams

Do not try to change the world. Give the world the opportunity to change itself.

The question of whether computers can think is like the question of whether submarines can swim.

Computer Science is no more about computers than astronomy is about telescopes.

A formula is worth a thousand pictures.

Progress is possible only if we train ourselves to think about programs without thinking of them as pieces of executable code.

Program testing can at best show the presence of errors but never their absence.

I pray daily that more of my fellow programmers may find the means of freeing themselves from the curse of compatibility.

If you carefully read its literature and analyze what its devotees actually do, you will discover that software engineering has accepted as its charter, “How to program if you cannot.”
Waiting is a very funny activity: you can’t wait twice as fast.

Mathematicians are like managers; they want improvement without change.

source : Memorial Resolution - Edsger Wyber Dijkstra

Sunday, November 30, 2008

Facebook lost my data!

I received an email 10 minute ago. The mail body is below
Unfortunately, the settings that control which email notifications get sent to you were lost. We're sorry for the inconvenience.
To reset your email notification settings, go to:
http://www.facebook.com/<wbr>editaccount.php?notifications
Thanks,
The Facebook Team

I was surprised very much with this. I thought that it is a phishing email but I see the sender and I logged in to my account and found this message.



Oh! it's real! I don't know what's happen at Facebook.(wait for news) but it made the image of facebook look bad. The very big website lost their member data. How about backup system?
There is no backup for the data?
After I googled about this issue, many bloggers have commented about this too. Really I love facebook more than other social networking websites. I wait for the news to know what happen to the Facebook now?

Tuesday, November 4, 2008

Emesene crashes during logging in

I use emesene 1.0 on Debian. It usually works great and I prefer it to pidgin.

But there are a few bugs. Emesene crashed during logging in. It'll crash everytime after it occurs the first time. I don't know why. It hardly occurs and it crashed unexpectedly. I used to see this bug a few times in the past. My friend found it too and has already found the solution. Deleting all the files in ~/.config/emesene1.0/[your_account] is the solution but you have to sacrifice your config files and preferences.

I got it crashed again. But this time I found the better solution. I digged in the file and found that deleting the PersonalMessage.conf in ~/.config/emesene1.0/[your_account] is enough.

The file contains you personal message. After I deleted it, emesene can logging in and online again. The preferences still be but only personal message not.

I took experiment something. I set presonal message to the previous personal message that's in the PersonalMessage.conf before It's deleted. It contains Thai and English word in mix. It crashed immediatly. I run it and set it again. It crashed. This time I set the personal message to only English message like "test". It didn't crash. Now I can set the previous message and crashing haven't occured anymore.

Maybe this is the clue of this bug. I'll report it to the bug tracker later.

Wednesday, October 22, 2008

Time conflicts in Dual-boot, UTC or Local time in BIOS?

I'm surprised that I've used dual-boot many times but I've just found this problem. There is a problem about time between Windows and others such as Debian.

The problem is
Debian (or unix-like) uses time in BIOS as UTC time
but
Windows uses time in BIOS as local time.

So the problem shows out. I'm in Thailand so my timezone is +7. If UTC time is 10:00, I boot to Debian then the time in BIOS should be 10:00 and Debian shows 17:00 as a time. Then I switch to windows , it shows the time 10:00 as my time. The time is in the past. I adjust to the right time 17:00 and windows sets it in BIOS too. If I switched to Debian again, it will show the time is 00:00 (17:00+7 hours). That's it.

The root of the problem is each OS treat time in BIOS in different ways.
So the question is "Which time should be in BIOS? UTC or local time?"

UTC - more standards and every systems can treat it in their way. It makes sense.
Local time - After I googled , why windows does it like that, there are reasons. First is backward compatibility. The former windows system such as MS-DOS or Windows 3.1 do this way so they have to do the same way to remain compatibilites and can dual-boot between Windows' family. Last is to avoid confusing on BIOS time itself. If you're in the BIOS setting and you've to set the BIOS time. Which time will you set? your local time or UTC. It makes sense that you will set it by local time. If BIOS asks you UTC time, it's a bit strange.

So I still don't know the answer of this question. But there are some workarounds to fix this problems
You need to do only one of these.

In Linux :

Edit /etc/default/rcS
by set UTC=Yes to UTC=No

or

In Windows:

Add the registry
HKEY_LOCAL_MACHINE System CurrentControlSet Control TimeZoneInformation RealTimeIsUniversal
and set its value to 1.
Uncheck the "Automatically synchronize with an Internet time server" in Date and Time Properties.

*I don't recommend this way because I found many people told about few following problems.

but I still don't know why I didn't found this problem when I was dual-booting Ubuntu and Windows. OR Didn't I notice this problem?

Thursday, October 16, 2008

Gumstix-OE Connex on QEmu

I'm newbies to Gumstix and OpenEmbedded platform so I try to emulate it for working easier and more safety with my experiments.

From this and this tutorial , those're for verdex , you can change a bit for you connex easily.

First you have to install qemu (version 0.9.1 or later) to you system. I'm using Debian so do this way.

sudo apt-get update
sudo apt-get install qemu

Second you need to find the 3 file for creating the qemu image. These consist of



  1. U-boot
    This is the boot loader for you gumstix. You can build your own from source or get the pre-built file from the gumstix webstie here.
    Example is "u-boot-connex-400-r1604.bin".




  2. Kernel Image
    It's the kernel for your system. It's usually start with 'uImage'. Of course you can build your own via this tutorial or pick the right pre-built image from gumstix website here. About the difference between glibc and uclibc you can googling to find out yourself.
    Example is "uImage-2.6.21-r1-gumstix-custom-connex.bin".




  3. Filesystem Image
    It's the files for your gumstix including many packages installed. You can built it your own from the same tutorial above or pick it here.
    Example is "Angstrom-gumstix-basic-image-glibc-ipk-2007.9-test-20080512-gumstix-custom-connex.rootfs.jffs2".

Now you can create the qemu image by this way.

dd of=flash.img bs=128k count=128 if=/dev/zerodd of=flash.img bs=128k conv=notrunc if=u-boot-connex-400-r1604.bindd of=flash.img bs=128k conv=notrunc seek=2 if=gumstix-basic-image-gumstix-custom-connex.jffs2dd of=flash.img bs=128k conv=notrunc seek=120 if=uImage-2.6.21-r1-gumstix-custom-connex.bin


The italic have to be changed according to your files. The bold are those difference from the reference tutorial. Because of memory, the verdex has 32 MB flash memory but the connex has only 16MB. So 256*128k changes to 128*128k. The kernel is on the end of the memory (Size -1MB) so (256-8)*128k changes to (128-8)*128k.

Now there will be a "flash.img". This is your qemu image file.
You can run it by


qemu-system-arm -M connex -m 289 -nographic -monitor null -pflash flash.img



And see it booted. But my problem now is I can't exit the qemu. -_-" Ctrl+A x doesn't work.

I think buildroot platfrom can do this method too. Because it builds to the 3 files as above and then use the same method to emulate it.

How to make BCM4318 (with Acer wireless button) works in Debian!

My laptop model is Acer 5021. I have a problem with the wireless , in particular the acer wireless button that's in front of the body can't lid up to enable the wireless just like in Windows. In the past I got it work by installing ndiswrapper and acerhk. But after the Edgy came out , it haven't worked anymore.

Now I switched from Ubuntu to Debian and found the same problem. But I see the suggestion message while it's booting. Something likes


[ 59.267579] b43-phy0 ERROR: Firmware file "b43/ucode5.fw" not found or load failed.
[ 59.267588] b43-phy0 ERROR: You must go to http://linuxwireless.org/en/users/Drivers/b43#devicefirmware and download the correct firmware (version 4).

So I went to the url in the message. It told me to do this

sudo apt-get install b43-fwcutter

Now I reboot and the error message disappeared. But I still can't use the wireless because of the Acer wireless button. I googling more , go to acerhk website. And found that acerhk is stopped and got into the main kernel development (names acer_acpi) that's the good news. and now acer_acpi is moved to acer_wmi.

if you have the kernel>= 2.6.25 , it might have the acer_wmi in the kernel already and be detected to load automatically. You can check this by

lsmod | grep acer

you would found acer_wmi.

so the rest is easy. Due to this useful (and hidden) document , you can


To read the status of the wireless radio (0=off, 1=on):cat /sys/devices/platform/acer-wmi/wirelessTo enable the wireless radio:echo 1 > /sys/devices/platform/acer-wmi/wirelessTo disable the wireless radio:echo 0 > /sys/devices/platform/acer-wmi/wirelessTo set the state of the wireless radio when loading acer-wmi, pass:wireless=X (where X is 0 or 1)


and It works!!!

I wonder this method also works with the other Acer models which have the problem with the wireless button in front of it.

good luck.