Home Operation and Maintenance Linux Operation and Maintenance Detailed introduction on how to create a windows boot disk in linux system

Detailed introduction on how to create a windows boot disk in linux system

Jun 05, 2017 am 10:32 AM

I use many linux operating commands in my daily work, so for the sake of convenience, I installed dual systems on my computer. When I usually work, I choose to enter the Linux system. But today there is something other than work that needs to be solved: creating a Windows boot disk. If I follow the usual rules, I will start Windows, and then use xxx to make a USB boot tool to create a boot disk in a fool-proof way. But today I don’t want to restart the system and enter Windows to make a USB boot disk. I am thinking about making a USB boot disk in a Linux system.

I have come across some blogs or other information about making a USB bootable disk in Linux before. They all said that it can be done with the dd command. I have tried it before and found that there was a problem with the dd command when burning the Windows iso file. The system cannot recognize the burned boot disk. I didn't delve into the cause before, so I continued this problem today and looked for solutions online. After searching for a long time, I finally found an article that can make a boot disk normally. The following is the URL of the article. If you are interested, you can check it out by yourself:

url: http://blog.csdn.net/mike8825/article/details/51138575?locationNum=9 Thanks to "Tianwai Guest" for sharing .

It is also mentioned in the blog that Linux iso comes with mbr, so there is no problem when dd burns Linux iso, and mbr will be burned into the USB disk together. However, the Windows iso file does not come with mbr, so when making a Windows startup disk in a Linux system, you first need to write the mbr information to the USB disk. Then copy the Windows iso content to the USB flash drive. In this way, bios can correctly identify mbr and installwindows system.

Following the steps in the blog above, I performed the following operations:

My operating system: ubuntu 17.04

1. First check whether ntfs-3g is installed. See I have installed it. If it is not installed, execute the command: sudo apt install ntfs-3g

1 $ apt list ntfs-3g            #检查是否安装了ntfs-3g
3 正在列表... 完成
4 ntfs-3g/zesty,now 1:2016.2.22AR.1-4 amd64 [已安装]
5 6 $sudo apt install ntfs-3g   #如果没有安装,则执行这个命令安装
Copy after login

2. Install lilo and see that the installation is completed. If it is not installed, execute the command: sudo apt install lilo. Installation of lilo.

$dpkg -l lilo

期望状态=未知(u)/安装(i)/删除(r)/清除(p)/保持(h)
| 状态=未安装(n)/已安装(i)/仅存配置(c)/仅解压缩(U)/配置失败(F)/不完全安装(H)/触发器等待(W)/触发器未决(T)
|/ 错误?=(无)/须重装(R) (状态,错误:大写=故障)
||/ 名称                            版本                 体系结构             描述
+++-===============================-====================-====================-===================================================================
ii  lilo                            1:24.2-2             amd64                LInux LOader - the classic OS boot loader

$ sudo apt install lilo #如果提示未安装,则进行安装操作
Copy after login

3. Check the drive letter of the U disk, back up the contents of the U disk, and then format the U disk. The formatting process is fat32. (You can see that my U disk format has been It’s fat32)

$ sudo fdisk -l                #查看U盘的分区

...

Disk /dev/sdb: 7.3 GiB, 7784628224 bytes, 15204352 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: dos
Disk identifier: 0x48156368

设备       启动   Start     末尾     扇区  Size Id 类型
/dev/sdb1  *    1347328 15204351 13857024  6.6G  c W95 FAT32 (LBA)
Copy after login

You can see that the drive letter of my U disk is /dev/sdb

1 $ sudo mkfs.vfat /dev/sdb1        #格式化U盘,前提是U盘被正确卸载
2 mkfs.fat 4.0 (2016-05-06)
Copy after login

I used the command above to format the U disk into fat32 format.

4. Create mbr in the USB disk (what does mbr mean? Search yourself). The lilo I used here

1 $ sudo lilo -M /dev/sdb mbr           #在u盘中写入mbr
2 Backup copy of /dev/sdb in /boot/boot.0810
3 The Master Boot Record of  /dev/sdb  has been updated.
Copy after login

has been prompted above that I have successfully created the mbr. .The following is to copy the contents of the windows iso to the U disk.

5.Hang the image and the U disk, and copy the contents of the windows image to the U disk.

$mkdir /tmp/win7
$mkdir /tmp/usb

$sudo mount -o loop cn_windows_7_professional_with_sp1_vl_build_x64_dvd_u_677816.iso /tmp/win7

$sudo mount /dev/sdb1 /tmp/usb

$ df -h                  #查看挂载点
文件系统        容量  已用  可用 已用% 挂载点
.....
.....
/dev/loop4      3.1G  3.1G     0  100% /tmp/win7
/dev/sdb1       6.6G  4.0K  6.6G    1% /tmp/usb
Copy after login

Seeing that I have mounted the system, the only thing left is to copy the contents of /tmp/win7 to /tmp/usb

6. Copy the contents of the iso file to USB.

$ cp -rf /tmp/win7/* /tmp/usb           #拷贝到U盘中

$sync           #将内存中数据flush到磁盘中

$sudo umount /dev/sdb1           #卸载U盘

$sudo umount /tmp/win7            #卸载镜像
Copy after login
Now it’s done. Restart the computer and verify the results of your work

The above is the detailed content of Detailed introduction on how to create a windows boot disk in linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1673
14
PHP Tutorial
1278
29
C# Tutorial
1257
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! Apr 17, 2025 pm 09:54 PM

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

How to set important Git configuration global properties How to set important Git configuration global properties Apr 17, 2025 pm 12:21 PM

There are many ways to customize a development environment, but the global Git configuration file is one that is most likely to be used for custom settings such as usernames, emails, preferred text editors, and remote branches. Here are the key things you need to know about global Git configuration files.

See all articles