Create a multi-boot USB memory by placing multiple OS installation ISO files on the USB memory and installing the boot loader. As a procedure, first create a Windows 10 installer and then install GRUB there. Multi-boot is realized by reading the installer ISO files of various Linux OS from GRUB or chain-loading to the Windows installer.
Insert the USB memory you want to use as an installer into your Windows machine in advance. At least 8GB is required, and ISOs of other Linux distributions will be placed, so select the one with as large a capacity as possible.
Download Microsoft Media Creation Tool. Download "MediaCreationToolXXXX.exe" from the above page and start it. The version to be installed is entered in "XXXX".
Create an OS installer on the USB memory according to the explanation of the started tool. Success if the message that the installer has been created is displayed. For the time being, the work on Windows is over.
Since the installer is created with FAT32, it will be partitioned into 32GB partitions even if a large capacity USB memory is used. The area remaining from Windows disk management can also be used as a separate partition.
Insert the created installer USB memory into the Linux machine. Also, prepare the necessary Linux ISO file.
Below, we will proceed on the premise of Arch Linux. Software names and options may differ for other distributions. The version of GRUB described in this paper is GRUB2.
First, install GRUB.
sudo pacman -S grub
Mount the USB memory. When it becomes accessible, rename / mnt / usb / efi / boot / bootx64.efi
to bootx64.efi.windows
.
mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb
mv /mnt/usb/efi/boot/bootx64.efi /mnt/usb/efi/boot/bootx64.efi.windows
Install GRUB on a USB memory.
grub-install --target x86_64-efi --efi-directory /mnt/usb --boot-directory=/mnt/usb/boot --removable
Next, create a GRUB configuration file. Since it is necessary to describe the UUID of the partition, check it first. Get a hyphen-separated 8-digit string such as XXXX-XXXX.
lsblk -f | grep /mnt/usb
How to write the config file is [Arch Wiki](https://wiki.archlinux.jp/index.php/%E3%83%9E%E3%83%AB%E3%83%81%E3%83%96%E3 % 83% BC% E3% 83% 88_USB_% E3% 83% 89% E3% 83% A9% E3% 82% A4% E3% 83% 96). As for Ubuntu 18.04, the information on Ubuntu on the Wiki is old, so you should refer to the following. Prepare the ISO file of the corresponding version of Arch Linux, CentOS7, Ubuntu 18.04 Server, or modify the relevant part according to the version of the ISO file. For the ISO file, create a / mnt / usb / boot / iso
directory and place the file there. Windows 10 starts by chain-loading the first installed one. Save the created config file as /mnt/usb/boot/grub/grub.cfg
. For the UUID on the second line of grub.cfg
, specify the one obtained earlier.
mkdir /mnt/usb/boot/iso
vim /mnt/usb/boot/grub/grub.cfg
grub.cfg
# path to the partition holding ISO images (using UUID)
set imgdevpath='/dev/disk/by-uuid/XXXX-XXXX'
insmod all_video
menuentry '[loopback]archlinux-2020.03.01-x86_64' {
set isofile='/boot/iso/archlinux-2020.03.01-x86_64.iso'
loopback loop $isofile
linux (loop)/arch/boot/x86_64/vmlinuz archisodevice=/dev/loop0 img_dev=$imgdevpath img_loop=$isofile
initrd (loop)/arch/boot/x86_64/archiso.img
}
menuentry "[loopback]CentOS-7-x86_64-Minimal-1908" {
set isofile='/boot/iso/CentOS-7-x86_64-Minimal-1908.iso'
loopback loop $isofile
linux (loop)/isolinux/vmlinuz noeject inst.stage2=hd:/dev/sdb1:/$isofile
initrd (loop)/isolinux/initrd.img
}
menuentry '[loopback]ubuntu-18.04.4-live-server-amd64' {
set isofile='/boot/iso/ubuntu-18.04.4-live-server-amd64.iso'
loopback loop $isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile locale=en_US.UTF-8
initrd (loop)/casper/initrd
}
menuentry '[chain]Win10_1909_Japanese_x64' {
insmod chain
chainloader /efi/boot/bootx64.efi.windows
}
After arranging various files, the work is completed. Insert it into the machine where you want to install the OS, and select USB partition 1 from the boot menu of the BIOS at boot time. Success if the GRUB menu is displayed.
Recommended Posts