I'm a Windows user but use Live Ubuntu occasionally to do some troubleshooting. I'm trying to learn a bit more about Linux, and I'm trying to just install GRUB on a USB drive (ultimately I would also install Tiny Core on that same drive but for now I just want to get GRUB working, for educational purposes).
I read the GRUB manual up to the "Installing GRUB using grub-install" section, but I'm getting all kinds of errors which I lack basic knowledge to understand (and couldn't find answers on Google).
Here's what I've done so far:
- Boot from a Live USB of Ubuntu 18.04 (created from Windows using Rufus with MBR parition scheme)
- Use GParted to create an (empty) msdos partition table on my (2nd) USB drive (/dev/sdb)
- Download
grub-2.06.tar.gz
source code from https://ftp.gnu.org/gnu/grub/ - Install all the dependencies required to run
./configure
withapt
- Execute
./configure --host=x86_64 --with-platform=efi
to generate the Makefile (i think my computer is UEFI since the folder /sys/firmware/efi exists) - Execute
sudo make install
From this point, if I do:
sudo grub-install /dev/sdb
i getgrub-install: error: cannot find EFI directory.
sudo grub-install /dev/sdb --efi-directory=/cdrom/EFI
i getgrub-install: error: unknown filesystem.
Could anyone please point me in the right direction to get me unstuck? All the guides I found online were about "repairing" GRUB when having an already installed Linux OS. Thanks a lot.
sudo grub-install --target=x86_64-efi --efi-directory=/media/test --bootloader-id=grub --removable --recheck --debug
You just need the ESP FAT32 boot & esp flags.