Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Resized partition and now Windows wont boot

I have Mountain Lion on a late 2011 Macbook Pro with Windows 7 installed through boot camp. Everything was running fine then I ran out of space and to get some more GB's I shrunk OSX in disk utility then went into Windows and downloaded a program (AOMEI Partition Assistant) to move the windows partition on the other side of the free space so it could be exteneded into the windows partition. Once everything was done and needed a restart I got met with the following error: 0xc0000225 "The boot selection failed because a required device is inaccessible".


So far I've tried using winclone to take a clone of the partition and using bootcamp to swallow the partition then restoring the image with winclone again. that didnt work.


Then i used the whole bootrec suite (/fixmbr, /rebuildbcd, etc etc)


Marked partition as active. Everything reports back with success


Still nothing.


Then i installed rEFit and it said everything was synced up.


Still nothing.


I did boot into recovery hd and with terminal used diskutil list and found that theres 14 disks. disk0 is my ssd with osx and windows, disk1 is the windows dvd, disk2-13 are all 1mb or less....I was reading somewhere that OSX can only read 4 disks?


Any help would be awesome, I am almost coming to terms with having to wipe everything and restart but I would rather not lose the programs and setup i currently have. Tell me what i need to enter into terminal to report back im pretty well versed in computers just not coding so you can have me do just about anything.


Thank you so much!

MacBook Pro, OS X Mountain Lion (10.8.2), 2.2Ghz Core i7 8GB RAM. 120GB SSD.

Posted on Feb 10, 2013 9:51 PM

Reply
33 replies

Jul 3, 2013 9:52 AM in response to John Howard14

1) If I wanted to copy the entire hard drive image (OS X + bootcamp Win7) and have a fully bootable restore, would copying the entire rdisk0 be the way to do it? e.g. dd if=/dev/rdisk0 of=/Volumes/Backup/<filename>.img bs=1m


Yes. But realize that the disk to restore to must have the same, or more, number of sectors. Two "2TB" disks will invariably have different number of sectors, so to go smaller you have to shrink the last file system first. When you go to a bigger disk, everything will just work, even if you don't do anything else. But there are two small issues: a.) the backup GPT won't be at the end of the disk, per spec. The primary GPT will still correctly point to the backup GPT, but it ought to be placed in the correct location which can be done with gdisk. And b.) you'll want to adjust the size of one or both of the file systems, which can be pretty tricky without the use of 3rd party tools specifically designed to deal with hybrid MBRs and GPTs. It's important to understand that Apple's diskutil almost invariably does this wrong, and also sets the MBR partition type code incorrectly, rendering Windows unbootable.

1a) I assume [keyword here] I would need to boot from an external firewire or USB drive to do this (I have one with 10.8.4 installed with utilities) as well as the target .img file also external (could do on same drive?)


I might not be entirely following the question. The source disk, use for if=, needs all filesystems unmounted or at least read only (i.e. single user mode boot). If any source file system is read/write, it'll change as the sector copy is happening, which renders the sector copy corrupt. It usually can be fixed, but I don't advise depending on this. You can boot from the destination disk, set as of=, since in this context you're writing a file to a file system in that direction. When you do a restore, this flips around. You can be booted from the source, since it contains the image file, but the destination needs to be unmounted (which it would be because presumably it's blank).


There's no possible way to sector copy a disk to a file on the same disk because that implies one of the file systems on that disk is r/w and changing constantly, so you'll just create a useless image file. You can sector copy one partition to a file on another partition's file system, however. But that only copies that particular partition, nothing outside of it.



1b) I am not sure of the rdisk0 parameter -- would I need to do rdisk0s1, rdisk0s2, etc?


rdisk0 for the whole disk; rdisk0sX if you only want to image a particular partition.


1b) Could the of=<...> be a network share on my NAS? I mount nfs shares in OS X via NFS (e.g. nfs://xxx.xxx.xxx.xxx/SomeShare)

I also assume that using the raw device vs. the character device is the way to capture the GPT and MBR information correctly.


For backing up, of= can be a path to a remote file system containing an image file, yes. For restoring, if= can be a path to a remote file system containing an image file, yes. But it can't be used as a block device, meaning you can't sector copy (read or write) an NFS volume because NFS doesn't expose the underlying storage as a block device.


Raw vs character device simply is about performance. The character device is always 4K block sizes no matter what you set as bs=, and it copies rather slowly. The raw device allows the bs= to be honored and the copy will be at the highest speed for the lowest common denominator performing drive. What copieis the MBR and GPT is copying the whole disk to a file, rather than a partition.


There are some optimizations possible if you're copying this to a NAS, which almost invariably uses a linux file system that supports sparse files (ext and XFS both support sparse files). JHFS+ doesn't, only DMG files can be made sparse, not ordinary files. So it may be worth looking into because the savings can be huge. What I'm not sure of off hand is the interaction of a sparse file and NFS. I *think* that it's implemented at a file system level, so it'd be the NAS's kernel that returns the sectors with zeros that have been optimized away, to nfsd, so the dd command on the Mac simply works. But I haven't tried this.

Jul 4, 2013 12:03 AM in response to Christopher Murphy

Thank you for the comprehensive and quick reply! Your answers gave be better targeted web searching after reading when looking for simular information 😀 ... and sent it to my Evernote webclipper!


If I can skip the disk-to-disk copy and just use my NAS I think it would be more optimal. My NAS is a Netgear ReadyNAS NV+ (SPARC based) and uses Ext3 by default. I am going to try creating three different shares with these protocols: (1) CIFS [SMB] (2) AFP and (3) NFS and test accordingly with a 'dd' create / restore on my older bootcamped MacBook.


Would you suggest adding any additional flags to the 'dd' command for the unmounted raw copy on the source drive? I am not sure if I need the following conv options to cover the bases:


if=/dev/rdisk0 of=/Volumes/NAS_Share/<filename>.img bs=1m conv=sync

... or ...
if=/dev/rdisk0 of=/Volumes/NAS_Share/<filename>.img bs=1m conv=noerror,sync


Thank you 🙂

Jul 4, 2013 9:49 PM in response to John Howard14

If you have the option of NFS async, that will be whole lot faster than any other option. I regularly push 100+MB/s over 1GigE that way. Another option, once the image file is created, is to get to a shell on the NAS and cp the file using the --sparse=always command. That will make a sparse version of the file that removes zeros (unused space). Some of that unusued space in the file systems are deleted files so yet another optimization is to find (OS specific) scripts that will find and zero unusued portions of the media, and then do the dd, and then duplicate the resulting file with --sparse=always. dd has a sparse command but I don't know that is can work with an JHFS+ source or destination since JHFS+ doesn't support sparse files.


I don't use sync or noerror. If there's a bad sector on reading the source, best to know about it although I highly recommend building smartmontools for OS X, or downloading a linux livecd that that has it such as Fedora 18 or 19 and running the long SMART test, then after it completes use a -a or -x to see if any problems were found.

Resized partition and now Windows wont boot

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