Create a USB disk for Windows Startup and installation in Ubuntu Linux
Recently, I want to burn a Windows Installation USB flash drive on Ubuntu and read some information on the Internet. However, many of them are vague, so I have taken a lot of detours. I want to help you.
First, you have a USB. Here we assume that USB is/dev/sdb In ubuntu.
1. Partition the USB device/dev/sdb. Note that if the primary partition is used,
Sudo fdisk/dev/sdb
Command (m for help): n
Partition type:
P primary (0 primary, 0 extended, 4 free)
E extended
Select (default p): p
Partition number (1-4, default 1 ):
Using default value 1
First sector (2048-15564799, default 2048 ):
Using default value 2048
Last sector, + sectors or + size {K, M, G} (2048-15564799, default 15564799 ):
Using default value 15564799
Command (m for help): p
Disk/dev/sdb: 7969 MB, 7969177600 bytes
246 heads, 62 sectors/track, 1020 cylinders, total 15564800 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: 0x8d55b9cb
Device Boot Start End Blocks Id System
/Dev/sdb1 2048 15564799 7781376 83 Linux
The above/dev/sdb1 is separated, and all the space is allocated to sdb1.
2. Set/dev/sdb1 as the startup partition.
Command (m for help):
Partition number (1-4): 1
Command (m for help): p
Disk/dev/sdb: 7969 MB, 7969177600 bytes
126 heads, 10 sectors/track, 12353 cylinders, total 15564800 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: 0x8d55b9cb
Device Boot Start End Blocks Id System
/Dev/sdb1*2048 15564799 7781376 83 Linux
We can see that there is an additional * behind sdb1 *
3. Next, write all the changes made above to the USB
Command (m for help): w
The partition table has been altered!
Calling ioctl () to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used
The next reboot or after you run partprobe (8) or kpartx (8)
Syncing disks.
Then q exits.
4. format the partition as ntfs
Sudo mkfs-t ntfs/dev/sdb1
In this process, all partitions are written to 0, which may take several minutes.
5. The next step is to dd The downloaded iso file to this startup partition.
# Burn the downloaded iso file to the usb partition (and it must be a partition. Otherwise, Operating not found will occur next time you use this usb file.
Sudo dd if =/home/peter/Downloads/WindowsTechnicalPreview-x64-ZH-CN.iso of =/dev/sdb1 bs = 4 M iflag = direct
See it. I'm installing win10.
6. You cannot start the USB disk or write data in the MBR of the USB disk. This requires LILO.
Sudo apt-get install lilo
Sudo lilo-M/dev/sdb mbr
When you start the next time, select this USB to start the windows Installation interface!
In addition, I tried unetbootin myself, but it was not successful. After I started the USB flash drive, I stuck it in a selection interface. We recommend that you have a successful trial.