4

So, I'be managed to migrate my Windows 7 data over from /dev/sdb3 to a new partition on /dev/sdc1 using ntfsclone. I managed to resize the volume size to match the new partition size. I also used ms-sys to add a Windows 7 MBR to /dev/sdc.

Windows won't boot. It will if I have /dev/sdb3 still enabled, but the ultimate goal here is to remove that partition. Besides, under this condition my new drive is only seen as D and not as the boot drive. I've googled all over.... Help?

The ntfsclone command was ntfsclone -O /dev/sdc1 /dev/sdb3

4 Answers4

1

I found that cloning Windows partition to a different disk fails all too often, sometimes because of the changed drive letters, sometimes because of botched boot records, etc. The following two solutions helped me many times, but they are not 100% foolproof either:

  • Use "Repair" function of Windows 7 boot disk. It often manages to repair many boot problems. Change the boot drive back to C: using these instructions. Unfortunately, this does not work in 100% of cases.

  • Alternative approach: From within Windows (booted into your old partition), create a mirror of your boot/system partition as your new partition. After the mirror sync completes, break the mirror and keep the new partition only. This method requires converting your disks to dynamic disks, which may cause problems if you need to access these disks from Linux or other non-Windows OSes.

haimg
  • 23,153
  • 17
  • 83
  • 117
1

You can install linux alongside windows. It will take like 2 Gb and grub will detect windows and it will show up in boot menu. You can make it default after 1 sec delay. As an added bonus you will have spare system to boot into in case of emergency. I always do that.

Art Shayderov
  • 280
  • 1
  • 7
0

Windows creates a 100MB hidden partition that is needed to boot in most cases. Did you copy/recover it as well?

Dave M
  • 13,250
0

I didn't succeed with ntfsclone, but I did with dd. Here's what I did, in case it may be useful.

Old drive is /dev/sda, 640GB; new drive is a 120GB ssd in /dev/sdb/.
I had 3 partitions, one 15GB recovery, one 100MB boot partition and the system (mounted on C: in windows).

First step is to get all start/end sectors of the old disk:

root@sysresccd /root % gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************

Disk /dev/sda: 1250263728 sectors, 596.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 95A8B5D6-CA2E-4D48-A3EA-856883098142
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1250263694
Partitions will be aligned on 2048-sector boundaries
Total free space is 4717 sectors (2.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048        31459327   15.0 GiB    2700  Windows RE
   2        31459328        31664127   100.0 MiB   0700  Microsoft basic data
   3        31664128      1250260991   581.1 GiB   0700  Microsoft basic data

Then I created the same partitioning using fdisk:

fdisk /dev/sdb

I created the three partitions using the sector locations provided by the previous gdisk output.
Then, I marked the second partition as bootable using cfdisk /dev/sdb.

The last step is the copying of data using dd, as the ntfsclone -O /dev/sdb1 /dev/sda1 method didn't work:

dd if=/dev/sda1 of=sdb1 conv=notrunc
dd if=/dev/sda2 of=sdb2 conv=notrunc
dd if=/dev/sda3 of=sdb3 conv=notrunc

This is worth putting into a screen and getting the pid to send it USR1 signals to get the progression.

On my setup the last partition was shrunk to 100GB, followed by around 500GB of free space (640GB disk). The last dd command ended with a no space left on device (120GB SSD).

However rebooting worked like a charm and Windows felt at home. It even made me laugh saying he found a new hardware, found drivers and installed it. "Bingo, you need to reboot for that hardware to be working properly!"
Except that said hardware was the SSD it booted on (the old HDD was removed from the computer).

Please note that all of this was deducted mainly from this blog post: http://linuxtips.manki.in/2011/11/migrating-to-new-ssd-without-data-loss.html