Casper Kuijjer's Homepage

To content | To menu | To search

Sunday 19 October 2008

Moving a NTFS Windows XP installation to a new harddrive

This weekend I've been trying to move Esther her Windows XP installation from a NTFS partition to a new, larger harddrive.

Initially I tried doing this using a Clonezilla live CD, by letting Clonezilla create an image of each partition (the Windows XP installation, the rescue partition, etc.) to an USB drive. Restoring the images to the new harddrive failed because there appeared to be some bad sectors on the old harddrive.

After this I used SystemRescueCd to manually clone the Windows XP installation:

  • Create an image of the Windows XP partition (in my case the 2nd partition, /dev/sda2) using --rescue to ignore bad sectors: ntfsclone --rescue --save-image --output sda2.img /dev/sda2
  • Replace the old harddrive with the new harddrive
  • Recreate the partition table on the new harddrive. Apparently Windows will not (easily) boot if the partition number or starting sector is different. As the 1st partition was only 100 MB large, and Clonezilla already recreated the partition table, I'll restore the image to the 2nd partition.
  • Restore the image: ntfsclone --restore-image /dev/sda2 sda2.img
  • The bad sectors are also copied to the new harddrive, but do not exist there. Reset the bad sector list using:
    • ntfsinfo -i 8 /dev/sda2 and write down the "Allocated size" close to '$Bad'
    • ntfstruncate /dev/sda2 8 0x80 '$Bad' 0
    • ntfstruncate /dev/sda2 8 0x80 '$Bad' "Allocated size"
  • Reboot into Windows and check the harddrive for bad sectors (by right-clicking on the harddrive, Settings, TODO
  • Reboot into SystemRescueCd
  • Resize the partition to cover the rest of the harddrive
    • Start fdisk: fdisk /dev/sda
    • Set the display units from cylinders to sectors: u [enter]
    • Delete the partition (in my case the 2nd partition): d [enter] 2 [enter]
    • Recreate the partition: n [enter] p [enter] 2 [enter]. By default the 1st sector is the 1st sector of the deleted partition, and the last sector the last sector on the disk, so [enter] [enter]
    • Set the partition type to HPFS/NTFS: t [enter] 2 [enter] 7 [enter]
    • Set the 2nd partition active, so that it will be booted: a [enter] 2 [enter]
    • Write the partition to disk: w [enter] and quit: q [enter]
  • Resize the filesystem to fill the enlarged partition (by default the filesystem gets resized to the entire partition): ntfsresize /dev/sda2
  • Boot into Windows

Monday 6 October 2008

Moving from Google Reader back to NetNewsWire

On my daily commute I pass some spots where my iPhones reception is flaky at best. As this leads me to staring into the void of Google Reader trying to fetch some articles, I really want to use a feed reader that downloads articles in advance. Next to this I didn't really like Google Readers interface on the iPhone (too much unnecessary links on the frontpage and the fixed viewport makes long lines of code to be cut off) and can't seem to recall why I left NetNewsWire in the first place.

When comparing Google Readers OPML export to an old OPML export from NetNewsWire I noticed that quite a few feeds appeared in only one of the two exports. After googling for a way create an union out of more than one OPML file, and contemplating to make one myself using the XML::OPML CPAN module I settled for the following workflow to find get the feeds unique to Google Readers OPML export

Creating an OPML export out of Google Reader can be done in Settings and then Import/Export

In TextMate

  • Apply a regular expression replace to both OPML files. Replace .*xmlUrl="(.*?)".*|.* with $1
  • Use the Filter through Command sort|uniq on both files and save them
  • Select both files in the Project Drawer and apply a diff to the selected files
  • To only keep feeds unique to the first OPML file use the Filter through Command grep '^-'
  • Apply a regular expression replace replacing ^(.*)$ with <outline xmlUrl="$1" />
  • Add <opml version="1.0"><body> to the begin and <body/><opml/> to the end of the file and save the file
  • Import the OPML file in NetNewsWire and refresh all subscriptions

Now lets hope that the web interface to NewsGator is as nice as Google Reader

Edit: Hmm, just thought that I could also do this by importing my old NetNewsWire OPML, replacing the NewsGator subscriptions with NetNewsWire, removing all subscriptions from NetNewsWire and then importing Google Readers OPML and merging NetNewsWire and NewsGator. But where is the fun in that :)

Wednesday 25 June 2008

Googling for my domain name

While googling for www.kuijjer.com I found out that the Did you mean result gives a lot of insight in Googles pervasive knowledge. It even has knowledge of my family relations and shows the last name of my mother :) Google_www.kuijjer.com.png

Tuesday 24 June 2008

Adding Google Analytics to DotClear

To add the JavaScript needed by Google Analytics to DotClear I simply added a text widget using the Presentation widgets menu option.

Keeping the Title empty makes the script appear invisible, and dechecking the Home page only checkbox adds the script to every page.

DotClear_GoogleAnalytics.png

Sunday 22 June 2008

First impressions of DotClear on Gandi

Installing DotClear on my domain was a breeze. As it is hosted by my domain registrar Gandi, it merely consisted of a few clicks and changing the default subdomain of blog to www.

The next steps will consist of making a few adjustments:

  • Looking through the default themes, and picking one with a minimal, clean look
  • Changing that theme to look more minimal (e.g. by letting links be underlined)
  • Finding a way to add Google Analytics to DotClear, which could be problematic as I don't have much control of its installation