#Can't setup a portable standalone GRUB

27 messages · Page 1 of 1 (latest)

golden plover
#

My approach:

I initiate a usb drive with a new GPT table using fdisk.
A new ESP partition to house the GRUB.

sgdisk -n 0:0:+512M -t 0:EF00 -c 0:"GRUB_ESP" "/dev/sdc"
partprobe "$targetDisk"
mkfs.fat -F 32 -n "ESP" "/dev/sdc1"

I mount that partition and install grub onto it.

grub-install \
    --target=x86_64-efi \
    --efi-directory="/mnt/sdc1-part" \
    --bootloader-id=GRUB \
    --recheck

I boot it

qemu-system-x86_64 \
  -m 1G \
  -device qemu-xhci \
  -drive if=none,id=usbstick,file=/dev/sdc,format=raw \
  -device usb-storage,drive=usbstick \
  -boot menu=on \
  -display gtk,zoom-to-fit=on

near successful attempt

Before I restarted with a fresh GPT table, the usb was formatted with Etcher before it burned an iso onto it.
I don't know what it did, but it made usb bootable at least, the GRUB printed errors regarding unkown file system and it did not list all partitions on the usb when I did ls, but nonetheless, it was bootable.

my goal

I want to mimic Ventoy on my main drive while:

  • not destroying previous data partitions
  • having entries to other bootable drives and UEFI settings
golden plover
ornate dune
#

nope

#

close though

golden plover
#

holly dyslexia

ornate dune
#

so what exactly were you trying to do and what did you see happen instead?

golden plover
#

I want to boot into a GRUB installed onto my usb drive (or any drive).

#

I don't want to install an OS in a 2nd partition in order for the GRUB to work.

ornate dune
#

.aw archiso

gaunt mapleBOT
ornate dune
ornate dune
golden plover
ornate dune
#

oh right

#

efi right?

golden plover
golden plover
golden plover
#

EFI should not need any boot sector or any modification to the disk other than the ESP partition, right?

ornate dune
#

however if you use the fallback path it shouldnt need nvram (the exception being if you disabled that)