I installed grub on a USB memory with the above. Finally, let's actually start grub from the USB memory
Restart the PC, and when the power is turned off, start it while pressing and holding the F12 key etc. Most PCs should now be able to choose USB. (I'm sorry if it's different)
Then, I think that it is as follows on a black screen.
grub
grub>
It is stopped at such a screen. If this comes out, it is a success. Now let's boot Linux. The following three pieces of information are required to boot Linux.
First, check the partition where Linux is installed. This is the most troublesome. First, type the command as follows (... is omitted)
grub
grub>ls
(memdisk) (hd0) (hd1) (hd1,gpt8) (hd1,gpt7) (hd1,gpt6) ...
It should look like this. This shows all the storage areas and their partitions connected to your PC. It was as follows in my environment
hd0=usb hd1 = SSD in PC --gpt1 = 1st partition --gpt2 = 2nd partition .... --gpt8 = 8th partition
It is shown in the form of. This depends on the SSD and HDD environment of each PC. (In fact, my environment has too many hd1 partitions, I wonder if this is the cause of the malfunction ...)
In other words, Linux is included in any of hd1's gpt1 to gpt8. You can find out which partition has Linux in the following way.
grub
grub>ls (hd1,gpt8)/
lost+found/ boot/ hdata/ etc/ media/ var .....
If you see lost + found boot / .... as above, that is the Linux installation location. This time it was in hd1 (PC SSD) gpt8 (8th partition). The important one is (hd1, gpt8).
Next, the rest 2. Linux kernel and start path of installation location 3. The path of the software required to load the processing required for startup into memory Speak about Please note that # (1) in the following commands is described below.
grub
grub>set root=(hd1,gpt8)/
grub>linuxefi /boot/vmlinuz root=/dev/sda8 #(1)
grub>initrdefi /boot/initrd.img
grub>boot
Note "sda8" in root = / dev / sda8 for # (1). This is the first path where Linux is installed. This is different for each person, but it seems that it often works well if you combine the number (8) of "gpt8" of (hd1, gpt8) and "sda8" of root = / dev / sda8 that you entered earlier. Please note that this number is different for each PC. This part is the linux kernel (vmlinuz) and the first path (sda8) of the installation location.
And the last initrdefi is the software path (initrd.img) needed to load the memory for the process needed to start.
Hopefully you can now boot Linux with grub installed on a USB stick 。 Thank you for reading.
Recommended Posts