Sun, 19 Nov 2006 15:46:36 +0000

cheapskate HD upgrade

As the hard-disk of my PC exhibited its first hard error after months of strange noises I was forced to replace it. This machine dual-boots WinXP (on NTFS) and Debian, Windows' boot manager invokes grub and I absolutely did not want to re-install either Windows or Debian or try to figure how to resurrect a broken WinXP bootmanager.

So I used the the dd-method again:

  1. Plugin new disk as hdc
  2. dd_rescue -b 512k -A /dev/hda /dev/hdc (I had to use -b 1 for copying the almost broken sectors.)
  3. Either re-partion or simply add more partitions at the end. (The new disk is always bigger.) Don't touch the first partition, which is NTFS and take care that the partion containing /boot gets the same partition number/position. - This way grub will grub will continue to work. Use cp -ax to acually copy the data to the new partitions. (cp is dog slow for copying directories containing many files, like ~/mail or ~/.ccache. - Two tar instances talking to each other over a pipe would probably be a lot faster but I cannot remember the 42 options needed to replicate cp -ax behavior.)
  4. Power off, switch disks, power on.
  5. Verify that your data is still there and clean the old disk, using shred(1) and openssl rand -rand /dev/urandom -out /dev/hdc1 somereallybignumber.

The process would be smoother if I knew of a sane way of copying NTFS (preserving ACLs) and could be bothered to actually remember how I setup grub in the first place. ;-)


Posted by Andreas Metzler | Permanent link | File under: linux