windows2usb/README.md

111 lines
4.9 KiB
Markdown
Raw Normal View History

2018-04-30 22:40:11 +03:00
# Windows2usb
**Burn Windows ISO to USB Flash Drive on Linux**
## What is this?
2021-08-16 01:15:12 +03:00
Windows2usb is a bash script which writes Microsoft Windows 7/8/8.1/10/11 installation DVD images to USB Flash Drive or external HDD on Linux. It was designed with compatibility in mind, and should work in all cases, contrary to other popular Linux tools.
2018-04-30 22:40:11 +03:00
Features:
* Fully automatic, no preparations required
* Supports BIOS and UEFI, FAT32 and NTFS
* Supports custom Windows ISOs with install.wim > 4GiB
* Uses stock Windows bootloaders where possible
* Does not break UEFI Secure Boot chain
2021-08-16 01:15:12 +03:00
```
Windows 7/8/8.1/10/11 ISO to Flash Drive burning utility
WARNING: this program will delete all existing data on your drive!
windows2usb <device> <windows iso> [mbr/gpt/gptntfs/gpt+uefintfs]
2021-08-16 01:15:12 +03:00
mbr mode: the most universal, RECOMMENDED and DEFAULT method.
2021-08-16 01:15:12 +03:00
This mode creates MBR partition table with FAT32 partition,
installs BIOS and UEFI bootloaders, supports Secure Boot.
install.wim file larger than 4 GiB will be split.
Suitable for all computers (UEFI/CSM/BIOS).
gpt mode: less universal mode, for modern (UEFI) computers.
GPT+FAT32, UEFI only, supports Secure Boot.
gptntfs mode: all the same as 'gpt' but NTFS is used.
GPT+NTFS, UEFI only, supports Secure Boot.
Large install.wim file will not be split.
NOTE: not all UEFI are compatible with this mode,
NTFS driver should be present on the motherboard.
gpt+uefintfs mode: alternative hacky installation method, not recommended.
This mode uses NTFS partition and third-party 'uefintfs' bootloader.
2022-12-07 01:57:02 +03:00
GPT+NTFS(data)+FAT32(efi), UEFI only, supports Secure Boot
(since uefintfs Oct 23, 2021 release).
2021-08-16 01:15:12 +03:00
Large install.wim file will not be split.
```
2018-04-30 22:40:11 +03:00
## How to use?
Download latest [portable AppImage version](https://github.com/ValdikSS/windows2usb/releases) from the **Releases** page, set *execution bit* (`chmod +x windows2usb-*.AppImage`) and run it from the terminal.
`windows2usb <device> <windows iso>`
For example:
`./windows2usb.AppImage /dev/sdz /home/valdikss/windows10.iso`
2018-04-30 22:40:11 +03:00
2021-08-16 01:15:12 +03:00
The program prints removable storage list if no arguments are supplied.
2018-04-30 22:40:11 +03:00
2018-05-01 13:57:44 +03:00
If you don't want to use AppImage, you'll need to install all dependencies and download [uefi-ntfs.img](https://github.com/pbatard/rufus/tree/master/res/uefi) from Rufus project.
### Feature Matrix
|Modes |Legacy/UEFI-CSM Boot|UEFI Boot|Large ISO (>4GB)|Secure Boot|File System|Part Table|
|:----------:|:------------------:|:-------:|:--------------:|:---------:|:---------:|:--------:|
|mbr(hybrid) |Supported |Supported|Supported |Supported |FAT32 |MBR |
|gpt |No |Supported|Supported |Supported |FAT32 |GPT |
|gptntfs |No |Partial |Supported |Supported |NTFS |GPT |
2022-12-07 01:57:02 +03:00
|gpt+uefintfs|No |Supported|Supported |Supported |NTFS |GPT |
2018-04-30 22:40:11 +03:00
### BIOS Boot
2021-08-16 01:15:12 +03:00
BIOS Boot (Legacy Boot/UEFI-CSM) uses stock Windows 7 MBR and FAT32 bootloader, courtesy of [ms-sys](http://ms-sys.sourceforge.net/) project.
2018-04-30 22:40:11 +03:00
2021-08-16 01:15:12 +03:00
**BIOS boot is supported only in recommended 'mbr' mode.**
2018-04-30 22:40:11 +03:00
2021-08-16 01:15:12 +03:00
To burn ISO compatible with BIOS boot (and UEFI boot as well), run:
2018-04-30 22:40:11 +03:00
`windows2usb <device> <windows iso> mbr`
### UEFI Boot
2021-08-16 01:15:12 +03:00
**UEFI Boot is supported in all modes. Recommended mode: 'mbr'.**
2018-04-30 22:40:11 +03:00
To burn ISO in this mode, run:
2021-08-16 01:15:12 +03:00
`windows2usb <device> <windows iso> mbr`
2018-04-30 22:40:11 +03:00
2021-08-16 01:15:12 +03:00
'MBR', 'GPT' and 'GPTNTFS' modes utilize Windows UEFI bootloader from the ISO file, with Secure Boot support.
2018-04-30 22:40:11 +03:00
2021-08-16 01:15:12 +03:00
### UEFI Boot with NTFS Partition and uefi-ntfs bootloader
2018-04-30 22:40:11 +03:00
2021-08-16 01:15:12 +03:00
A special 'gpt+uefintfs' mode uses [uefi-ntfs](https://github.com/pbatard/uefi-ntfs) bootloader from Rufus project. **Windows2usb** creates 2 partitions in this mode, small 1 MiB FAT32 partition with **uefi-ntfs** and huge NTFS partition with ISO data.
2018-04-30 22:40:11 +03:00
2021-08-16 01:15:12 +03:00
This mode was included earlier to work with installation disks where install.wim file is greater than 4 GiB, but since then split WIM file functionality was introduced, and now this mode may be considered obsolete.
2018-04-30 22:40:11 +03:00
2022-12-07 01:57:02 +03:00
uefi-ntfs bootloader is signed by Microsoft since Oct 23, 2021 release and supports Secure Boot.
2018-04-30 22:40:11 +03:00
## Alternatives
2020-11-04 15:57:50 +03:00
[WoeUSB](https://github.com/WoeUSB/WoeUSB)—uses GRUB for BIOS Boot.
2020-08-15 11:31:45 +03:00
[bootiso](https://github.com/jsamr/bootiso/)—supports Windows and Linux ISOs.
[Ventoy](https://www.ventoy.net/en/index.html)—Booting multi-tool with brilliant support of Windows ISO direct loading.
2018-04-30 22:40:11 +03:00
## Credits
This script uses:
* **lsblk** and **sfdisk** from [util-linux](https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/)
* [**ms-sys**](http://ms-sys.sourceforge.net/) for native Windows 7 MBR and NTFS bootloaders
* [**p7zip**](https://www.7-zip.org/) for ISO extraction
2018-05-27 13:19:26 +03:00
* [**autofsync**](https://github.com/i-rinat/autofsync/) to prevent filesystem bufferbloat and properly show copying progress (AppImage only)
2021-08-16 01:15:12 +03:00
* [**wimlib**](https://wimlib.net/) to split large install.wim files to fit FAT32 partition
2022-12-07 01:57:02 +03:00
* [**uefi-ntfs**](https://github.com/pbatard/uefi-ntfs/)