Pages
  • Homepage
  • Queztaz/Tech Inventory
  • Emacs/Emacs With BiDirectional Google Calendar Sync
  • Emacs/Setting up Mu4e and Multiple Gmail Accounts
  • Emacs/EWW Hacks
  • Linux/Creating an Offline Debian Mirror Repository
  • Linux/Migrate Wiki.js to Another Server
  • Linux/Adding Bitwarden to the Pinephone Pro
  • Pinebook Pro/Custom Kernel
  • Pinebook Pro/Keyboard Firmware Update
  • Pinebook Pro/Netbsd Installation
  • Pinebook Pro/Setting Up Zram
  • Pinebook Troubleshooting/Pro Common Issues
  • Pinebook Pro/Use NVME as Root
  • Pinebook Pro/Write to SPI Flash
  • Qemu/Chroot Into a Different Architecture
  • Qemu/Choot Into an Img File
  • Qemu/Mount Virtual Images
  • Qemu/Windows Xp Fix Smb Not Working
  • Qemu/Windows Xp Installation
  • Misc/Finding the Default Wireless Password to TG1672G Routers
  • Misc/Running Ollama Portably
  • Windows/Cloning a Bios Boot Drive to Disimilar Hardware with UEFI
  • Windows/Automatic CHKDSK Scans Using Powershell & Email Alerts
  • Windows/Creating a Decent Portable Terminal
  • Windows/Merging HyperV Snapshots With Powershell
  • Windows/Simulating Bad Blocks on NTFS Filesystems
  • Windows/Creating and Viewing a Storport on Windows Server
  • Mikrotik/Creating a Client to Site VPN With
  • Mikrotik/Securing Router With Firewall
  • Mikrotik Setup Dynamically Changing IP With No-IP Api
Homepage
  • Homepage
  • Queztaz/Tech Inventory
  • Emacs/Emacs With BiDirectional Google Calendar Sync
  • Emacs/Setting up Mu4e and Multiple Gmail Accounts
  • Emacs/EWW Hacks
  • Linux/Creating an Offline Debian Mirror Repository
  • Linux/Migrate Wiki.js to Another Server
  • Linux/Adding Bitwarden to the Pinephone Pro
  • Pinebook Pro/Custom Kernel
  • Pinebook Pro/Keyboard Firmware Update
  • Pinebook Pro/Netbsd Installation
  • Pinebook Pro/Setting Up Zram
  • Pinebook Troubleshooting/Pro Common Issues
  • Pinebook Pro/Use NVME as Root
  • Pinebook Pro/Write to SPI Flash
  • Qemu/Chroot Into a Different Architecture
  • Qemu/Choot Into an Img File
  • Qemu/Mount Virtual Images
  • Qemu/Windows Xp Fix Smb Not Working
  • Qemu/Windows Xp Installation
  • Misc/Finding the Default Wireless Password to TG1672G Routers
  • Misc/Running Ollama Portably
  • Windows/Cloning a Bios Boot Drive to Disimilar Hardware with UEFI
  • Windows/Automatic CHKDSK Scans Using Powershell & Email Alerts
  • Windows/Creating a Decent Portable Terminal
  • Windows/Merging HyperV Snapshots With Powershell
  • Windows/Simulating Bad Blocks on NTFS Filesystems
  • Windows/Creating and Viewing a Storport on Windows Server
  • Mikrotik/Creating a Client to Site VPN With
  • Mikrotik/Securing Router With Firewall
  • Mikrotik Setup Dynamically Changing IP With No-IP Api

Windows/Cloning a Bios Boot Drive to Disimilar Hardware with UEFI

Table of content
  • Overview
  • Starting the disk clone
  • Downloading the Drivers
  • Converting the drive to GPT
  • Creating the EFI Partition
  • Loading the drivers

Documented steps for cloning a drive to another computer. The source computer is running an MBR partition table. The target computer is of completely different hardware and runs UEFI

Overview

I had a clone an old Dell Machine to a new Dell Optiplex SFF 7010. The problem was the new computer had an NVME drive with storage controller drivers that weren't even in the Windows 11 installation media. On top of that, the original computer was Windows 10 but was BIOS only, meaning it wouldn't boot at all on the UEFI only machine.

These are the steps it took to clone the drive to a new machine.

  1. Clone the drive to the internal NVME using Clonezilla (UEFI version)

  2. Repartition the drive to create a 512MB-1GB EFI partition at the first sector

  3. Boot into the Windows 11 installer and loading the drivers to detect the cloned drive

  4. Use the Command Prompt to rebuild the EFI files onto the EFI partition

  5. Still in the recovery prompt, load the drivers into the windows installation using the command prompt and an external flash drive

Starting the disk clone

Use Clonezilla to do a Disk to Disk clone with the source drive plugged into a hard drive bay. If you have a 2.5" drive you can get away with a straight USB to SATA adapter.

  • Download Page

  • Direct Link (source forge)

Downloading the Drivers

Download the drivers from the manufaturer support website. Dell distributes them as exe files, so you'll have to run the exe files and then select the option to extract the files to a directory. For other manufaturers, you may have to use 7ZIP to extract the EXE files and copy the driver files to a USB drive for later.

Whenever you boot into the windows recovery environment to run commands, you have to load the driver for your storage controller. Click on "Custom Installation" and "Load Driver" to load the storage driver from your flash drive.

Converting the drive to GPT

After the drive is cloned you can either use the MBR2GPT.exe command line utility to convert the partition table type or use a third party tool like Aoemi (proprietary freeware).

I tried troubleshooting the MBR2GPT a while, but would always get this error message when attempting the conversion: mbr2gpt cannot find room for efi. I gave up and used the freeware instead which took 0 time to convert it. I had to remove the NVME drive from the computer then plug it into my workstation using another NVME to USB adapter. After that, I opened Aoemi, right clicked the drive, then clicked "Convert to GPT".

Creating the EFI Partition

Either through Aoemi or GPARTED, create a 1GB FAT32 partition on the first sector of the drive. It should be your first partition.

Then boot into windows recovery and use bcdboot to rebuild the EFI files based on the cloned windows installation

diskpart
list disk
select disk 2 (selecting the cloned drive)
list part
select part 1 (this is the 1GB efi partition)
format fs=fat32 quick
assign letter=z: (mounting the EFI partition)
list vol (double checking the volume of the OS drive...it was E)
exit

bcdboot E:\Windows /s Z: /f ALL  (restoring efi files)

Loading the drivers

While still booted into the recovery disk, I loaded the drivers from the USB flash drive to the windows image

dism /Image:E:\ /Add-Drivers:D:\ /Recurse

After that, you should be able to boot into Windows in UEFI mode!

PREVRANDOMNEXT