Target "busy" when restoring bootcamp from .dmg

Problem: asr (and the DIsk Image utility) say "Resource busy" and both refuse to do the restore. The only indication I've found that something isn't right is that gpt says "Suspicious MBR at sector 0".


Same problem occurs when attempting to erase only or use Bootcamp Assistant to remove the bootcamp partition and change to a single OS X partition. So, I'm totally stuck short of resetting the entire Macbook Pro to factory defaults. The thing is that Yosemite and WIndows 8.1 boot and run perfectly otherwise. If there is some little thing I can do to repair this issue that would save me a lot of grief. Because of the "Suspicious MBR at sector 0" I went to some effort to manually analyzed the protective MBR and the NTFS boot record from raw hex dumps but I could not find any anomalies (though I am no expert on filesystem data structures). See details below. I must be looking in the wrong place.


History: (OSes: Yosemite 10.10.2, Windows 8.1)

  1. I successfully created a 40 Gb bootcamp partition and installed windows (thinking 40 Gbs would be enough to play a windows game on a Macbook Pro)
  2. I installed the game, rebooted into OS X and immediately used the Disk Image utility to create a .dmg backup image of bootcamp.
  3. I then discovered that 40 Gb was not large enough after running out of diskspace playing the game -- lots of cache files.
  4. Before increasing the bootcamp partition size; I tested the restore of the .dmg backup using the Disk Image utility on the 40 Gb partition. This worked flawlessly (windows booted just fine and the windows snapshot state was perfect), This validated that the backup .dmg image is good.
  5. I rebooted back into OS X and used Bootcamp Assistant to remove the 40 Gb bootcamp partition. This worked flawlessly and OS X reclaimed the disk space.
  6. I rebooted into OS X again (just as a precaution) and used Bootcamp Assistant to create a 70 Gbs bootcamp partition with windows install checked but with the create bootcamp USB drive unchecked. This was because I still had a bootcamp USB stick for the previous 40 Gb install from only a week before. I was thinking why do that again.
  7. Bootcamp did all its magic and it successfully installed the factory default Windows 8.1 from the DVD and I ran the bootcamp setup from the USB drive. It appeared to work flawlessly. I can boot into both system just like before and both system claimed there were no disk issues after running the appropriate disk checking utilities on both.
  8. Then the problems began. After rebooting back into OS X, I attempted to restore the 40Gb .dmg disk image into the newly created 70 Gb bootcamp partition which I had successfully done a few hours before but this time no go. The Disk Image utility refused with "Resource busy" no matter what. That's when I dropped into command line mode to collect more info. The only indication that something is wrong is that gpt says "disk0: Suspicious MBR at sector 0".


Command line details:


SILCLT27047A:~ admin$ su

Password:

sh-3.2# umount /dev/disk0s4

sh-3.2# asr imagescan --source Downloads/Skyrim_new_install.dmg

unable to get blkx for partition 1.

unable to get UDIF info from "/Users/admin/Downloads/Skyrim_new_install.dmg" - Invalid argument.

asr: image scan failed - Invalid argument.

# I’m assuming this fails because asr doesn’t understand BOOTCAMP/NTFS images

sh-3.2# hdiutil attach /Users/admin/Downloads/Skyrim_new_install.dmg

expected CRC32 $68C957A8

/dev/disk2 /Volumes/BOOTCAMP

sh-3.2# hdiutil info

framework : 396

driver : 10.10v396

================================================

image-path : /Users/admin/Downloads/Skyrim_new_install.dmg

image-alias : /Users/admin/Downloads/Skyrim_new_install.dmg

shadow-path : <none>

icon-path : /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icn s

image-type : UDIF read-only compressed (zlib)

system-image : false

blockcount : 78123008

blocksize : 512

writeable : false

autodiskmount : TRUE

removable : TRUE

image-encrypted : false

mounting user : root

mounting mode : <unknown>

process ID : 551

/dev/disk2 /Volumes/BOOTCAMP

sh-3.2# mount

/dev/disk1 on / (hfs, local, journaled)

devfs on /dev (devfs, local, nobrowse)

map -hosts on /net (autofs, nosuid, automounted, nobrowse)

map auto_home on /home (autofs, automounted, nobrowse)

localhost:/K4SrlfVYzI8Mv4bD6zBz_i on /Volumes/MobileBackups (mtmfs, nosuid, read-only, nobrowse)

/dev/disk2 on /Volumes/BOOTCAMP (ntfs, local, nodev, nosuid, read-only, noowners, mounted by admin)

sh-3.2# diskutil list

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *750.2 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_CoreStorage 679.3 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data BOOTCAMP 70.0 GB disk0s4

/dev/disk1

#: TYPE NAME SIZE IDENTIFIER

0: Apple_HFS Macintosh HD *678.9 GB disk1

Logical Volume on disk0s2

181BFC3C-A1A7-471A-ACB3-F7AB0C28AB0D

Unencrypted

/dev/disk2

#: TYPE NAME SIZE IDENTIFIER

0: BOOTCAMP *40.0 GB disk2

sh-3.2# asr --source /Volumes/BOOTCAMP --target /dev/disk0s4 --erase --verbose

Validating target...done

Validating source...done

Erase contents of /dev/disk0s4? [ny]: y

Repartitioning target device...

Could not change the partition type for /dev/disk0s4 - Resource busy

sh-3.2# gpt -r -vv show disk0

gpt show: disk0: mediasize=750156374016; sectorsize=512; blocks=1465149168

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: disk0: Sec GPT at sector 1465149167

start size index contents

0 1 MBR

1 1 Pri GPT header

2 32 Pri GPT table

34 6

40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

409640 1326751200 2 GPT part - 53746F72-6167-11AA-AA11-00306543ECAC

1327160840 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

1328430376 728

1328431104 136716288 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

1465147392 1743

1465149135 32 Sec GPT table

1465149167 1 Sec GPT header

sh-3.2# fdisk /dev/rdisk0

Disk: /dev/rdisk0 geometry: 91201/255/63 [1465149168 sectors]

Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>

2: AC 1023 254 63 - 1023 254 63 [ 409640 - 1326751200] <Unknown ID>

3: AB 1023 254 63 - 1023 254 63 [1327160840 - 1269536] Darwin Boot

*4: 07 1023 254 63 - 1023 254 63 [1328431104 - 136716288] HPFS/QNX/AUX

sh-3.2# dd if=/dev/rdisk0 count=1 2>/dev/null | hexdump -C

00000000 33 c0 8e d0 bc 00 7c 8e c0 8e d8 be 00 7c bf 00 |3.....|......|..|

00000010 06 b9 00 02 fc f3 a4 50 68 1c 06 cb fb b9 04 00 |.......Ph.......|

00000020 bd be 07 80 7e 00 00 7c 0b 0f 85 0e 01 83 c5 10 |....~..|........|

00000030 e2 f1 cd 18 88 56 00 55 c6 46 11 05 c6 46 10 00 |.....V.U.F...F..|

00000040 b4 41 bb aa 55 cd 13 5d 72 0f 81 fb 55 aa 75 09 |.A..U..]r...U.u.|

00000050 f7 c1 01 00 74 03 fe 46 10 66 60 80 7e 10 00 74 |....t..F.f`.~..t|

00000060 26 66 68 00 00 00 00 66 ff 76 08 68 00 00 68 00 |&fh....f.v.h..h.|

00000070 7c 68 01 00 68 10 00 b4 42 8a 56 00 8b f4 cd 13 ||h..h...B.V.....|

00000080 9f 83 c4 10 9e eb 14 b8 01 02 bb 00 7c 8a 56 00 |............|.V.|

00000090 8a 76 01 8a 4e 02 8a 6e 03 cd 13 66 61 73 1c fe |.v..N..n...fas..|

000000a0 4e 11 75 0c 80 7e 00 80 0f 84 8a 00 b2 80 eb 84 |N.u..~..........|

000000b0 55 32 e4 8a 56 00 cd 13 5d eb 9e 81 3e fe 7d 55 |U2..V...]...>.}U|

000000c0 aa 75 6e ff 76 00 e8 8d 00 75 17 fa b0 d1 e6 64 |.un.v....u.....d|

000000d0 e8 83 00 b0 df e6 60 e8 7c 00 b0 ff e6 64 e8 75 |......`.|....d.u|

000000e0 00 fb b8 00 bb cd 1a 66 23 c0 75 3b 66 81 fb 54 |.......f#.u;f..T|

000000f0 43 50 41 75 32 81 f9 02 01 72 2c 66 68 07 bb 00 |CPAu2....r,fh...|

00000100 00 66 68 00 02 00 00 66 68 08 00 00 00 66 53 66 |.fh....fh....fSf|

00000110 53 66 55 66 68 00 00 00 00 66 68 00 7c 00 00 66 |SfUfh....fh.|..f|

00000120 61 68 00 00 07 cd 1a 5a 32 f6 ea 00 7c 00 00 cd |ah.....Z2...|...|

00000130 18 a0 b7 07 eb 08 a0 b6 07 eb 03 a0 b5 07 32 e4 |..............2.|

00000140 05 00 07 8b f0 ac 3c 00 74 09 bb 07 00 b4 0e cd |......<.t.......|

00000150 10 eb f2 f4 eb fd 2b c9 e4 64 eb 00 24 02 e0 f8 |......+..d..$...|

00000160 24 02 c3 49 6e 76 61 6c 69 64 20 70 61 72 74 69 |$..Invalid parti|

00000170 74 69 6f 6e 20 74 61 62 6c 65 00 45 72 72 6f 72 |tion table.Error|

00000180 20 6c 6f 61 64 69 6e 67 20 6f 70 65 72 61 74 69 | loading operati|

00000190 6e 67 20 73 79 73 74 65 6d 00 4d 69 73 73 69 6e |ng system.Missin|

000001a0 67 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 |g operating syst|

000001b0 65 6d 00 00 00 63 7b 9a d0 f2 da d7 00 00 00 fe |em...c{.........|

000001c0 ff ff ee fe ff ff 01 00 00 00 27 40 06 00 00 fe |..........'@....|

000001d0 ff ff ac fe ff ff 28 40 06 00 e0 9d 14 4f 00 fe |......(@.....O..|

000001e0 ff ff ab fe ff ff 08 de 1a 4f 20 5f 13 00 80 fe |.........O _....|

000001f0 ff ff 07 fe ff ff 00 40 2e 4f 00 20 26 08 55 aa |.......@.O. &.U.|

00000200

sectors=08262000h=136716288d=69.998gbs

——————————————————————————————————————-

Manual Analysis of Protective MBR at sector 0

000-1BD: bootstrap loader

1BE-1CD: 00 | fe ff ff | ee | fe ff ff | 01 00 00 00 | 27 40 06 00 #1

status=00 inactive, type=ee (EFI), lba=00000001h=1d

sectors=00064027h=409639d=209.735mbs

end=1d+409639d=409640d

gap=0d

1CE-1DD: 00 | fe ff ff | ac | fe ff ff | 28 40 06 00 | e0 9d 14 4f #2

status=00 inactive, type=ac (CS), lba=00064028h=409640d

sectors=4f149de0h=1326751200d=679.296gbs

end=409640d+1326751200d=1327160840d

gap=0d

1DE-1ED: 00 | fe ff ff | ab | fe ff ff | 08 de 1a 4f | 20 5f 13 00 #3

status=00 inactive, type=ab (Darwin Boot), lba=4f1ade08h=1327160840d

sectors=00135f20h=1269536d=650.002mbs

end=1327160840d+1269536d=1327287793d

gap=1143311d=585.375mbs

1EE-1FD: 80 | fe ff ff | 07 | fe ff ff | 00 40 2e 4f | 00 20 26 08 #4

status=80 active, type=07 (NTFS), lba=4f2e4000h=1328431104d

1FE-1FF: 55 aa boot signature

——————————————————————————————————————-

sh-3.2# fdisk /dev/disk0s4

Disk: /dev/disk0s4 geometry: 8510/255/63 [136716288 sectors]

Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: 72 80 13 10 - 371 101 51 [1920221984 - 1816210284] <Unknown ID>

2: 6C 357 43 4 - 367 32 52 [1936028192 - 1953653108] <Unknown ID>

3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

# Appears fdisk can’t interpret NTFS boot sectors; this is garbage

sh-3.2# dd if=/dev/rdisk0 skip=1328431104 count=1 2>/dev/null | hexdump -C

00000000 eb 52 90 4e 54 46 53 20 20 20 20 00 02 08 00 00 |.R.NTFS .....|

00000010 00 00 00 00 00 f8 00 00 3f 00 ff 00 00 40 2e 4f |........?....@.O|

00000020 00 00 00 00 80 00 80 00 ff 1f 26 08 00 00 00 00 |..........&.....|

00000030 00 00 0c 00 00 00 00 00 02 00 00 00 00 00 00 00 |................|

00000040 f6 00 00 00 01 00 00 00 3a ee e6 8c fe e6 8c c0 |........:.......|

00000050 00 00 00 00 fa 33 c0 8e d0 bc 00 7c fb 68 c0 07 |.....3.....|.h..|

00000060 1f 1e 68 66 00 cb 88 16 0e 00 66 81 3e 03 00 4e |..hf......f.>..N|

00000070 54 46 53 75 15 b4 41 bb aa 55 cd 13 72 0c 81 fb |TFSu..A..U..r...|

00000080 55 aa 75 06 f7 c1 01 00 75 03 e9 dd 00 1e 83 ec |U.u.....u.......|

00000090 18 68 1a 00 b4 48 8a 16 0e 00 8b f4 16 1f cd 13 |.h...H..........|

000000a0 9f 83 c4 18 9e 58 1f 72 e1 3b 06 0b 00 75 db a3 |.....X.r.;...u..|

000000b0 0f 00 c1 2e 0f 00 04 1e 5a 33 db b9 00 20 2b c8 |........Z3... +.|

000000c0 66 ff 06 11 00 03 16 0f 00 8e c2 ff 06 16 00 e8 |f...............|

000000d0 4b 00 2b c8 77 ef b8 00 bb cd 1a 66 23 c0 75 2d |K.+.w......f#.u-|

000000e0 66 81 fb 54 43 50 41 75 24 81 f9 02 01 72 1e 16 |f..TCPAu$....r..|

000000f0 68 07 bb 16 68 52 11 16 68 09 00 66 53 66 53 66 |h...hR..h..fSfSf|

00000100 55 16 16 16 68 b8 01 66 61 0e 07 cd 1a 33 c0 bf |U...h..fa....3..|

00000110 0a 13 b9 f6 0c fc f3 aa e9 fe 01 90 90 66 60 1e |.............f`.|

00000120 06 66 a1 11 00 66 03 06 1c 00 1e 66 68 00 00 00 |.f...f.....fh...|

00000130 00 66 50 06 53 68 01 00 68 10 00 b4 42 8a 16 0e |.fP.Sh..h...B...|

00000140 00 16 1f 8b f4 cd 13 66 59 5b 5a 66 59 66 59 1f |.......fY[ZfYfY.|

00000150 0f 82 16 00 66 ff 06 11 00 03 16 0f 00 8e c2 ff |....f...........|

00000160 0e 16 00 75 bc 07 1f 66 61 c3 a1 f6 01 e8 09 00 |...u...fa.......|

00000170 a1 fa 01 e8 03 00 f4 eb fd 8b f0 ac 3c 00 74 09 |............<.t.|

00000180 b4 0e bb 07 00 cd 10 eb f2 c3 0d 0a 41 20 64 69 |............A **|

00000190 73 6b 20 72 65 61 64 20 65 72 72 6f 72 20 6f 63 |sk read error oc|

000001a0 63 75 72 72 65 64 00 0d 0a 42 4f 4f 54 4d 47 52 |curred...BOOTMGR|

000001b0 20 69 73 20 63 6f 6d 70 72 65 73 73 65 64 00 0d | is compressed..|

000001c0 0a 50 72 65 73 73 20 43 74 72 6c 2b 41 6c 74 2b |.Press Ctrl+Alt+|

000001d0 44 65 6c 20 74 6f 20 72 65 73 74 61 72 74 0d 0a |Del to restart..|

000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|

000001f0 00 00 00 00 00 00 8a 01 a7 01 bf 01 00 00 55 aa |..............U.|

00000200

——————————————————————————————————————-

Manual Analysis of NTFS boot sector at sector 1328431104

000-002: EB 52 90 (short JMP=EBh offset=52h from byte after JMP=54h + noop=90h)

003-00a: 4e 54 46 53 20 20 20 20 = “NTFS “ 8 bytes (OEM ID)

00b-023: Primary BPB 25 bytes

00b: 0200h=512d bytes per sector

00d: 08h=8d sectors per cluster (cluster size=4096 bytes)

00e: 0000h=0d reserved sectors

010: 000000h always 0

013: 0000h ignored

015: f8h media descriptor

016: 0000h ignored

018: 003fh=63d sectors per track

01A: 00ffh=255d # of heads

01C: 2e400000=775946240d hidden sectors (397.284mbs) for crash dumps?

020: 00000000h ignored

024-053: Extended BPB 48 bytes

024: 80008000h ignored

028: 0000000008261fffh=136716287d total sectors (69.998gbs)

030: 00000000000c0000h=786432d cluster # for $MFT

038: 0000000000000002h=2d cluster # for $MFTMirr

040: 000000f6h=246d clusters per file record segment

044: 01h=1d clusters per index buffer

045: 000000h ignored

048: c03aeee68cfee68ch=54107993273073382d volume serial #

050: 00000000h checksum ignored

054-1fd: Bootstrap code 426 bytes

1fe-1ff: 55 aa (boot signature)

——————————————————————————————————————-

Windows 8.1 dump of Protective MBR within BOOTCAMP:

Description Disk drive

Manufacturer (Standard disk drives)

Model TOSHIBA MK7559GSXF ATA Device

Bytes/Sector 512

Media Loaded Yes

Media Type Fixed hard disk

Partitions 4

SCSI Bus 0

SCSI Logical Unit 0

SCSI Port 0

SCSI Target ID 0

Sectors/Track 63

Size 698.64 GB (750,153,761,280 bytes)

Total Cylinders 91,201

Total Sectors 1,465,144,065

Total Tracks 23,256,255

Tracks/Cylinder 255

Partition Disk #0, Partition #0

Partition Size 200.02 MB (209,735,168 bytes)

Partition Starting Offset 512 bytes

Partition Disk #0, Partition #1

Partition Size 632.64 GB (679,296,614,400 bytes)

Partition Starting Offset 209,735,680 bytes

Partition Disk #0, Partition #2

Partition Size 619.89 MB (650,002,432 bytes)

Partition Starting Offset 679,506,350,080 bytes

Partition Disk #0, Partition #3

Partition Size 65.19 GB (69,998,739,456 bytes)

Partition Starting Offset 680,156,725,248 bytes = 1328431104 sectors

MacBook Pro, OS X Yosemite (10.10.2), restore from .dmg backup

Posted on Apr 5, 2015 12:20 PM

Reply
4 replies

Apr 5, 2015 6:05 PM in response to zaun

1. Step #4 is not valid. You cannot restore a .dmg to a partition whose underlying file system is not understood by OS X. The only utility that understands it is the Apple NTFS driver built into OS X, which is not invoked during a .dmg backup. OS X does not support backing up NTFS file systems. Your test is equivalent to a dd, which will work if the block addresses remain identical.


2. If you have been successful in step 7, why bother with step 8? Re-installing your programs would have been much faster, would it not be? You can see the Hybrid MBR can be seen after you skip blocks, which renders the 40GB restored volume un-bootable.


3. Windows should be backed up using Windows backup and restore utility. System Image restore also restores the volume information, which ends up with a 40GB original volume. Gparted (or any Linux Live CD with Gparted) can be used to re-size the restored volume.


4. Restores can create additional issues. There is a problem with AHCI and such restores. For example - see Bootcamp unrecognized after restoring Windows from system image .


5. You can restore the 40GB dmg to an external disk, and try to extract files from it using the internal 8.1 installation. It may require additional cleanup of the 40GB Windows to be readable.

Apr 7, 2015 7:06 AM in response to Loner T

Thank you Loner T for taking the time to read my post and respond with your expert advice. I have some questions and additional info regarding your responses. I'll address these point-by-point:


  1. I'm somewhat confused in point #1 that you say step 4 is invalid. Yes, it is true that the Disk Image Utility or asr cannot restore a NTFS filesystem from a .dmg directly. One gets an invalid argument error. But, if I do a loopback mount of the .dmg as a virtual drive, then the Disk Image Utility and asr accepts the loopback drive image as a valid source. And, my 1st restore worked doing exactly that. Why can't I do the same to a larger bootcamp partition? Are you saying that the mismatch in sizes between the source and target or a change in the bootcamp LDA is causing the "resource busy" issue? Or, are you saying the image restore is doomed to failure later on because I'm no longer restoring to exactly the same disk area and size that the .dmg was backed up from? The fact that I get the same "resource busy" error trying to erase or remove the bootcamp partition indicates to me that something is failing way before the source image even comes into the picture.
  2. #2 is a valid point. It's all about DRM. Both Windows and the game were properly "activated" before taking the .dmg image snapshot. What I have running on the bootcamp partition now has not been activated (and can't be without triggering a DRM violation). Installing this new Windows instance (with bootcamp support) was just a necessary step for preparing the bootcamp partition for an overwrite with the properly activate image. Or, at least, that was my plan until I got stopped by target "resource busy".
  3. #3 is a valid point but, too late for me to do anything about it now. Windows Basic doesn't have a system backup/restore tool. That's only available in more premium editions of Windows. Hence, the reason I didn't consider that approach.
  4. On #4, I looked at AHCI discussion and it appears that the Hybrid MBR and/or GPT got messed up during the restore. Since I am attempting to overwrite the NTFS volume only without touching the partition maps, this shouldn't be an issue, right? But, as a precaution I could backup the GPT and the Hybrid MBR using gdisk to an external drive before attempting the restore in case things do get messed up.
  5. On #5, if I am able to get past the "resource busy" issue and then run into actual restore issues, I may consider this alternative but I'll still have to deal with Windows/game reactivation so this is unlikely to get me where I need to be. As a work-around to the "resource busy" issue I may convert the gzip compressed .dmg snapshot into an uncompressed disk image and attempt to use dd to overwrite the bootcamp volume directly. If it boots, I should be able to use various Windows disk management tools to expand the original 40Gb NTFS volume size to fill the 70Gb partition. The "resource busy" issue will still be there but, hopefully, I will have my activated Windows/game instance running again. I figure, what have I got to lose if my only alternative is to erase and re-partition the entire disk drive and restore everything from scratch. (I do maintain Time Machine, VM and .dmg backups on an external drive.)


B.T.Y. I compared the GPT and the Hybrid MBR partition maps and they exactly match. So, this "resource busy" issue doesn't appear to have anything to do with mismatches between the MBR and GPT or any form of partition map corruption as far as I can tell. I just can't figure out where this is coming from. I'm guessing there is some busy lock on that volume maintained by OS X that makes it think that the volume is always in use. umount -f (force) doesn't have any effect. Any further ideas? I really do appreciate your help and suggestions. -zaun

Apr 7, 2015 7:41 AM in response to zaun

1. Did your restore allow you to boot from the 40GB original volume? Yosemite has a NTFS checker which runs in the background. You can see it in the Console logs. You should consider something like Winclone or CampTune to backup the NTFS from the OSX side, rather than using ** to create a .dmg.


2. Re-activation of Windows is allowed on the same hardware. I cannot say how your game will respond to activation.


3. See Winclone ro CampTune as an alternate.


4. You should also verify the MBR after restore. Gdisk will back up your GPT, from which your MBR can be reconstructed.


5. Using Windows Disk Management will modify the MBR, causing it to be out of sync with the GPT. This can lead to data loss and other unexpected behavior.

Apr 10, 2015 1:01 PM in response to Loner T

Yes, in step #4 of my original post I was able to restore from the .dmg using the Disk Utility and both: (1) have the restored bootcamp volume mounted read-only by OS X and (2) boot into the restore bootcamp partition. But, at step #7 OS X complained of target "resource busy" on any operation having to do with bootcamp and I was never able to repeat step #4 again. From that point on, neither Bootcamp Assistant nor the Disk Utility (or their underlying command-line counterparts) were ever able to add, modify, erase or delete a bootcamp partition. Something got corrupted but I never figure out what it was. I ran disk verifications using gdisk, gpt, the Mac OS X Recovery Disk Utility and Windows chkdsk. None of them reported any errors with the exception of gpt reporting a Suspicious MBR which I now think is a red-herring. I think it always reports that for any Hybrid MBR.


However, in a round-about way, I was able to get back into the state of step #4. Since OS X prevented me from using DIsk Utility or Bootcamp Assistant to fix anything due to the "resource busy" issue, I resorted to lower-level measures.

  1. I converted the .dmg into an uncompressed 40 gb .cdr, Then I used dd to overwrite the 70 gb bootcamp partition with that image. This partially worked in that OS X would now mount the bootcamp volume read-only. But, I could not boot into the bootcamp NTFS volume. I think it has something to do with BCD configuration being dependent on the original partition size. More importantly and amazingly, this failed dd attempt somehow cleared the "resource busy" issue so I could use the Mac tools to do things again. I guess it overwrote whatever was causing that error.
  2. Now that "resource busy" was no longer blocking me from removing the bootcamp partition, I removed it with Bootcamp Assistant.
  3. I then ran the OS X Recovery Disk Utility again and this time it found 2 or 3 problems in the disk layout and fixed them.
  4. I was then able to create a 40 gb bootcamp partition again with Bootcamp Assistant, install Windows from the DVD and install the bootcamp support package. This booted just fine.
  5. I then attempted to restore the 40gb .dmg to the 40 gb bootcamp partition using the Disk Utility but this failed with an invalid argument right towards the end. Inspecting the resulting bootcamp partition revealed it was garbage.
  6. I then overwrote the bootcamp partition from the 40gb .cdr again using dd. This succeeded. Now both (1) OS X mounts the bootcamp read-only and (2) I can boot into bootcamp with both the Windows and game activations enabled (as before).


So, now I am back to a place where I have more options. At this point I can entertain some of your suggestions such as using WinClone or if there is a way to get at Windows Backup and Restore (which might be hidden inside the File History) then I may have better luck restoring to a larger bootcamp partition using one of those approaches. The Disk Utility restore is definitely limited to restoring back to the original volume only and it seems to be hit or miss even then -- but, you already knew that.


I think we can close this thread because the "resource busy" issue is now gone. But, don't ask me how. -zaun

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Target "busy" when restoring bootcamp from .dmg

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.