Quickest Way to Clone Windows (and Windows Server) Disk with GPartEd
A quick tech note from the day job some of you might find useful.
GPartEd is a fantastic free tool for copying and resizing disk partitions, but cloning an entire Windows disk often requires tweaking boot sectors and records after the partitions are copied and this is not always easy or intuitive. The following is a simple method to clone a Windows disk quickly without all the messing around with boot sector issues. I just used this on Windows Server 2008 but it should work on Windows Server 2012, Windows 7 and Windows 8.
. . .
1. Connect drives to a host and boot the host with the GPartEd Live CD
2. Review the layout of partitions in GPartEd, delete any partitions on the target drive.
3. Right-click on the desktop and start a root terminal
4. Begin a sector-by-sector copy of the drive by typing:
dd if=/dev/sda of=/dev/sdb bs=8192
(This assumes sda is your source drive and sdb is the target)
5. Let the "dd" run for a minute or two and then control-c out of it.
6. "Refresh Devices" in GPartEd, go to /dev/sdb and delete any partitions you see there.
7. Finally, Copy, Paste, & Apply the partitions for /dev/sda to /dev/sdb in the normal manner.
8. Set the "boot" flag on the first partition on /dev/sdb
​9. Fin!
Because we dd'd the beginning of the disk in step 4, there will be no messing about with Startup Repair, bootrec, bootsec, or diskpart. Your disk will just boot into Windows or Windows Server!
Just used this method for two machines running Win7, works a treat but will do a disk check on first boot, after that works perfectly.
Works great!
Thanks for tip with dd, clone disks in office fast and safe. 😀
Can I use firstly gparted and dd after it?
just tetsted it, not possible. BTW Clonezilla copies 6xx Bytes as Boot sectors.
The dd is used to copy the full MBR (you actually only need the first 512 bytes for the bootloader and partition layout)
dd if=/dev/sda of=/dev/sdb bs=512 count=1
In theory, you could run dd (limited to 512 bytes) after you’ve copied the partitions in gparted, but it’s easier to just do it first to avoid any quirks. You could actually dd the entire drive if they were exactly the same size, but this will also copy all of the unused space instead of just what is in use, so it runs much slower
Also, make sure the primary partition on the new drive gets the boot flag set. When I’ve done partition copies like this, it sometimes doesn’t get set.
In a virtual environment, a similar concept can be used to shrink a bootable, virtual disk (you have to shrink the partition on the old disk before the dd copy).
Yes, great tip. To make it even easier, dd will accept a count= parameter, with a count of blocks. Two other tips: you can use any block size that is a multiple of the disk sector, and dd will accept letter suffixes for powers of 2.
So I usually use the following format
dd if=sda of=sdb bs=1M count=20
to copy the first 20 megabytes. Works great!
Cool! Thank you!
Make it easer http://clonezilla.org/
regards…
With GParted you can shrink the partition first, allowing you to clone to smaller drives (e.g. 1 TB HDD to 240 GB SSD). Can’t do that with Clonezilla!