Recover a Windows 10 Bootcamp installation from a .dmg file in an iMac

0

I accidentally deleted a Windows 10 partition from my iMac SSD (I have a late 2015 27" i7-based with 1TB of SSD running macOS Mojave 10.14.5).

I was going to reinstall everything from scratch using Boot Camp Assistant, but I then remembered that I had a .dmg image of the BOOTCAMP drive that I created when I had problems with my motherboard about a year ago. Being able to use that image would save me hours of installation.

I was able to recreate the BOOTCAMP disk partition using Disk Utility and to copy my .dmg image into this new partition. The BOOTCAMP drive seems to mount normally and I can access all the files in OSX as I used to.

What I'm still not able to do is to boot from that image. I don't see the BOOTCAMP drive as an option when I start the iMac with the option key pressed. If I go to "Settings / Startup Disk" I do see "BOOTCAMP Windows" as one option, but when trying to select it I get an error message stating "You can’t change the startup disk to the selected disk. The bless tool was unable to set the current boot disk."

I also mounted the EFI disk and noticed that the only existing folder is APPLE:

$ sudo mkdir /Volumes/EFI
$ sudo mount -t msdos /dev/disk0s1 /Volumes/EFI
$ ls /Volumes/EFI/EFI
APPLE

Information on the partitions:

$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         699.9 GB   disk0s2
   3:       Microsoft Basic Data BOOTCAMP                300.3 GB   disk0s3

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +699.9 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            630.7 GB   disk1s1
   2:                APFS Volume Preboot                 42.1 MB    disk1s2
   3:                APFS Volume Recovery                509.8 MB   disk1s3
   4:                APFS Volume VM                      2.1 GB     disk1s4

More information on the partition table:

$ sudo gpt show disk0
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34           6         
          40      409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      409640  1366955032      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
  1367364672         960         
  1367365632   586590208      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  1953955840      254247         
  1954210087          32         Sec GPT table
  1954210119           1         Sec GPT header

I've also followed the instructions on Windows detects GPT disk as MBR in EFI boot and confirmed that the MBR is set to protective and not hybrid:

$ sudo gdisk /dev/disk0
GPT fdisk (gdisk) version 1.0.4

Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

I've also attempted to run Parallels Desktop virtual machine in an attempt to configure something with no success. I do get access to an EFI shell, though.

Is there any hope I can reuse my original .dmg image or should I give up and install Windows 10 and all my software tools from scratch?

8/2/19 UPDATE

I installed windows 10 from scratch using Boot Camp Assistant in a partition of the same size I had before.

Using the .dmg file I overwrote my old BOOTCAMP disk image over the recently created one. At this point, the system fails to boot in Windows (I get the error message complaining that the file winload.efi is missing or contains errors).

Booting to an USB drive with Windows 10 installation, I opened a console and followed the instructions in here. The bootrec /fixboot command failed (access denied), but despite that I was able to successfully boot into my old Windows 10 image again :).

joribama

Posted 2019-06-27T00:20:31.763

Reputation: 101

No answers