Make win boot usb on linux === ###### tags: `Programmer` 1. 取消掛載usb ```unmount /dev/sdcx``` (可以用```lsblk```確認掛載情形) 2. USB 隨身碟格式化為 NTFS 格式 - ```fdisk /dev/sdc``` t → 7 → a → 1 → w (重點: 1. 設定分割區格式為 HPFS/NTFS/exFAT; 2. 賦予 bootable flag) - ```fdisk -l /dev/sdc``` show result: ``` Disk /dev/sdc: 4016 MB, 4016046080 bytes 56 heads, 15 sectors/track, 9337 cylinders, total 7843840 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 Disk identifier: 0x0003a6b8 Device Boot Start End Blocks Id System /dev/sdc1 * 2048 7843839 3920896 7 HPFS/NTFS/exFAT ``` - ```mkfs.ntfs -f /dev/sdc1``` 3. Boot Loader 寫入 MBR ```lilo -M /dev/sdc mbr``` (要先下載lilo: ```apt-get install lilo```) 4. 將 Windows 光碟資料寫入 USB 隨身碟 ```mkdir ~/usb``` ```mount /dev/sdc1 ~/usb``` ```mkdir ~/loop``` ```mount -o loop /path/to/win7-x64.iso ~/loop``` ```cp -r ~/loop/* ~/usb/``` ```sync``` ### Reference [在 Linux 製作 Windows 系統之 USB 安裝碟](https://jamyy.us.to/blog/2015/08/7647.html)