This article presents one of the two ways to burn the Windows 10 disc image on USB from Linux. For an overview of the procedure in general and to get more information regarding the two methods available, take a look at this article.
- This article’s procedure relies on the use of the command-line as much as possible. However, it isn’t convenient nor practical to use the Terminal alone to burn the Windows 10 disc image on your flash drive. That is why we will use both the command-line and GParted; however, that software will only be used for the first part of the process. The use of GParted will save you time and effort.
- If you’d prefer to use software applications rather than the Terminal, then I recommend using the other method. With the latter, you will be able to burn the Windows 10 disc image using UNetbootin and GParted, with minimal use of the command-line.
As a head’s up, this procedure is quite lengthy. However, it provides an excellent opportunity to familiarize yourself with the Linux Terminal and its command-line.
With its simple, step-by-step process and its visual guide, this method of burning the Windows 10 disc image on your pen drive will be (almost) painless – guaranteed.
Burning the Windows 10 disc image on USB using the Terminal and GParted
You will need:
- A pen drive with a capacity of at least 6GB
- Access to the Terminal, GParted, and Internet
- The NTFS-3G kernel module (download instructions below)
- An external flash drive of 2 TB maximum for your Windows 10 disc image***
*** Windows 10 requires the use of a specific bootloader: either MBR or GPT. For this method, we will stick to MBR for its ease of use. MBR (which stands for Master Boot Record) is a bootloader that we will use with a FAT32 partition. It is compatible out-of-the-box with UEFI, the current motherboard firmware that replaced BIOS on modern computers. As UEFI can read and boot the FAT32 MBR partition without any compatibility issues, we will thus use this particular bootloader. The imposed limit of under 2TB for your drive is because you cannot use MBR on disks of 2TB or more. That is coincidentally the main reason why GPT will eventually replace MBR completely, seeing as how disk storage capacity is increasing at a fulgurant pace.
Download the latest Windows 10 disc image from the official software download page (https://www.microsoft.com/en-us/software-download/windows10ISO).
If your current Linux OS doesn’t come with Gparted, you will have to install it from the Software Manager (or Software Center).
(Optional if you already know it) Identify the name of your pen drive. Open the Terminal and type the following:
This command will show a list of all the drives found on your machine, including the flash drives. You can then easily associate each name with its drive by looking at the size and partitioning of each one. As a general rule, a USB drive uses the “sdb” name, as the internal drive takes the “sda” identifier. Depending on the number of hard drives you have and their particular type, your USB keys might fall down the list to “sdc” or even lower.
(Optional if already unmounted) Unmount your USB drive. To unmount it, enter the following in the Terminal:
$ umount /dev/sd<?>
Where <?> is the letter linked to your USB drive (it is usually “b”)
Now that you have installed GParted, we will format our USB key and create two partitions. The first one using FAT32 for the bootloader and the second one using NTFS for the Windows install image. Make sure to have the correct drive selected and that you have unmounted your flash drive before proceeding.
To create the first partition table, click “Device,” then “Create partition table.” Select “msdos” as your new partition table type, then click “Apply.”
We will now create the bootloader partition. To do so, click on “Partition” from the top menu and select “New.” We will apply the following characteristics:
We will put the partition at the end of the pen drive. To do so, slide the partition entirely to the right on the sliding scale.
Allow a “New size (MiB)” of 80.
Put “Free space following (MiB)” to 0.
For the “Create as,” put “Primary Partition.”
For the “File system,” choose “fat32”.
For the “Level,” I put “bootloader”; the label is up to you.
To create the second partition, click on “Partition” from the top menu and select “New” (the second partition will automatically detect the fat32 partition we have created beforehand). We will apply the following characteristics:
We will leave the sliding scale as is.
The “Free space preceding (MiB)” should be with a value of 1. Leave it like that.
Make sure that “Free space following (MiB)” is 0.
For “Create as,” leave it as “Primary Partition.”
The “File system” has to be “ntfs.”
The “Label” is up to you. I chose “windows.”
You are now back to the main GParted menu. Make sure that you allocated “New Partition #1” to the fat32 bootloader of 80MB. Also take a look at “New Partition #2”, making sure that it is your NTFS Windows partition. Its size will vary according to your pen drive.
Click on the checkmark icon to “Apply all operations” (alternatively, “ctrl+return” or clicking on “Edit” → “Apply all operations” also works). A warning message will appear. Click on “Apply.” Once completed, click on “Close,” then quit GParted.
Before continuing, you will need to install the NTFS-3G module. The NTFS format used as your second pen drive partition is exclusive to Windows. Without installing the NTFS-3G module on your Linux system, you won’t be able to access the mounted files you will copy on your USB drive. Fetching the required package is easy.
Open the Terminal, then type:
apt install ntfs-3g
Once you have installed everything, update your system:
Mount the NTFS partition. To do so, enter the following commands in the Terminal:
sudo mkdir /media/myusb
Press Enter. You will be asked to enter your login password as we are doing this command from root, which requires admin privileges. The goal of this command is to create a mount point. In Linux, you cannot simply access a pen drive; first, you have to indicate the directory where the drive will be mounted. We are thus creating the “myusb” mount point. I chose “myusb,” but the name is up to you.
After that, type:
sudo mount /dev/sdb2 /media/myusb
Press Enter. Unless you did the “su” command beforehand, you will be asked once again to enter your login password as we are doing this command from root.
Now mount your Windows 10 ISO file directly in Linux. We need to do this as we will copy all its content to the USB key. To do this procedure, while still in the terminal enter the following commands:
sudo mkdir -p /mnt/windows
Press Enter. You will be asked once again to enter your login password as we are doing this command from root, which requires admin privileges. Alternatively, entering “su -” first will ask you for your password and you will be able to do all the remaining commands as a root user.
We are now creating a second mount point, this time for the Windows 10 ISO file. The “-p” refers to “—parents” and allows the creation of parent directories if they do not already exist.
sudo mount -o loop </path/to/windows.iso> /mnt/windows
Where </path/to/windows.iso> is the full path of your Windows disk image, as well as the name of your ISO file. If you are unsure of its exact location, right-click on the file and look for its properties; you will find its full path. And for those curious, “-o loop” is used to tell “mount” to use a loop device. By using “-o loop,” we can make our ISO file accessible. As a disk image contains an entire file system, using a pseudo-device through this command allows us to mount it as if it were a disk device.
Now copy all the files from the mounted Windows disk image to the NTFS partition you mounted.
To do so, enter the following command in the Terminal:
(The “cd” command redirects you to the mounted disk image.)
cp -r * /media/myusb
This process will take a while; be patient.
We will now access the “boot” folder, found within the “efi” folder on your NTFS partition (the partition #2), and take a look at the files contained within the folder.
To do so, type:
Where <USERNAME> is your username (the name you gave to your account). Press Enter.
You should see a single file mentioned, “bootx64.efi”.
Alternatively, you can also use your file manager. Its name will vary according to your Linux distribution. It can be Dolphin, Konqueror, Nautilus, Thunar, Nemo or whichever default file manager comes pre-installed with your OS. Access your windows partition within the USB key, then open the “efi” folder. From there, open the “boot” folder. You should find a file called “bootx64.efi”. If you cannot access the folders, make sure that you have installed the NTFS-3G kernel module.
Once you checked that the “bootx64.efi” file is present in the “boot” folder, unmount the partition by entering the following command in the Terminal:
$ umount /dev/<sdb2>
Where <sdb2> is your pen drive NTFS partition (partition #2); usually either sdb2 or sdc2.
Alternatively, you can also eject the “windows” partition the old fashion way using the file manager.
Now for the most delicate part of this Windows 10 disc image burning project: the installation and configuration of the boot loader package.
We will use a specially designed driver, made by Pete Batard (the author of Rufus). His “UEFI:NTFS” driver, as well as more information about his different projects, can be found on his GitHub page: https://github.com/pbatard. His driver will help us make this procedure as simple as it can get (it is long enough as it is!).
Download the disk image found here https://github.com/pbatard/rufus/tree/master/res/uefi by clicking on “uefi-ntfs.img.” Remember its download location.
We now have to mount the .img file.
We will use the Terminal; alternatively, you could use your Linux distro Disk Image tool. To mount the file, do the following:
Enter a command to create a mount point for the ISO file.
sudo mkdir /mnt/driver
Where “driver” is the name of the new mount point. After entering the password, access the directory where you downloaded the .img file:
Where <USERNAME> is your account name and <path> where you have downloaded your file (usually “Downloads”).
sudo mount -o loop </path/to/uefi-ntfs.iso> /mnt/windows
Your driver is now mounted. From there, we will access the mounted .img by executing:
We will then display the list of its content by typing:
You should see two items: “efi” (a folder) and “readme.txt” (a text file).
Voilà. Your “UEFI:NTFS” driver is mounted, and we checked its content to make sure that the “efi” folder is present.
We will now copy the entire “efi” folder to the root of the FAT32 partition. To do so, type the following, making sure that your partition #1 is mounted beforehand:
Where <USERNAME> is your login account and “BOOTLOADER” the name of your Partition #1. Then, type:
sudo mkdir root
We have now created a directory within the partition, which we will use as a target point for the transfer of the “efi” folder content.
Now exit the directory by typing:
Then, access the efi folder:
After that, copy its entire content to the target directory by executing:
sudo cp -r * /media/<USERNAME>/BOOTLOADER/root
I also double-checked the content of the bootloader by typing “ls”. This step is optional. Within the bootloader, you should find “boot” and “root.”
You can now unmount your pen drive. To unmount it, enter the following in the Terminal:
$ umount /dev/sd<?>
Where <?> is the letter linked to your USB drive (it is usually “b”)
Congratulations! You can now use your USB drive to boot Windows 10.
A final word of advice:
If you plan on booting Windows 10 directly on a laptop or desktop computer (as opposed to a virtual machine), you will have to adjust some of its UEFI settings. Before installing Windows 10, you will have to change the boot priority order and disable the UEFI secure boot option. You can find the instruction on how to do so HERE.
© 2019, ITgirl.tech. All rights reserved.