Making multi-boot USB drive with GRUB2

Source: Internet
Author: User

A long time ago to do a grub2 based on the multi-start U disk, but did not make a record, this time to make a record for everyone to reference, also do a memo.
Previously just did to install Ubuntu from the USB stick, as well as through the PE install win, this time also integrates the CentOS (I only experimented with CentOS7, the other version is not expected, because the other version is not used GRUB2 boot).
Before the comparison of vegetables, only follow the tutorial step by step, although now also very dishes, but feel a little more.
Previously thought to do more startup disk, U disk can only have a partition, now found not, just want to put GRUB2 to a partition on the line, this time I on their own mobile hard disk on a section out, also installed.
Let's start the installation below.

Raw materials
    1. A USB flash drive large enough (or a removable hard drive is OK)
    2. An Ubuntu operating system (LiveCD boot is also OK)
    3. A PE ISO and several operating system images (Ubuntu Live CD, CentOS7 Live CD)

The following is the official installation, the operation is in Ubuntu

Formatting a USB flash drive # 查看一下磁盘情况 shell>> fdisk -l # umount要格式化的磁盘,我使用的是/dev/sdc3 # 如果没有挂载,没有这一步操作 shell>> umount /dev/sdc3 # 格式化 shell>> mkfs.vfat -F 32 -n MULTIBOOT /dev/sdc3Installing GRUB2 to/DEV/SDC3 # 挂载/dev/sdc3 shell>> mkdir -p /media/MULTIBOOT shell>> mount /dev/sdc3 /media/MULTIBOOT # 安装grub2,注意这个命令中最后使用的/dev/sdc,而不是/dev/sdc3 shell>> grub-install --force --no-floppy --boot-directory=/media/MULTIBOOT /dev/sdc shell>> cd /media/MULTIBOOT # 获取grub.cfg shell>> wget pendrivelinux.com/downloads/multibootlinux/grub.cfgCopy the ISO to the U-disk

First you need to create a folder in the root directory of the USB stick called ISO, and then copy the ISO to this directory.
WinPE startup requires a special file called Memdisk, you can go online Baidu, if you can not find email me, I sent you ([email protected])

Configure Grub.cfg

A system needs to be started, only the corresponding mirrored copy of the ISO directory, and configured in Grub.cfg.
Here is my configuration

# This grub.cfg file was created by Lance http://www.pendrivelinux.com # Suggested Entries and the suggestor, if available, will also be noted.   set timeout=10 set default=0   menuentry "WinPE" { linux16 /ISO/memdisk iso initrd16 /ISO/winpe.iso }   menuentry ‘Ubuntu 14.04.2(64)‘ { set isofile="/ISO/ubuntu-14.04.2-desktop-amd64.iso" loopback loop $isofile linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject quiet splash persistent -- initrd (loop)/casper/initrd.lz }   menuentry ‘CentOS Linux 7 1503 Live‘ --class fedora --class gnu-linux --class gnu --class os { insmod loopback   set iso_path="/ISO/CentOS-7-x86_64-LiveCD-1503.iso" loopback loop $iso_path Linux(Loop)/Isolinux/Vmlinuz0 ISO-Scan/FileName= $iso _path root=live: cdlabel=centos-7< Span class= "pun" >-livecd-x86_64 Rootfstype =auto ro quiet rd. Live. Image Noeject RHGB rd.=0 Rd.=0 Rd.=0 initrd (loop)/isolinux/initrd0.img } #menuentry "Ubuntu Desktop ISO(32)" { # loopback loop /ubuntu.iso # linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu.iso noeject noprompt splash -- # initrd (loop)/casper/initrd.lz #}Restart your computer and test it.

Now you can restart your computer and test it.

Reference articles
      1. http://www.pendrivelinux.com/boot-multiple-iso-from-usb-via-grub2-using-linux/
      2. Http://blog.chinaunix.net/uid-14735472-id-4211274.html

Making multi-boot USB drive with GRUB2

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.