Copy Windows to a new drive using Linux

Found a nice post on how to transfer Windows to a new drive using Linux here:

http://www.nilbus.com/linux/disk-copy

Your mileage may vary but it is simple as:

1> Using fdisk -u  /dev/sdX   (X=new drive), make an exact partition setup on the new drive as the original

The -u command allows to size the new drive exact as the old – this is important for step #3 #4

2> Then copy the old drives MBR data to the new drive using the command:
dd if=/dev/sdb of=/dev/sda bs=446 count=1

Note:  /dev/sdb is the original drive     &     /dev/sda is the new drive  { VERY IMPORTANT!! }

3> Then copy the contents from the original drive to the new drive

dd if=/dev/sdb1 of=/dev/sda1 bs=4096

Note:  /dev/sdb1 is the original drive     &     /dev/sda1 is the new drive  { VERY IMPORTANT!! }

Also note that this will take a lot of time (depending on how large your drive is), in a new termial run the “top” command (by itself) to see if the dd is taking up CPU cycles and ensure it is not hung).  For example, a 100GB drive will take ~90 min with fast drives and a fast system!

4>  Then resize the new drive with Gparted or qtparted or parted or via ntfsresize

ntfsrezize -f -v /dev/sda1

5>  When you first boot your new drive allow the check disk to run and then allow the system to reboot and then reboot one more time for good measure.

6> When get into Windows, Windows will see the new drive load drivers and then ask to reboot once more.  When done you’re complete.

This worked great for what I needed.  Here  I traded out an older 120GB drive (PATA) into a new 320GB SATA drive with little fan fair.

Your mileage may vary; but, follow the instructions and observe the command notes and you’ll be fine.

Enjoy!
~Jim

My DOS epiphany as of late . . .

Recently during a hard drive upgrade I ran across some IE temp files that got corrupted and just would not delete.  I needed them gone because IMAGEX (an article for a later post) would not work as it couldn’t see these files for the image.

Of course you can’t delete the directory they are left in as well “directory not empty” error (or so I thought).   After a little searching and some frustration, I found the following command, living just under my nose!

C:>   RMDIR  <C:\ “Directory to delete and contents”>   /S /Q

/S  – get the directory and all files
/Q – does it without approval

Yup, “bye bye” directory and “bye bye” file that won’t go away.   Just too simple.

Enjoy!
~Jim