Saturday, January 28, 2012

The Naked and Famous

I am a quite compulsive listenener of music: If i find a band or song i really like i am not ashamed to turn on autorepeat and listen to it over and over till I'm sick of it and can again move on with my life.

Recently i found the insanely underrated NZ Synthie Rock band The Naked and Famous and i haven't stopped listening to them for about two weeks. When we had to pull a three day coding spree to meet a deadline this week, i figured this is the end, they won't stay on my play list after this.
To my surprise i listened to them for basically 70 hours straight and they are still keeping me up writing this blog entry just so i have an excuse to stay awake and listen to them.

The single most impressive song is probably Spank. It has a driving rhythm matching driven lyrics. From all i can gather, they are writing about being the victim of abuse, giving me the chills thinking about it. What evil genius possessed them when they wrote it? I don't dare thinking about listening to it while running, this would push me to limits i don't want to go to.

This is the beginning of a long, awesome friendship.

Friday, January 6, 2012

Saving a Windows partition with dd and getting it to work again.

Situation: I had a failing hdd recently and thus tried to create a backup. There were four partitions, mostly sparse and an already existing secondary partition on the new drive that couldn't be resized. So I didn't have enough space to backup the disk as a whole, and I didn't have enough partitions to copy them one by one and resize them all (gparted). Long story short i ended up doing a
dd if=/dev/sda2 of=/dev/sdb2
mount /dev/sdb2 /mnt
dd if=/dev/sda3 of=/mnt/sda3
dd if=/dev/sda1 of=/mnt/sda1
For two partitions, most importantly the system partition. Now i had a really hard time getting it to boot. Fix: After lots (and lots) of trial and error this is what got me to the finish line:
  • I installed a Windows Vista
  • mounted this installation in gparted (/media/sdb1), rm -rf everything except files that looked boot related, most importantly /BOOT  (WINDOWS/Boot doesn't seem to be relevant)
  • mv  /media/sdb1/BOOT /media/sdb1/BOOT.bak
  • mount -o loop /mnt/sda1 /media/sda1 and cp -r /media/sda1/* /media/sdb1/
  • rm -rf /media/sdb1/BOOT/; mv /media/sdb1/BOOT.bak /media/sdb1/BOOT 
  • reboot into the Windows Vista installation cd and used the fix boot option
  • Boot into Windows again and fix drive letters (before you start up the SQLServer!)
  • Voila
Overall i was reminded of what a pain Windows can be. If the Fix boot doesn't help try this thread.
If you have the luxury of enough space just do a dd if=/dev/sda /dev/sdb!

What doesn't work:
  • dd of the disk image to the disk (blank cursor)
  • dd of the disk image to a new partition (blank cursor on boot)
  • Creating a partition and installing into it (wrong disk offset => blank cursor)
  • Installing Vista and overwriting the partition with a dd (blank cursor)
  • Deleting the partition, installing Vista and copying everything into it (Missing winload.exe)
  • Installing Vista and copying everything safe for WINDOWS/BOOT (MIssing winload.exe)
It's save to assume I tried a couple  more combinations and that every one of them took 4h's -> annoying holiday. Fuck you Windows!