Fix: The drive where Windows is installed is locked

If when you start your Windows 10, Windows 8 or Windows 8.1 computer, you receive a Your PC needs to be repaired error message, then Then this post may be able to help you resolve the issue.

A required device isn’t connected or can’t be accessed

The first thing you want to try is to boot into Advanced Boot options and try to Refresh your PC. But if you do this, you are in all likelihood expected to receive the following message:

The drive where Windows is installed is locked. Unlock the drive and try again.

The drive where Windows is installed is locked

If you try to Reset your PC you will see the following message:

Unable to reset your PC. A required drive partition is missing.

A required drive partition is missing

The cause for this error is normally a corrupt MBR or BCD file. To resolve this issue, there are a few things you may want to try.

1] Boot into Advanced Boot Options. From the WinRE screen, select Troubleshoot > Advanced options > Command Prompt. Run Check Disk using CMD. You may use the chkdsk /r command.

2] If a system file required for booting up has become corrupted, running System File Checker may help you.

3] You may be required to change the active partition using diskpart. An Active partition is the one that your BIOS detects is the one that will start your computer.

It is important to note that changing Active Partition wrongly may make your computer unbootable. So do not by mistake, mark a partition as Active, if it does not contain the NTDLR loader for your operating system.

To do this, enter the following commands:

diskpart
list disk

Now select the disk – it will typically be Disk 0 – and set it as the Active disk. Assuming it is Disk 0, the commands become:

select disk 0

Now list the partitions using:

list partition

Assuming your partition number is 0, the command becomes

select partition 0

To make it the Active partition, type the following and hit Enter:

active

Exit diskpart.

4] Repair Master Boot Record. It is one of the effective troubleshooting steps, to fix boot issues, and will hopefully help you fix the problem.

Update: Please see boozi‘s comment too, below.

Some other links that may help you someday:

  1. How to Convert MBR to GPT Disk
  2. Windows 8 fails to boot; Automatic Repair, Refresh, Reset PC also fail
  3. Operating System Not Found
  4. Bootmgr is Missing.
Download this VPN to secure all your Windows devices and browse anonymously
Posted by on , in Category General with Tags
Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP Awardee in Windows (2006-16) & a Windows Insider MVP. Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.

40 Comments

  1. can u pls hlp me

    how do i select my partition to boot
    i have 7 partitions
    1 system(300MB)
    2 recovery(900MB)
    3 reserved(128MB)
    4 primary (279GB)
    5 recovery(450MB)
    6 Primary (397GB)
    7 recovery(20GB)

  2. Can u pls hlp me

    i simply try to select partition 1(which is labeled as system) but it written there the selected disk is not a fixed MBR disk. The active command can only be used on fixed MBR disks. Can anyone hlp me to solve this ?

  3. skull

    I have the same issue, need help

  4. STROLETTI

    FROM : http://www.sevenforums.com/tutorials/26203-convert-gpt-disk-mbr-disk.html

    This method has you manually delete each volume on the disk before converting the disk to MBR.

    A) Type detail disk and press enter. If the disk does not have any volumes listed, then you can go to step 8E below.
    NOTE: This will give you a list of all the volume numbers on the selected disk number that you will need to delete in steps 8B and 8C below.

    B) Type select volume # and press enter.
    NOTE: Substitute # with a volume number listed in step 8A. For example, select volume 3.

    C) Type delete volume and press enter.

    D) Repeat steps 8B and 8C for each volume # listed in step 8A until you have deleted all volume #’s.

    E) When finished, type select disk # and press enter.
    NOTE: You would use the same one from step 5 above. For example, select disk 1.

    F) Go to step 9 below.

    9. Type convert mbr and press enter.

    10. Close the command prompt.

  5. HEEEEEEEEEELP

    It doesn’t allow me to run the active command. It just says that this partition cannot be activated. Something along those lines

  6. arjun

    I tried to install ubundu along with my current window 8.1.while partitioning ubundu instalation stops andwhile restart my pc,windows is loading and tries for auto repair and fails ,what can i do ?

  7. Kenneth Nash

    you could just turn off hibernation. it causes drive to be locked.

  8. boozi

    uninformed post and comments,

    most new pc’s running win 8 are using efi(or UEFI) boot with gpt “partitioned” drives. (as opposed to the old bios+MBR) this method does not have or use an “active partition” function as a part of the boot process.

    BIOS v EFI (still often referred to as “uefi bios”)
    MBR v GPT

    the first comment is a case of a GPT drive: (MBR drives can only contain 4 partitions)

    partition 1 “system”(300MB) is an efi partition which is the first on the boot process and it contains the bootmgr and BCD files(windows boot program)
    all other partitions except 4 and 6 are repair and recovery tools both built in to windows and added by the vendor.

    from a “superuser” post:
    I’ve spent a lot of time trying to get my Windows 8 PC to boot again after cloning to a new SSD and try to summarise how I finally got it all working –

    Firstly, boot from a UEFI Windows 8 recovery disk (CD/DVD/USB) – I found that the automated recovery process didn’t find the correct Windows partition, nor when I managed to add it to BCD settings would it make it reliably bootable e.g. using BCDEDIT I got it to find and launch the Windows partition but it refused to cold boot or would not “keep” the settings after a 2nd reboot or power off.

    Go into the Advanced options and run the Command Prompt.

    Enter diskpart to use the DiskPart tool to ensure you have all the right partitions and to identify your EFI partition – the key thing here is that your EFI partition is formatted as FAT32:

    DISKPART> sel disk 0

    Disk 0 is now the selected disk.

    DISKPART> list vol

    Volume ### Ltr Label Fs Type Size Status Info
    ———- — ———– —– ———- ——- ——— ——–
    Volume 0 E DVD-ROM 0 B No Media
    Volume 1 C NTFS Partition 195 GB Healthy Boot
    Volume 2 WINRE NTFS Partition 400 MB Healthy Hidden
    Volume 3 FAT32 Partition 260 MB Healthy System

    Then assign a drive letter to the EFI partition:

    DISKPART> sel vol 3

    Volume 3 is the selected volume.

    DISKPART> assign letter=b:

    DiskPart successfully assigned the drive letter or mount point.

    Exit DiskPart tool by entering exit and at the command prompt run the following:

    cd /d b:EFIMicrosoftBoot

    bootrec /fixboot

    Delete or rename the BCD file:

    ren BCD BCD.bak

    Use bcdboot.exe to recreate BCD store:

    bcdboot c:Windows /l en-gb /s b: /f ALL

    The /f ALL parameter updates the BIOS settings including UEFI firmware/NVRAM, /l en-gb is to localise for UK/GB locale. The localisation defaults to US English, or use en-US.

    Reboot and cross your fingers.

    This gave me headaches. I was going in circles for a long while. There isn’t a lot of reliable info about fixing UEFI/Windows 8 at the time of writing.

    [EDIT]

    To re-enable Hyper-V, I also had to run the following from an Administrator Command Prompt within Windows after rebooting:

    bcdedit /set {default} hypervisorlaunchtype Auto
    bcdedit /set {default} nx OptIn

  9. Koem Daroth

    when we need MBR and GPT

  10. Abdul Jalil Afridi

    i was type in commond the above …but if we type select partition 0 says that partition 0 is un avalible

  11. Akhil

    by using active command
    it says that active command is only used on fixed MBR disks
    i am using windows 8.1

  12. Nathan

    Thanks you so much! Been working on my father’s computer for hours now, got it fixed with this. Thanks!

  13. Camen Menes Doro

    i denied access to my local disk but now i cant access it what should i do

  14. Camen Menes Doro

    please

  15. Marie

    So I typed in ‘ list partition’ and this came up and I only have six partitions and don’t know which one to pick …..I need some help please
    Partiton 1 Recorvery 400MB 1024KB
    Partition 2 System 260MB 401MB
    Partiton 3 Reserved 128MB 661MB
    Partition 4 Primary 274GB 789MB
    Partition 5 Recorvery 450MB 275GB
    Partiton 6 Primary 21GB 276GB

  16. pmshah

    I think both win 8 and 10 suck big time. I got evaluation copies of both. Neither would install on their own isolated partitions cleanly. The worst part of the whole experience is that both these OSes would randomly lock out some of the logical drives for unknown reason. I googled to find out how to fix it and cme up with zilch. This happened on both the internal AND external USB connected drives. Absolutely no problems with my existing Win 7 Ultimate.

    As a last resort I totally disconnected the internal drive and installed a brand new 2 TB drive to attempt clean install. Installation would simply fail. Funny thing is that my hardware has been checked and verified the free upgrade to Win 10 offer from Microsoft ! Go Figure !

  17. conan_alif

    This actually works for me. I have a same problem, and it works like a charm. Although I miss some steps that require me to reset my BIOS setting to UEFI instead of Legacy. I usually picked Legacy if I need to run some troubleshooting.

    Anyway, if anyone have the issue, this one works. Kudos to boozi for this info.

  18. xSHUTTER SPEEDxLD

    When I typed the last command it gave me what looked like a list of commands like you’d get if you typed /help

  19. tulsa dome

    omg thank you so much!!! I thought I had totally screwed myself. youre amazing.

  20. John

    Partition 2 (system)

  21. davel

    I had the same problem but found but putting the /l en-gb at the end it worked. A roboot and finally the windows 10 upgrade appears to be completing.

  22. Watcherseye

    Running through all that worked until the bcdboot part. Get an error: Failure when attempting to copy boot files.

  23. aviramof

    does not contain the NTDLR loader? i belive you meant the bootmgr loader buddy we don’t use ntldr anymore since Xp wsa released in 2002.:)

  24. SantiMiguel

    It worked like charm!
    Thank you very, very much!

  25. Steve Joseph

    Me too

  26. Rena

    How do you turn off hibernation?

  27. Sahara

    I’ve ran into this issue after cloning my hd to a larger one. Both are MBR, one is 3TB the second is 4 but I have not used any program to extend the capacities, anyway after True Image finished the cloning process it shut down the pc and for the last 3 days I have been trying every fix under the sun for inaccessible_boot_device. Absolutely nothing has worked, my Bios is set to legacy only, drivers and software always update to date, neither drive is dead just not able to boot from them. I did a clean install of windows on an SSD and can access both drives, I can see them in my boot options just cannot boot to them. Inaccessible_Boot_Device or System32winload.exe is corrupt or missing.. I get these messages no matter what I try… and I have tried everything!

    I just looked in diskpart yet again thinking about attempting your fix, but the drives have 5 partitions? 3 of which are System reserved, 100MB has a drive letter but the two 450MB partitions are hidden, could this have any effect on my problem?

    Oh, I know that winload is not missing or corrupt, I replaced it from the clean install. I have ran sfc and tried dism but neither is fixing the corrupt files. Really do not want to have to attempt a clean install it is my graphic design system I would hate to lose the software I purchased but no longer have the old emails.. Can’t afford PhotoShop again.

  28. Brady

    You are brilliant. Saved me. Thank you!

  29. Ozarkian

    I need help. My system sees my Cdrive but can’t see os or mbr. Chkdsk says drive is write protected. Dskpart shows partitions but says it is locked.

  30. Daniel Singi Coelho

    Hello. Would you be abble to fix it? I got the same error: Failure when attempting to copy boot files.

  31. Daniel Singi Coelho

    Hello. Would you be abble to fix it? I got the same error: Failure when attempting to copy boot files. I need help

  32. Watcherseye

    I think I had to reinstall Windows completely. It’s been a long time, sorry I don’t remember.

  33. VISHAL KAMBLE

    Will I able to reset my pc after following this steps

  34. Orlando Solorzano

    how do i do this if i cant boot my system? if i click advanced options or refresh my laptop crashes.

  35. shist

    thanks alot, this is the only solution that really worked.. for me 😀
    thank you, u just saved me alot of work .. much appreciated

  36. A Person

    I am getting the same messages can anyone help???

  37. Jane Miller

    I know this is an old thread, but THANK YOU SO MUCH!!!

  38. A thankful user

    Jesus Christ, the people of the broken Windows PC world would all be lost without command line geniuses like you. Thanks mate.

Leave a Reply

Your email address will not be published. Required fields are marked *


1 + 3 =