เหตุผลที่พยายามทำสิ่งนี้ค่อนข้าง convoluted เริ่มเหมาะ good story ด้วย problem conflict conundrum ผมมี laptop multi-boot system Windows 10 และ Linux distributions เยอะ มัน ill ไม่บูท ไม่มีอะไรเลย ต้อง recover และ recover ทีละระบบ จนเหลือ Windows 10 ตัวสุดท้ายที่ stubborn
ผมคิดว่า Windows 10 install media ช่วยได้ เพราะ better control recovery tools options มากกว่า botched startup หมายถึงสร้าง bootable media ซึ่งซับซ้อนกว่าคิด อยากสร้าง USB media ใน Linux โดยไม่ rely third-party tools ที่อ้างว่าทำได้ ทำไม? เพราะ independence ถ้า standard tools works ใช้ได้ทุกที่ เริ่มกันเลย
Step 1: Download Windows 10 ISO
ไม่ trivial ใน Windows จะเสนอแค่ Windows media creation tool แต่เรา raw ISO อยากได้ ควรทำโดย change user agent browser หรือ download image ใน Linux distribution ซึ่งเป็นเหตุผลเราอยู่ที่นี่! First challenge surmounted successfully
Step 2: Mount & copy และ/หรือ extract ISO
ได้ file downloaded ต้อง extract ไป writable location เช่น home directory ถ้า mount ISO as loopback device จะ read-only ต้อง manually copy contents บาง Linux file managers ไม่ extract ISO files natively บางตัวทำได้ ผมเจอ error:
This disc contains a "UDF" file system and requires an operating system
that supports the ISO-13346 "UDF" file system specification.
Manual mount & copy:
mount -o loop windows10.iso /mountpoint
cp -r -T /mountpoint/ /home/"user"/windows10data
Step 3: Compress install.wim
เหตุผลทำข้างบนคือไฟล์ install.wim ใน ISO ใหญ่กว่า 4 GB ต้อง compress เหตุผลคือขึ้นกับ system firmware machine อาจไม่ boot NTFS-formatted devices (most likely not) เพื่อ safe side USB drive ต้อง FAT32 มี 4GB limit file size
File อยู่ under sources ในกรณีเรา /home/"user"/windows10data/sources/install.wim compress ต้องใช้ tool wimlib หาใน distro repos ได้ ผมใช้ Kubuntu 18.04 package available
sudo apt-get install wimtools
Compression step (inside folder containing ISO files):
sudo wimlib-imagex optimize install.wim --solid
อาจต้อง sudo เพราะอาจเจอ error:
[ERROR] Can't modify "/home/roger/win/sources/install.wim": Permission denied
ERROR: Exiting with error code 71:
The WIM is read-only (file permissions, header flag, or split WIM).
Successful result:
"install.wim" original size: 4463411 KiB
Using LZMS compression with 8 threads
Archiving file data: 9 GiB of 9 GiB (100%) done
"install.wim" optimized size: 3311533 KiB
Space saved: 1151878 KiB
4.4GB image ลดเหลือ 3.3GB reduction 30% หมายถึงมี room to grow ก่อน method นี้ inadequate สำหรับ Windows 10 ISO files และ FAT32 filesystem ในอนาคต
Step 4: Prepare USB device
ต้องการ thumb drive อย่างน้อย 8 GB ต้อง partitioned ใช้ GParted หรือ KDE Partition Manager หรือ fdisk/gdisk command line เตรียม device first create new GPT partition table second create single FAT32 partition ไม่ควรมี boot flag identified as "msft-data" partition

Command line ด้วย gdisk:
sudo gdisk /dev/[your device here]
ตัวอย่าง:
sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help):
EXTRA careful อย่าทำ wrong device ruin data! ใน gdisk steps:
- o — create new GPT partition table
- n — create new partition (defaults number, sectors)
- w — write data (extra careful lest you cry)
Exit tool format partition:
sudo mkfs.vfat /dev/[your device, partition here]
เช่น /dev/sdb default mkfs.vfat เลือก optimal FAT size override ได้ด้วย -F flag แต่ most cases ไม่ต้องเปลี่ยน ได้ default FAT32 filesystem
Disk /dev/sdb: 14.9 GiB, 16008609792 bytes, 31266816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 43479D21-6D76-2CA4-A7BA-596C08A99193
Device Start End Sectors Size Type
/dev/sdb1 2048 31260671 31258624 14.9G Microsoft basic data
Step 5: Copy data ไป USB device
ทุกอย่างพร้อม copy extracted ISO contents ด้วย compressed install.wim ไป USB drive:
sudo mount /dev/[your device, partition here] /usb/mount/point/
sudo cp -r -T /location/windows10data /usb/mount/point/
Screenshot สุดท้าย show partition table contents

And everything is ready now. We can proceed to commence to boot.
Step 6: Boot Windows 10 on target device
Bob's your uncle จุดนี้
Optional: NTFS partition on USB device
อาจ wonder Windows ทำ "officially" ยังไง หรือ tools (woeusb Rufus) handle install.wim >4GB ยังไง boot NTFS devices on UEFI systems ได้ แต่ต้อง extra steps
In essence involves UEFI:NTFS bootloader ไม่รายละเอียดมากเพราะ optional come-what-may limited creating/using method ข้างบน sequence steps (มี alternatives แต่เป็นหนึ่งทาง):
- Create new GPT/MBR partition table on USB device
- Create NTFS partition spans entire device minus 512 KB
- Create FAT16 partition spans 512 KB size
- Add boot and lba flags to FAT16 partition
- Download UEFI bootloader image from pbatard's Rufus GitHub repository
- Mount or extract image (like above)
- Copy efi files ใน image ไป FAT16 partition
- Copy Windows 10 ISO contents ไป NTFS partition
สรุป
จบ tutorial นี้ hope useful เพราะ seemingly trivial actions unintended convoluted consequences เช่นเราเห็น ถ้าไม่อยาก rely third-party tools (much) และอยากสร้าง Windows 10 USB install media ใน Linux guide นี้ให้ necessary steps
เราเรียนรู้ quite some รวมถึง manage ISO images compress wim files partition format devices และ optional magic trick booting NTFS devices on UEFI hardware นี่คือสิ่งที่ USB creation tools หลายตัวทำใน background ตอนนี้คุณใน on the secret well that's all for now off you go installing
Cheers.