Use grub4dos to create a multi-system boot USB flash drive (win7, ubuntu12.04)

Source: Internet
Author: User

I usually use ubuntu a little more, but it is inevitable that I use win7 many times. In the past, I had to create a USB flash drive every time I reinstalled my computer. Is there a way to create multiple systems in one USB flash drive? I found some ways to access the Internet today and found that it is still relatively simple. grub4dos can be used quickly. Generally, Windows PE, linux, and Windows 7 systems are used on the Internet. I usually use Windows 7 and ubuntu, and the disk space is limited. Therefore, I only made the boot disks for these two systems.

I. Software and images to be prepared

1. grub4dos

2. grubinst

3. Background and font configuration files at startup

(The above three I have packed upload, download see: http://download.csdn.net/detail/hcx25909/5464025)

4. Use UltraISO to extract the image Startup File and modify the ISO

5. Download the image files of the two systems online.

Ii. format the USB flash drive first, and then use UltraISO to open the ISO disc of WIN7 (note that it should be enabled in administrator mode). Choose Start> write to hard disk image, and select U disk as the disk drive, do not select the wrong, choose portable boot --- write the new Hard Disk Master Boot Record (MBR) --- USB-HDD +, select write, wait until the write is complete.
3. Install grub4dos
First, decompress the grubinsitfile In the compressed package and run the grubinsit_gui.exe file (run as administrator in vista and win7 systems; otherwise, the USB flash drive cannot be found). Select the target USB flash drive, set it, and click install.

 
After this operation, the MBR of the USB flash disk is rewritten. Then copy grldrand grub.exe In the downloaded grub4dos file to the root directory of the target USB disk together with the menu. lst file in the same root directory. Note: hd1 indicates a USB flash disk and hd0 indicates a hard disk. Do not change the startup information of the hard disk. Otherwise, you may be unable to enter the system after restarting.
Iv. Upload Ubuntu files
Create a folder ubuntu under the root directory of the USB flash drive and rename the downloaded ubuntu ISO image file to ubuntu. iso, extract the initrd under the casper folder in the image file. lz and vmlinuz files and ubuntu. put the iso file together in the ubuntu folder. For example, the G drive is my USB drive letter, and all ubuntu stuff is placed in the ubuntu folder. I chose to hide the file, so it is in this color.
5. Edit the menu. lst file
Open the menu. lst file in notepad and modify it to the following code:
Default 0 timeout 10 find -- set-root/grldrgfxmenu/messagefontfile/fontstitle [01] -- install Windows 7 32-bit flagship chainloader/bootmgrtitle [02] -- start Ubuntu Live12.04 USB Kernel/ubuntu/vmlinuz boot = casper iso-scan/filename =/ubuntu. iso locale = zh_CN.UTF-8initrd/ubuntu/initrd. lztitle [03] -- hard disk boot computer map (hd0) (hd1) map (hd1) (hd0) map -- hookrootnoverify (hd0, 0) makeactivechainloader + 1 title [04] -- Restart computer reboottitle [05] -- disable computer halt

6. Add the startup background and font
Add the message and fonts files in the compressed package to the root directory of the USB flash drive. These two files are mainly used for the pictures and fonts of the boot menu. If you like DIY, you can make them by yourself, you can find the specific method by yourself. Otherwise, you can copy the prepared method.

7. Modify system attributes

Here, this multi-boot USB flash drive is ready. For security reasons, we can set all the attributes of these files in the USB flash drive to system files, read-only files, and hidden files, in this way, it will not be deleted by the USB flash drive during usage. We can use the CMD command line to implement:

Run the command, Enter CMD, open the command line tool, and enter the USB drive letter, for example, g:. Run the dir command to view the files and folders under the current drive letter.


Enter the command G: \> attrib + r + s + h/s/d. In a few seconds, all the files in the USB flash drive are hidden, in this way, it will not be deleted by mistake.


If you want to change them back to common files, use the attrib command.
-R-s-h/s/d to remove the system, read-only, and hidden attributes.
 
Well, now we are done. We can reinstall winPE, toolbox, and so on. Restart and enter the USB flash drive to start the USB flash drive to see the effect.

Do not forget to dig wells, the main reference link: http://blog.csdn.net/chengli42/article/details/7262380

----------------------------------------------------------------

You are welcome to repost my article.

Reprinted, please note: transferred from ancient-month

Http://blog.csdn.net/hcx25909

Continue to follow my blog

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.