Can I fix error 0xc0000225 without reinstalling Windows?

16

4

I have a system which dual-boots Gentoo Linux and Windows 7 using GRUB2. The computer has four drives, and Windows is installed on the third (last) partition of drive #2. The drive layout looks like this:

|boot|-----------------home-----------------|-------------windows-------------|

(boot and home are Linux partitions) It's an odd setup but it always worked, until I decided to shrink the Windows partition using Gparted. The new layout is:

|boot|-----------------------home-----------------------|-------windows-------|

After making these partition changes, when I select the Windows option in GRUB2 and it hands off control to the Windows bootloader, I get the error message:

Windows Boot Manager  

Windows failed to start. A recent hardware or software change might be the cause. To fix the problem:   1. Insert your Windows installation disc and restart your computer.   2. Choose your language settings, and then click "Next."   3. Click "repair your computer." If you don't have this disc, contact your system administrator or computer manufacturer for assistance.   Status: 0xc0000225   Info: The boot selection failed because a required device is inaccessible.

I'm not particularly surprised that this happens, but I'm wondering if I can fix this without reinstalling Windows.

I've tried booting the computer using the Windows installation DVD (specifically, a Windows 7 upgrade DVD). After I choose the language and keyboard and click "Repair this computer", the System Recovery Options screen doesn't detect my Windows partition. I can click "Next" anyway and then use Startup Repair, which fails to fix the problem, or try command-line tools, namely bootrec (suggested by several websites), sfc, and chkdsk. None of them made a difference; I still get the same error message. (See below for detailed output.)

Also as suggested in similar questions, I tried using the "Rebuild BS" (rebuild boot sector) functionality in TestDisk, running under Linux, acting on the Windows partition. That also did not change the error I get.

I haven't seen any signs of data corruption on either partition, and the drives haven't suffered any physical damage, so it seems fairly certain that the change in partition layout is the cause of this error. I suppose Windows must have the starting sector and/or partition size stored somewhere within its filesystem (the registry?), suggesting that it should in principle be possible to fix this by twiddling a couple bytes in a file somewhere. But which file? Or is there something more complicated?

If it helps, here is the GRUB2 configuration section corresponding to Windows:

menuentry 'Windows 7 (loader) (on /dev/sdb3)' --class windows --class os $menuentry_id_option 'osprober-chain-1F9948EB30A986A0' {
        insmod part_msdos 
        insmod ntfs
        set root='hd1,msdos3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3  1F9948EB30A986A0
        else
          search --no-floppy --fs-uuid --set=root 1F9948EB30A986A0
        fi
        chainloader +1
}

Again, what I'm looking for is, ideally, a way to fix this without reinstalling Windows. If that's not possible, then reinstallation is an acceptable plan B, but I can handle that myself.


Here's a transcript of my command prompt sessions while booted into the repair environment using the Windows 7 installation DVD. I've removed some blank lines for readability. The following is with all other drives disconnected:

>bootrec /fixmbr
The operation completed successfully,

>bootrec /fixboot
The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.

>bootrec /scanos
Scanning all disks for Windows installations.
Please wait, since this may take a while...
Successfully scanned Windows installations.
Total identified Windows installations: 1
[1]  C:\Windows
The operation completed successfully.

>bootrec /rebuildbcd
Scanning all disks for Windows installations.
Please wait, since this may take a while...
Successfully scanned Windows installations.
Total identified Windows installations: 1
[1]  C:\Windows
Add installation to boot list? Yes(Y)/No(N)/All(A):y
The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.

>sfc /verifyonly /offwindir=C:\Windows /offbootdir=C:\
Beginning system scan.  This process will take some time.
Windows Resource Protection did not find any integrity violations.

>chkdsk C: /F
The type of the file system is NTFS.
Volume label is windows.
CHKDSK is verifying files (stage 1 of 3)...
  313344 file records processed.
File verification completed.
  1684 large file records processed.
  0 bad file records processed.
  2 EA records processed.
  158 reparse records processed.
CHKDSK is verifying indexes (stage 2 of 3)...
  416370 index entries processed.
Index verification completed.
  0 unindexed files scanned.
  0 unindexed files recovered.
CHKDSK is verifying security descriptors (stage 3 of 3)...
  313344 file SDs/SIDs processed.
Security descriptor verification completed.
  51514 data files processed.
CHKDSK is verifying Usn journal...
  35406088 USN bytes processed.
Usn Journal verification completed.
Windows has checked the file system and found no problems.
 207510871 KB total disk space.
 104134880 KB in 251224 files.
    137304 KB in 51514 indexes.
         0 KB in bad sectors.
    423075 KB in use by the system.
     65536 KB occupied by the log file.
 102815612 KB available on disk.
      4096 bytes in each allocation unit.
  51877717 total allocation units on disk.
  25703903 allocation units available on disk.
Failed to transfer logged messages to the event log with status 50.

>diskpart
Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: MININT-P92LVUL
DISKPART>list disk
  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          596 GB      0 B
DISKPART>select disk 0
Disk 0 is now the selected disk.
DISKPART>list part
  Partition ###  Type              Size     Offset 
  -------------  ----------------  -------  -------
  Partition 1    Primary             62 MB    31 KB
  Partition 2    Primary            398 GB    62 MB
  Partition 3    Primary            197 GB   398 GB

When I run the same commands with all drives connected, the output is the same, except that diskpart correctly shows all the drives, and the drive letter for the Windows partition in question is D instead of C (because I have an NTFS data partition on drive #1).

I would note that bootrec /fixmbr overwrites the MBR of drive #2, replacing the MBR put there by GRUB2. When I then try to boot from that disk, I simply get the message "Missing operating system" instead of the 0xc0000225 error. I can then boot into Linux and use grub-install to put back the GRUB2 MBR, and then choosing the Windows option in GRUB2 gives 0xc0000225 again.

David Z

Posted 2014-09-22T23:24:04.250

Reputation: 5 688

Windows cloning often require partition manipulations breaking boot process of Windows - windows won't boot if partition is located in a different position on disk than it was during installation. Would be nice to use your findings :) – Basilevs – 2014-09-25T03:08:46.540

1https://neosmart.net/wiki/0xc0000225/ – Ali786 – 2014-09-25T04:33:59.553

@ali786 well, I'd rather reinstall Windows than spend $20 on a tool to fix the issue. But otherwise that would be an option. (I already looked at that website while preparing this question, though.) – David Z – 2014-09-25T05:15:47.290

How about using your installation disk and clicking Upgrade Now instead of performing a clean install? It's kind of a reinstall but you keep your files. – Rsya Studios – 2014-09-25T05:40:15.123

1@RsyaStudios The graphical installer doesn't detect my existing Windows installation, so I don't think I can do that. – David Z – 2014-09-25T05:49:23.740

Argh... Did you shrink the volume from the left (start of the partition)? Even Microsoft don't advise doing this because Windows will install at the start and as the disk grows it spans toward the end... It's kind of like you piling your plate with more food and someone then cuts the bottom out of your plate... It makes a mess. From experience there isn't much to fix this that won't end up wasting many hours of your time when a reinstall and restore from backup would be quicker... – Kinnectus – 2014-09-30T06:18:11.567

Answers

11

Depending on the method used, certain things can change in the progress:

The partition details: Use active in diskpart to make the partition activate again.

The boot sector: The bootsect tool can be used to restore the boot sector. (eg. bootsect /nt60 C:)

The partition UUID: By changing the partition position and/or size, the UUID changes; thus the inaccessible UUID stored in the BCD mismatches your partition's UUID. To fix this, remove and rebuild the BCD like this:

bcdedit /export C:\boot\bcd.backup
ren C:\boot\bcd C:\boot\bcd.old
bootrec /rebuildbcd

Tamara Wijsman

Posted 2014-09-22T23:24:04.250

Reputation: 54 163

This turned out to be the right problem (and solution), but your tip about setting the partition to active was the real key. I needed to make the partition active so that bootrec would know where to write the rebuilt BCD. Perhaps you could add that to the answer? (I didn't have to use bootsect, as it turned out.) – David Z – 2014-10-02T04:27:14.230

Updated the answer by embedding my comment; yes, the details of the partition were the missing piece here. – Tamara Wijsman – 2014-10-02T19:39:16.800

"ren C:\boot\bcd C:\boot\bcd.old" gave me an error. Should be "ren C:\boot\bcd bcd.old" – user4035 – 2019-01-23T18:33:05.813

3

You might have caused the problem by reducing the Windows partition too much.

Windows has some unmovable files that a third-party product might decide to move. You should in the future use the Windows Disk Manager to resize its partitions, as it will not break the disk. It is also a good idea to first turn off and empty the Recycle Bin, disable the Paging file as well as hibernation, in order to minimize the number of special Windows files, and also run a defragmenter that compacts all files toward the beginning of the disk.

That said, you could do Repair Install to Fix Windows 7. This mild form of installation will fix your currently installed Windows 7 and preserve your user accounts, data, programs, and system drivers. The linked article describes the process in detail with screenshots. You might have to deal afterward with some destruction to the GRUB2 boot sector.

If Repair Install does not work, then Gparted had destroyed your Windows partition. I hope you have backup in this case, as otherwise you might have to resort to Data Recovery Utilities.

harrymc

Posted 2014-09-22T23:24:04.250

Reputation: 306 093

Ah, well that was intentional. I tried using Windows to resize the partition first, after emptying the Recycle Bin and defragmenting (forgot about disabling special files though), but it wasn't able to reduce the partition size as much as I needed it to. I'll try the repair installation and see if it works. If not, then I can mount the Windows partition from Linux and copy any useful files to another partition, so I won't have to resort to data recovery. – David Z – 2014-09-25T19:32:44.370

Looking at it now, I see that a repair install can only be done from within Windows, so that doesn't help me. – David Z – 2014-09-25T20:05:51.133

You can do that using a Windows 7 SP1 DVD/USB. Details in the above article. – harrymc – 2014-09-25T20:38:34.550

1No, I can't. The article explicitly says (multiple times) that you need to be already running Windows to perform a repair install; besides, I tried it, and it won't let me use the Upgrade option when booting from a DVD. – David Z – 2014-09-25T21:27:50.563

Does Linux manage to mount the disk, and can you see the file-system and especially drill into the Windows folder and even copy files out of it? Can you boot the Windows DVD into DOS and see the disk? Try also to disconnect any possible device from the computer. – harrymc – 2014-09-26T06:16:43.457

More: I still don't understand what goes wrong when you boot from the Windows 7 installation disc, follow the instructions to set the language, time and keyboard, click "Next", then select "Repair your computer" followed by "Startup Repair". – harrymc – 2014-09-26T08:00:46.737

I can access any file on the Windows partition by mounting it under Linux - viewing, copying, deleting, editing - with no problems. (I haven't tried them all of course, but a representative sample yielded no errors.) I don't see a way to boot the DVD into DOS; can you point me to instructions? When I try Startup Repair I get the message "Startup Repair cannot repair this computer automatically".

– David Z – 2014-09-28T03:32:42.697

I understand that repair lets you select the Windows partition, which is good. When you are notified it cannot repair, click "Don't send", go into the recovery/repair options, click "Command prompt" and enter the commands: bootrec /fixmbr and bootrec /fixboot, then follow with the instructions at the end of this article. It might also be a good idea to try chkdsk C: /r; run again adding /f if errors are found. Another to try is sfc /scannow. Add to the post the results for all these commands.

– harrymc – 2014-09-28T07:00:52.033

Actually repair doesn't let me select the Windows partition. Sorry not to make that clear. The screen where I would select a partition looks like this - no partitions listed - and I get to Startup Repair by just clicking "Next" anyway. I'll edit the question with this and also the output of bootrec.

– David Z – 2014-09-28T17:45:03.620

Hey! Why does the Windows partition come up as D: ? What is C: ? – harrymc – 2014-09-29T18:35:11.010

There's an NTFS data partition on drive #1 (an SSD), which the recovery environment maps to C:. (Of course when I was able to boot into Windows, the Windows system partition was C: and the data partition was E:.) – David Z – 2014-09-29T18:37:01.520

Please post the output of the DiskPart sub-command List Disk. Please also take out of the computer or disconnect all disks except the one you boot from. The disk must be recognized as C.

– harrymc – 2014-09-29T18:38:48.220

I've edited the question to include that output. As I noted there, the effects of all these commands appear to be the same (i.e. no effect) whether all drives are connected or not. – David Z – 2014-09-30T03:17:24.977

If you disconnect the drive #1, does the drive-letter change to C? Also, have you perhaps by chance inverted the connectors between disks #0 and #1 (when booting into the BIOS, are the disks in their correct slots)? – harrymc – 2014-09-30T05:07:10.813

I've been using 1-based numbering, so there is no drive #0; anyway, yes, the drive letter does change to C when I disconnect drive #1. Throughout the whole process I've never disconnected drive #2 (the one the question is about), and I haven't changed which connector is attached to each drive, so there's no way the connectors are inverted. – David Z – 2014-09-30T05:12:46.530

There's still something wrong with your connectors. It may not be the only cause of the problem you are facing, but the boot drive must be the first slot in the BIOS or it doesn't get the C moniker. You probably made some changes over the years to your setup, but because this was done gradually things kept on working. Now you are faced with the need to redo it right. It would be best to reset the connections correctly and repeat the tests to see what will change. – harrymc – 2014-09-30T06:47:22.187

Also: Note that a cheap way to reset Windows 7 boot is to partition empty space at the end of the disk and install Windows to it. This partition can be deleted later, but this sets up the boot correctly if nothing else will. – harrymc – 2014-09-30T06:48:55.157

Let us continue this discussion in chat.

– David Z – 2014-09-30T06:50:20.300

The other answer identified the solution I needed, but I appreciate your persistence. (I'd offer up a smaller bounty for that if I could, as a symbolic gesture.) – David Z – 2014-10-02T04:30:19.483

Thanks, but my reputation is enough. I assume your offer comes because the answer you accepted was already proposed in the link from my comment on Sep 28 7:00.

– harrymc – 2014-10-02T06:30:40.630

Yeah, exactly. I awarded the bounty to the other answer because Tom's tip about setting the partition to active was the key to fixing my problem, and I accepted it because I figured the answer I accept should be the one that contains the actual solution, for the benefit of future readers, even though you did suggest using bootrec first. – David Z – 2014-10-02T16:26:11.523

1

I had a similar problem (same error code 0xc0000225) on my computer while I tried to upgrade to Windows 10

The problem came from an empty EFI partition still remaining on one of my drives. On the boot, the computer finds 2 EFI partitions : one from my main OS, and another one corresponding to an old OS I uninstalled months ago (I moved from my first harddrive to SSD and formated everything)

Maybe it's also your problem. I have 2 solutions for you, hope it works :

  • On your control panel, manage your computer, find the useless EFI partition, and delete it
  • Run your computer with the Windows installation support (you can make one by downloading the wizard on microsoft website), run the installation program, advanced settings, and when it presents you all the volumes, find the EFI partition and delete it

I also reinstalled Windows but if you delete the bad EFI partition it will be enough

Since then, no more problem on boot, my computer could install W10, etc...

Sorry if I don't give you the exact names of things you have to click on, my OS is in French ^^

Ziiik

Posted 2014-09-22T23:24:04.250

Reputation: 11

-1

Adding an answer here because this is the page that showed for me and the answer that I needed:

0xc0000225 may also be caused by disabling ACPI APIC support in the BIOS (as labeled in this BIOS). I disabled it while fixing suspend issues in Ubuntu, but Windows in this case requires it to be enabled.

This also caused setup cd/usb, recovery to fail with the same error so nothing could be done with Windows until it was enabled.

0xc0000225 happened during Windows 10 Creators update, but not booting back into Windows until after having disabled setting in BIOS so it looked like it was caused from the update but actually wasn't! Tricky!

CmosBattery

Posted 2014-09-22T23:24:04.250

Reputation: 99