Change Windows 10 boot drive
Emily Wong
I had a working dual-boot system and decided to introduce an M.2 drive. I migrated my gentoo install to the drive and grew my windows partiton to eat up all the former linux. Gentoo boots normally, but to boot windows I have to remove the M.2 drive. With the M.2 drive in the BIOS finds the windows boot loader, but it does not load up the OS.
What do I need to do to tell Windows to use the second drive in the system?
0 blaze:0.0 /root # lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT
NAME FSTYPE LABEL MOUNTPOINT
sda
|-sda1 swap [SWAP]
`-sda2 ext4 /
sdb
|-sdb1 ntfs Recovery
|-sdb2 vfat /boot/efi
|-sdb3
`-sdb4 ntfs
sdc
`-sdc1 linux_raid_member blaze:0 `-md0 ext4 /home
sdd linux_raid_member
`-sdd1 linux_raid_member blaze:0 `-md0 ext4 /home
sde
`-sde1 linux_raid_member blaze:0 `-md0 ext4 /homesda is the M.2 and sdb is a solid state drive.
2 Answers
This is the reason I preffer using grub to handle multiboot systems. Anyway, here's how to fix a Windows 10 boot partition:
ORIGINAL SOURCE: Use Diskpart to Fix UEFI Boot Error in Windows 10/8/7 This is not my solution. This is copied from a commercial website which sells partition tools. I have nothing do to with them. I strongly advise you to backup your hard drive: It's been a long since last time I did this in Windows, and though the commands looks good, they may have messed something up.
Method 1. Use Diskpart to Fix UEFI Boot Error in Windows 10/8/7
Probably you only have to do "Step 1: Type below command and hit Enter each time:" "3 - Repair the Boot Record" and "4 - Rebuild the BDC Store" If you are a Windows 10 or 8 user and you prefer free methods to fix UEFI boot error, you may follow below two solutions to solve this issue now: 1 - Enter Command Prompt from Advanced options
Step 1: Insert Windows 10/8/7 installation disk or installation USB into PC > Boot from the disk or USB.
Step 2: Click Repair your computer or hit F8 at the Install now screen.
Step 3: Click Troubleshoot > Advanced options > Command Prompt. 2 - Run Diskpart to set partition ID and assign drive letter
Step 1: Type below command and hit Enter each time:
diskpart
list disk
sel disk 0Be carefull! it may not be disk 1
Step 2: When the message "Disk 0 is now the selected disk" shows up, type: list vol and hit Enter.
Diskpart will now show the full list of volumes on your PC, find UEFI volume from the list: UEFI partition will be on Volume 2.
Step 3: Do this only if your disk doesnt have ID: Type below command and hit Enter each time:
sel vol 2
set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
Or SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7Step 4: Do this only if your boot disk doesnt have a letter: Assign drive letter by typing below command and click Enter:
assign letter=G: (Note: G shall be a unique drive letter which cannot be already used.)
3 - Repair the Boot Record
Step 1: Open Command Prompt as administrator, enter below command:
cd /d G:\EFI\Microsoft\Boot\Note: G is the drive letter you signed to UEFI partition and remember to replace G with UEFI's partition letter.
Enter: exit when the process completes.Step 2: To repair the Boot Record, open CMD and enter below command line:
bootrec /fixbootEnter: exit when the repair process completes.4 - Rebuild the BDC Store
Step 1: Type each command line and hit Enter each time:
ren BCD BCD.old
bcdboot C:\Windows /l en-us /s G: /f ALL (Note: c:\ is the drive where Windows 10/8.1/8 is installed on.)Step 2: Type: exit in Command Prompt when the process completes and then restart your PC.
Now UEFI boot is fixed and Windows 10/8/7 can be boot up on your PC again.
Method 2. Use Automatic Repair to repair Windows 10/8/7 UEFI
Windows Automatic Repair is a built-in tool for users to apply and try to fix some normal errors on Windows PC. And you may also try this method to repair Windows 10, 8 or 7 UEFI/EFI boot error:
1- Boot up Windows from Installation media
Step 1: Insert Windows 10/8/7 installation disk or USB to your PC.
Step 2: Restart PC and boot from the disk or USB.
2 - Enable Automatic Repair option
Step 1: Click Repair your computer at the Install now screen.
Step 2: Click Troubleshoot at Choose an option screen > Click Automatic Repair.
Step 3: Choose an account from the list to continue at the Automatic Repair screen and wait for the process to finish.
When the process completes, you can restart your PC and then you should be able to use your computer without any problems again.
1What you think is the BIOS is really the UEFI boot. As you have changed the
disk numbers, Windows is now on sdb which used to be sda.
I don't know how you have migrated your disk, but there is a possibility that
the Windows installation that is displayed during the boot is a phantom
installation that no longer exists on the new sda.
This procedure will help to detect the right Windows installation:
Boot Ubuntu and mount your Windows partition(as by opening the disk on Nautilus)
Run the following command:
sudo os-proberIf your Windows installation was found, you can run:
sudo update-grub
Note that step 2 is only for knowing beforehand if the probe will succeed.
You could also skip this step and just mount the Windows partition and
directly run sudo update-grub.