Thursday, February 13, 2020

Installing Windows 10 on a Modern Laptop or PC with a USB Flash Drive

It turns out that it is easy to install Windows 10 on a modern laptop or PC with EFI support. In this case, we will be using a USB flash drive so that installation is fast. Note that everything I put on this blog post is 100% legal.

  1. Download Windows 10 ISO 64-bit version from Microsoft:
  2. Unpack the ISO file, then separate it into two folders: one for the FAT32 boot partition and another one for the NTFS data partition. More on this later.
  3. (Optional) Add an autounattend.xml file to the boot partition.
  4. Insert a USB flash drive, delete all partitions on it, re-initialize the partition table with GPT, then make two partitions: the first one has to be a FAT32 partition at least 600MB in size, and the second one as an NTFS partition with at least 4.8GB in size. We can do this even in Linux, there is no need to install any boot loader.
  5. Copy the files we prepared earlier accordingly, the contents of each folder copied into the corresponding partitions.
  6. Reboot, enter the BIOS/EFI, enable EFI boot, and choose the USB flash drive as the boot media. Then save your settings and reboot again.
Now, about the two folders for the two separate partitions:
  1. First, extract the ISO file.
  2. Make two directories, let's name them 1-fat32 and 2-ntfs.
  3. Move the sources/ folder into 2-ntfs.
  4. Move everything else into 1-fat32.
  5. Make a new folder sources/ inside 1-fat32, and move sources/boot.wim from 2-ntfs into this newly created folder.
  1. EFI can boot from a USB flash drive without a dedicated boot loader.
  2. EFI cannot boot from an NTFS partition. However, the file sources/install.wim is too large for a FAT32 partition.
  3. Therefore, the solution is to create a FAT32 partition and put all the boot files in it. Then create an NTFS partition and put all the installation files in it.
  4. Boot files include, at least these files: bootmgr, bootmgr.efi, everything inside boot/ and efi/, setup.exe for installation, everything inside support/, and also sources/boot.wim (that's why we need to move it).
  5. Installation files include everything inside sources/ except for the file named boot.wim.

No comments: