How to Create a (persitent) Bootable Windows 10 USB in Linux

No windows user around me…

Well @HadaDeLaLuna,

Some good news and some bad news.

First the bad - I have tried several times to create a bootable flash drive following the instructions. I have failed ever time. I might be doing something wrong. So I can no longer help with this problem. Maybe someone else can pick up the ball.

Good News - With the Linux Brasero, I was successful in burning the image to a DVD-DL and the DVD was able to boot and I got the Win 10 install screen. The Window ISO image is too large to fix on a regular DVD.

At this point I believe you have 3 good options.

1 - Continue with this problem. There are several forums beside this one, plus you can search the internet for help.

2 - Buy a DVD+DL and burn your own DVD with Brasero.

3 - Find a Windows PC and use Rufus to create a bootable flash drive.

Good Luck,
Howard

1 Like

@abhishek
I have been looking at your FOSS article

Can you explain why your article says to format the usb drive, then do a loop-mount, and then copy the iso content from the mount to the flash drive?

Why cant one just use dd to copy the iso to a flash drive? One may need to use isohybrid first to make it bootable? Is it because Windows install needs to sit in a fat32 filesystem on the flash drive?

You can see we are having trouble answering this post. Any help would be appreciated. We need to understand what windows requires that is different from linux. A dd would work fine with linux.

Will your method work with legacy boot and UEFI boot?

Regards
Neville

I only know Apple and Linux users or «non PC» ppl… There is no windows user around me

@HadaDeLaLuna ,
“Fairy of the Moon” , it sounds nice, I like latin languages, they are very poetic.

I have been looking into the article

https://itsfoss.com/bootable-windows-usb-linux/

and I had to resort to asking its author (Abhishek) some questions. I thought I had a CLI method … but it does not work on my Debian system. It is rather complicated , and there are lots of pitfalls, but with CLI I thought maybe I could see where it was going wrong if there were issues.

So here is my (failed) CLI method which is based on the graphical method in the above article. All the commands below need sudo or root user.

Step 1: Take a flash drive >8Gb, use gparted, delete all filesystems that are on it, make one new filesystem using the whole drive, and put a fat32 filesystem on it. Use an msdos partiton table ( thedefault in gparted)

Step 2: You will need loop devices. To check if they are present do
ls /dev/l*
you should see

/dev/log    /dev/loop1	/dev/loop3  /dev/loop5	/dev/loop7
/dev/loop0  /dev/loop2	/dev/loop4  /dev/loop6	/dev/loop-control

If they are not there you need to add the loop.ko module to the kernel. To do that do
modprobe -a loop

Step 3: Now you need to make what is called a loop mount of your Win10_21H2_English_x64.iso file.
First find an available loop device
losetup -f
it should reply loop0 if you are not using any loop devices
Second link that loop device to yourWin10_21H2_English_x64.iso file
losetup /dev/loop0 Win10_21H2_English_x64.iso
Third make a mount point to mount it to
mkdir /mnt/win
Fourth mount the loop device to the mount point
mount -o loop /dev/loop0 /mnt/win
It will give a message
WARNING: source write-protected, mounted read-only.
That is OK.
The purpose of the loop mount is to make available the “content” of the .iso file, so you can copy just the content.

Step 4: Mount the flash drive.
You have to find its device name
Take the flash drive out
lsblk
Put the flash drive back in
lsblk
In the output of the second lsblk there should be one extra device. That is the device name of the flash drive. Lets call it /dev/sdX.
Then make another mount point
mkdir /media/flash
and mount to it
mount -t auto /dev/sdX1 /media/flash
It is sdX1 becauase you want the partition on the flash drive, not the device.

Step 5: Copy all files from from the loop mount to the flash drive
cd /mnt/win
cp -avr * /media/flash
The copy will take a while.
then
sync

Step 6: Reboot and see if it boots.
Mine did not boot.

Step 7. The easy part. Boot the flash drive and use it to install Windows to your external HDD. Be careful that you get the device name of the external HDD correct.

So maybe @abhishek can tell us what is wrong.
Neither @easyt50 's attempt following Abhishek 's article with the graphic method, nor my attempt to translate it to a CLI method, were successful.

I am sorry to disappoint you, but there is some fundamental problem that we are all unable to see.

Regards
Neville

PS
I think I may have the missing trick
The .iso file is more than 4Gb. Therefore we cant use a fat32 filesystem on the flash drive. Have to use ExFAT ( or maybe ntfs)
I will try it tomorrow.

1 Like

So @abhishek many thanks in advance for your help ! :slightly_smiling_face:

I redid steps 1 to 6, with Step 1: changed to an Exfat filesystem.

The result was the same… it did not boot

Further research required. Exfat is definitely required, but there is something else wrong.

Neville

1 Like

Yes, I found the same thing about needing exfat. The only thing that worked for me was writing to a DVD and then again not regular DVD (4.7 GB) but I needed a DVD-R DL (8.7 GB).

The guide @abhishek posted needs some serious updating.

I formatted in NTFS thus it doesn’t work as you can see in my attempt

HadaDeLaLuna

I formatted in NTFS thus it doesn’t work as you can see in my attempt

We need to find what is wrong, before @Abhishek can update it.
The DVD boots because the reader helps with the booting
On a flash drive or any hdd, you need a bootloader.
So I think we need to find how tho put a bootloader on that flash drive.
Not sure if grub would work? I think we may need a Windows bootloader.

Can I ask @easyt50 and @HadaDeLaLuna , were you trying to,boot with UEFI or with legacy bios boot? Mine was legacy.

Regards
Neville

Can I ask @easyt50 and @HadaDeLaLuna , were you trying to,boot with UEFI or with legacy bios boot? Mine was legacy.

I’m using LibreBoot…

@nevj, I believe I tried both ways.
I think you hit the nail on the head, about needing a boot loader.

I tried UEFI tonight… no luck there
I tried adding grub… it booted grub to the command prompt grub> but I could not boot Win10 using grub commands.
I tried various boot sectors with ms-sys… all failed

So yes, it needs some sort of bootloader, but I dont know how to set it up.
I am wondering if the method of putting the content of the iso onto a flash drive, rather than just imaging the whole iso, is actually destroying the bootability.?

Never used that… I will have a look. I would need to put it on the flash drive.
Is your bios set to legacy boot or UEFI?

It’s Open Source: LibreBoot Website

It only works for Linux or BSD.
We need a Windows bootloader, … I think?

Good News!

I was able to create a bootable USB following the procedure on this web page.

But basically, you download ventoy and install it onto a 8 GB (or greater) USB flash drive.
The instruction are for Win 11, but easy to get Win 10 too.
After the install of ventoy, copy the Win ISO to the ventoy USB.
Boot the Ventoy USB.
Click on the Win 10 ID and Win10 install program loads.

Note - this is the install program for Windows.

You will have to have another external attached USB HDD or SSD for the actual install process of Windows.
I hope this solves your request. If you need additional help just ask.

1 Like

Congratulations. That seems to be a solution for @HadaDeLaLuna .
Check that it works for both legacy boot and uefi.

More good news.

I am finally able to create a bootable flash drive of the Win10 install iso, using the command line.
Most of the steps are the same as previously posted. The new steps are to do with adding a Windows bootloader. Note that I have changed to NTFS filesystem on the flash drive. I have put the successful sequence all together here for convenience.

All the commands below need sudo or root user.

Step 1: Take a flash drive >8Gb, use gparted, delete all filesystems that are on it,
 make one new filesystem using the whole drive, and put a NTFS filesystem on it.
 Use an msdos partiton table ( the default in gparted). 
Give the NTFS partition a boot flag. (not sure this is necessary)

Step 2: You will need loop devices. To check if they are present do
ls /dev/l*
you should see

/dev/log    /dev/loop1	/dev/loop3  /dev/loop5	/dev/loop7
/dev/loop0  /dev/loop2	/dev/loop4  /dev/loop6	/dev/loop-control

If they are not there you need to add the loop.ko module to the kernel. To do that do
modprobe -a loop

Step 3: Now you need to make what is called a loop mount of your Win10_21H2_English_x64.iso file.
First find an available loop device
losetup -f
it should reply loop0 if you are not using any loop devices
Second link that loop device to yourWin10_21H2_English_x64.iso file
losetup /dev/loop0 Win10_21H2_English_x64.iso
Third make a mount point to mount it to
mkdir /mnt/win
Fourth mount the loop device to the mount point
mount -o loop /dev/loop0 /mnt/win
It will give a message
WARNING: source write-protected, mounted read-only.
That is OK.
The purpose of the loop mount is to make available the “content” of the .iso file, so you can copy just the content.

Step 4: Mount the flash drive.
You have to find its device name
Take the flash drive out
lsblk
Put the flash drive back in
lsblk
In the output of the second lsblk there should be one extra device. That is the device name of the flash drive. Lets call it /dev/sdX.
Then make another mount point
mkdir /media/flash
and mount to it
mount -t auto /dev/sdX1 /media/flash
It is sdX1 becauase you want the partition on the flash drive, not the device.

Step 5: Copy all files from from the loop mount to the flash drive
cd /mnt/win
cp -avr * /media/flash
The copy will take a while.
then
sync

Step6: Download and install `ms-sys`. Download and instructions available at
https://ms-sys.sourceforge.net/

Here are the instructions to make and install it
---------------
 1:  unpack the archive:
tar -xzvf ms-sys*.tgz

 2:  compile:
cd ms-sys
make

3:  become root and install
su (and give password)
make install

Step 7:  Use ms-sys to write ther Win7 bootloader to the flash drive... The Win7 bootloader will work with Win10

ms-sys -n /dev/sdX1
this writes the win7 boot record to the ntfs device

ms-sys -7 /dev/sdX
this write the Win7 MBR to the raw device

Step 8: Reboot and see if it boots.
Mine worked.
It will only work with Legacy boot, because only legacy boot will work with NTFS filesystems. 
Note the boot is slow from a flash drive.

Step 9: The easy part. Boot the flash drive and use it to install Windows to your external HDD. 
Be careful that you get the device name of the external HDD correct.

Well, doing it from the CLI was a challenge, and I learnt some things, but really @HadaDeLaLuna you would be better off using @easyt50 's Ventoy method.
What we learned from the CLI exercise is that the itsFOSS article that you followed is definitely deficient, because it does not put a bootloader on the flash drive.

1 Like

Many thanks
May I used any of this on my USB 1To dedecated disk ?
Why no data partition on the USB device ?
Is it a bootable persitent windows ?