Cloning NTFS disk with errors

February 22nd, 2013 No comments

I have a Windows 7 disk with the NTFS file system on multiple partitions that I want to clone since the disk seems to be dying (it has problems spinning the disk plates, or at least that’s how it sounds).

My first approach was to use a bootable cd with Acronis TrueImage which normally works just fine but apparently this time it chose to complain about two things:

  1. Source disk has errors
  2. Destination disk too small

I ran check disk on the source disk (which by the way takes for ever to complete) but it didn’t change error message given by Acronis TrueImage. My destination disk is exactly the same size so that shouldn’t be a problem either.

So I tried to do it manually by downloading a GParted Live cd that contains all the tools needed:

  • dd
  • sfdisk
  • ntfsclone

Backup Master Boot Record (MBR) and extended partitions

My source for this is page.

Backup the MBR to backup-hda.mbr:

cd /root
mkdir partition-backup
cd partition-backup
dd if=/dev/hda of=backup-hda.mbr count=1 bs=512

Then save the extended partitions:

sfdisk -d /dev/hda > backup-hda.sf

Restore the MBR and extended partitions

Important: Double check the destination, if wrong you can destroy data.

Restore MBR:

dd if=backup-hda.mbr of=/dev/hdb

Restore extended partitions:

sfdisk /dev/hdb < backup-hda.sf

Clone the data

Here I used ntfsclone which can save the data of a disk either to an image file or an other disk. In my case I cloned directly to the new disk. I used the –rescue and –override arguments since my disk might have errors as pointed out earliere and because we just copied the partitions over (we know that the partitions on the destination disk is just zeros so we can override them). More info can be found here, it also describe how to clone disks with different sizes.

Important: Double check the source and destination parameters.

In this case I want to clone my disk sda1, sda2 and sda3 to sdb1, sdb2 and sdb3 so I run ntfsclone for each of them like this (shown for sda1 cloned onto sdb1):

ntfsclone --rescue --override /dev/sdb1 /dev/sda1

Of cause it takes a while for a big disk but the time it takes to copy was in my case a lot less than the time windows check disk takes to check the disk.

 

Categories: Windows 7 Tags:

Installing Cyanogenmod on HTC Desire and make it look similar to HTC Sense

January 30th, 2013 No comments

Why would you install a custom ROM on your Desire? You ran out of space for Apps!

Rooting the Phone

First step is to get root access (if you want to us a program like ROM Manager)

 Installing Cyanogenmod

  1. Go to here and find a pre build you want to install (for HTC Desire only)
  2. Place the zip on the SD card
  3. Boot the phone into revovery (Hold down volume down and power to enter this menu)
  4. Select install zip and select the zip
  5. Reboot

Make the new ROM look like HTC Sense

First the Theme

  1. Look here for a theme you like and download it to you SD card
  2. Enable app install from unknown source
  3. Use a file manager to select the apk file and install it
  4. Open the Theme Chooser and install the theme

Getting more space for Apps (one of the primary reasons for choosing a custom ROM)

  1.  Use ROM Manager to prepare the SD card
  2. Install s2e
  3. Open s2e and enable mount from the SD card for the options desired

Sense like Apps:

  1. LP Sense UI apk (the home screen)
  2. Widgetlocker Lockscreen (if you dont like the default one in Cyanogenmod)
  3. The Weather widget from Sense: Fancy widgets app looks almost the same
  4. LED: Light Flow app allows control over when the LEDs light up enabling customisation.

The firmware update description is available here.

Categories: Tools Tags: ,

SourceForge Git auto-login in Windows 7

May 9th, 2012 No comments

TortoiseGit auto log-in at SourceForge can be achieved through key authentication through Putty.

  1. The first step is to create a key set go to the putty section from the link below
    1.  https://sourceforge.net/apps/trac/sourceforge/wiki/SSH%20keys
  2. Now associate the public SSH key with your SourceForge account
    1. https://sourceforge.net/account/ssh
  3. Finally you need to configure Putty to know about your private key such that plink.exe can use it when authentication is done.
    1. Open putty and load the default settings from the “Session” tab
    2.  Navigate to “Connection->SSH->Auth”
    3. Specify the path to your private key in “Private key file for authentication:”
    4. Go back to the “Session” tab and save the changes to “Default Sessions”
  4. Now you are done.

Other links:

https://sourceforge.net/apps/trac/sourceforge/wiki/Git

http://code.google.com/p/tortoisegit/wiki/UsingPuTTY

Categories: Tools, Windows 7 Tags:

Code formatting in AVR Studio 5

April 12th, 2012 No comments

I discovered that AVR Studio 5.1 doesnt always work in relation to code formatting. I searched for bugs and found a number of places where Atmel has replied that they are working on fixing this. However, until this happens a nice work around using an external tool can be used.

This is how to setup the external tool AStyle which is on SourceForge and free.

  1. Download AStyle and unzip it somewhere you like
  2. Open AVR Studio 5
  3. Go to: Tools->External Tools…
  4. Add a tool and fill in the fields:
    1. Title = AStyle
    2. Command: full path to C:\\…\AStyle.exe
    3. Arguments: -y –indent=tab –style=ansi –errors-to-stdout –suffix=none $(ItemDir)$(ItemFileName)$(ItemExt)
      1. If you like the code formatted differently you can check the AStyle documentation
    4. And finally check the Use Output Window, so it doesnt popup a new windows every time you run it.
  5. Now we need to setup a key binding for it like Ctrl+Shift+F and make the document reload automatically when formatted
    1. Goto Tools->Options
      1. Locate Environment->Keyboard in the left tree
      2. Then fund the command: Tools.ExternalCommand1 (assuming you only have one external tool specified)
      3. Assign a Ctrl+Shift+F to it as global. And the key binding is complete.
      4. Locate Environment->Document
        1. Check “Auto-load changes, if saved”
  6. That’s it enjoy
Categories: AVR, C Tags:

Upgrading firmware on STK500 with AVR Studio 5

April 12th, 2012 No comments

Aparently AVR Studio 5 does not support upgrade of the STK500 through the Tools->AVR Tools Firmware Upgrade so here is how it can be done manually.

Since the AVR Prog program is not distributed with the Atmel Studio installer anymore. There is a separate installer for a set of command line tools which also includes AVR Prog.

  1. Make sure the command line tools are installed
  2. Power off the Atmel STK500
  3. On the STK500, push the PROGRAM button while turning on the power.
  4. Make sure there is a serial connection between the PC and the STK500 DSUB9 marked RS232 CTRL
  5. Start ‘AvrProg.exe’. The default installation location is C:\Program Files\Atmel\AVR Tools\AvrProg\AvrProg.exe or C:\Program Files (x86)\Atmel\AVR Tools\AvrProg\AvrProg.exe on 64-bit OS.
  6. Locate the firmware upgrade hex-file stk500.ebn by pushing the Browse button in the Avr Prog Hex File window. The path for the stk500.ebn for a normal Atmel Studio installation is C:\Program Files (x86)\Atmel\AVR Studio 6.0\tools\STK500\STK500.ebn.
  7. Push the Program button in the Avr Prog Flash window. A progress bar will now appear while showing additional information messages. Wait until the verify operation is finished.
  8. Close the Avr Prog program
  9. Power off and on the STK500 PCB. The STK500 is now ready to be used with the new firmware.

Source

This can also be used if write of board settings vent wrong and communication isn’t possible from AVR Studio anymore.

Categories: AVR Tags:

Adding a new Key Fob to a VW Touran 2007

January 2nd, 2012 No comments

This will explain how to buy a new (or used) key fob and program the remote to the car.

It is worth mentioning that programming the immobilizer is not really a thing you can do you self unless you have all the required codes which you properly don’t have do to the way VW manages these now a days.

Before you go on to ebay or else where to find a new key there is a few tings that you need to know. Two numbers must match the key you are searching for, that being:

  1. Remote part number.
    This number indicated what frequency the key uses e.g:

    • HLO 1K0 959 753 A – 434MHz for mobel PR-5D1
    • HLO 1K0 959 753 B – 315MHz for model “J..”: PR-5D3
    • HLO 1K0 959 753 C – 315MHz for model “ROK”: 5D5
    • HLO 1K0 959 753 D – 315MHz
    • HLO 1K0 959 753 G – 434MHz
  2. The type of immobilizer
    This is a number similar to: 5FA 009 263-10
The part numbers can be found on the back of the remote part when dissembled from its metal key part.
Key for a VW Touran

Key for a VW Touran

VW key not for a VW touran but with easy readable part numbers

If only you remote is broken and the car still is able to start. Then the old immobilizer can just be assembled with a new remote part. (Saving you for the expensive programming at a VW dealer)
More info about keys can be found in this post.

Programming

This is only a guide to program the remote control part of the key e.g the part with the 3 buttons (on the right below) – NOT the immobilizer with the metal key (on the left).

VW Generic Programming of Remote Controls

  1. Place your first key into the ignition and turn to the second notch (do not start the car)
  2. Now close the door and place your second key into the handle lock
  3. Turn the key to the lock position and let it spring back to the central position.
  4. Hold down the Lock button on your new remote, you may hear a bleep from the car
  5. Now unlock the car using the key in the barrel and remove, then take your first key out of the ignition
  6. Close the door
  7. Your remote should now be coded

VCDS Procedure for matching radio-frequency remote controls

The VCDS matching guide is available here.

However this guide didnt quite work for me. I just wanted to add a single new (already used for another car, which type is on known to me other than it was a VW) key to the car but the procedure shown below didn’t allow me to save a 2 in the new value. If I pressed Test it will then just come back and allow me to Test again and not Save.

  1. Place the key to program in the ignition and turn it (do not start the engine)
  2. [46 - Cent. Conv.]
    1. [Adaption - 10]
      1. Read channel 1
      2. Change the Test Value to 1 (The guide says it should be the number of keys but any value except one doesn’t work for me)
      3. Hold in UNLOCK on the key until confirmation (in my case by the turn lights)
      4. That’s it exit VCDS and turn of the car the remote should work now as well as your old one(s)
Categories: Car repair Tags: , , ,

Unlocking Webasto Aux. Heater on a VW Touran

December 25th, 2011 No comments

The Webasto Aux. Heater can be unlocked through VCDS. It may be come locked do to a broken water pump or simply failed starts.

The heater is locked if it reports the following fault code:

205935
00 0018 03 1232 thermo top v 12v /42 w 5kw

Saturday,05,November,2011,16:56:54:21701
VCDS Version: Release 10.6.5
                Address 18: Aux. Heat       Labels: None
Control Module Part Number: 1K0 815 071 R
  Component and/or Version: Zuheizer        050 2302
           Software Coding: 0000011
            Work Shop Code: WSC 01324 785 00200
                      VCID: 346C9F582EA0
1 Faults Found:

02251 - Heater Unit Locked
            000 -  -
             Freeze Frame:
                    Fault Status: 01100000
                    Fault Priority: 2
                    Fault Frequency: 1
                    Reset counter: 145
                    Mileage: 204126 km
                    Time Indication: 0

The heater can be unlocked through VCDS by:

  1. Selecting the “Select Control Module” option and then
  2. Select the Aux. Heater:
  3. And then select the Adaptation:
  4. The save 1 in channel 42.
    1. That’s it.
    2. Clear the fault codes and read them again and you should not get the heater locked fault any more.

VW Webasto water pump test using VCDS

December 25th, 2011 No comments

The Webasto water pump can be tested through the VCDS program for VW cars.

The idea is to activate the pump when the car engine isn’t started, this way it will be possible to listen to the front right side of the bumper to determine if the pump is running.

The following steps will guide you through the steps to start the pump:

  1. Connect the VCDS cable and turn the ignition key to power up the instrument panel
  2. Open VCDS and click the “select control module” button
  3. Then select “Aux. Heat”
  4. Then select “Output tests”
  5. The next dialog is a step-vice guide to activate different components associated with the aux heater
  6. Press next and activate and go to the front of the car and listen:
    1. If no new summing sound appears the pump is broken. Look at this post on how to replace the pump.
    2. If a summing sound starts and stops again when continuing the guide the pump is most likely working correct.

 

Categories: Car repair Tags: , ,