Create a windows boot disk and a linux boot disk

Source: Internet
Author: User

Create a windows boot disk and a linux boot disk

Usually, there are many operating commands used in linux. Therefore, for convenience, a dual system is installed on the computer. Generally, you can choose to enter the linux system during work. However, there is something else that needs to be solved today: Create a windows boot disk. As usual, I will start windows, and then work with xxx to create a USB flash drive to create a startup disk. But today, I do not want to restart the system to enter the boot disk for windows USB flash drives. I want to create a USB flash drive in linux.

I have also encountered some blogs or other information about the USB flash drive in linux, all of which can be done by using the dd command. I have tried it before, the dd command causes an error while burning the windows iso file. The system cannot identify the burned boot disk. I did not go into any further reasons. I will continue to solve this problem today and find a solution online. After searching for a long time, I finally found an article on the boot disk. The following is the URL of the Article. If you are interested, you can view it on your own:

Url: http://blog.csdn.net/mike8825/article/details/51138575? LocationNum = 9 thanks to the sharing of "guests of the past day.

The blog also said that linux's iso comes with mbr, so dd will burn the mbr together into the USB flash disk when it is used to burn the linux iso. However, windows iso files do not contain mbr. Therefore, when creating a windows boot disk in linux, you must first write mbr information to the USB flash disk. Then copy the windows iso content to the USB flash drive. In this way, the bios can correctly identify the mbr and install the windows system.

Follow the steps in the previous blog to perform the following operations:

My operating system: ubuntu 17.04

1. First check if there is any installation ntfs-3g and see that I have installed it. If there is no installation of the Execute Command: sudo apt install ntfs-3g

1 $ apt list ntfs-3g # Check if the ntfs-3g3 is installed in the list... complete 4 ntfs-3g/zesty, now. 2.22AR.1-4 amd64 [installed] 5 6 $ sudo apt install ntfs-3g # if not installed, run this command to install

2. install lilo. If the installation is complete, run the command: sudo apt install lilo to install lilo.

1 $ dpkg-l lilo 2 3 expected status = unknown (u)/install (I)/delete (r)/clear (p)/keep (h) 4 | status = not installed (n)/installed (I)/only available configuration (c)/Only decompressed (U)/configuration failed (F)/not fully installed (H) /trigger wait (W)/trigger pending (T) 5 |/error? = (None)/must be reinstalled (R) (Status, error: Capital = fault) 6 |/name VERSION architecture description 7 ++-========================== ============================================================ ======================================================== ======================================== 8 ii lilo. 2-2 amd64 LInux LOader-the classic OS boot loader 9 10 $ sudo apt install lilo # If the prompt is not installed, perform the installation

3. view the drive letter of the USB flash drive, back up the content of the USB flash drive, and format the USB flash drive. format the drive fat32. (You can see that the format of My USB flash drive is already fat32)

1 $ sudo fdisk-l # view the disk partition 2 3... 4 5 Disk/dev/sdb: 7.3 GiB, 7784628224 bytes, 15204352 sectors 6 Units: sectors of 1*512 = 512 bytes 7 Sector size (logical/physical ): 512 bytes/512 bytes 8 I/O size (minimum/optimal): 512 bytes/512 bytes 9 Disklabel type: dos10 Disk identifier: 0x4815636811 12 device Start end sector Size Id type 13/dev/sdb1*1347328 15204351 13857024 6.6G c W95 FAT32 (LBA)

The drive letter of my USB flash drive is/dev/sdb.

1 $ sudo mkfs. vfat/dev/sdb1 # format the USB flash drive, provided that the USB flash drive is correctly uninstalled 2 mkfs. fat 4.0)

I used the command above to format the USB flash drive in fat32 format.

4. Create mbr in the USB flash drive (what does mbr mean? Search for it by yourself). lilo I use here

1 $ sudo lilo-M/dev/sdb mbr # Write mbr2 Backup copy of/dev/sdb in/boot/boot.08103 The Master Boot Record of/dev/sdb has been to The USB flash drive updated.

The above prompt indicates that the mbr is successfully created. Copy the content in the windows iso to the USB flash drive.

5. Mount the image and USB flash drive, and copy the content from the windows image to the USB flash drive.

1 $ mkdir/tmp/win7 2 $ mkdir/tmp/usb 3 4 $ sudo mount-o loop restart/tmp/win7 5 6 $ sudo mount/dev/sdb1/tmp/usb 7 8 $ df-h # view mount point 9 file system capacity used available % mount point 10 ..... 11 ..... 12/dev/loop4 3.1G 3.1G 0 100%/tmp/win713/dev/sdb1 6.6G 4.0 K 6.6G 1%/tmp/usb

We can see that I have mounted the system, and the rest is to copy/tmp/win7 to/tmp/usb.

6. Copy the iso file content to usb.

$ Cp-rf/tmp/win7/*/tmp/usb # copy to the usb flash disk $ sync # flush the data in the memory to the disk $ sudo umount/dev/sdb1 # uninstall the usb flash disk $ sudo umount/tmp/win7 # uninstall the image

Now it's done. restart the computer and verify the labor results.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.