Question about grub.cfg

Hello friends, I just created a usb flash drive to have some isos to install manjaro(specifically I want to try architect and openbox.

Anyone knows where I can get a ready grub.cfg to be able to boot it correctly? the usb works for UEFI and bios too, found a really good recipe, I tested and it boots to grub but there isn’t any iso in it yet.

Other thing I would want to know, how to create persistence in it? it would be really good to have a manjaro with persistent storage in this usb flash drive, if anyone know a recipe for this, I would be really grateful.

here is the grub.cfg that is in it right now:

    function load_video {
      if [ x$feature_all_video_module = xy ]; then
        insmod all_video
      else
        insmod efi_gop
        insmod efi_uga
        insmod ieee1275_fb
        insmod vbe
        insmod vga
        insmod video_bochs
        insmod video_cirrus
      fi
    }

    if [ x$feature_default_font_path = xy ] ; then
       font=unicode
    else
        font="$prefix/unicode.pf2"
    fi

    if loadfont $font ; then
      set gfxmode=1024x768x32
      load_video
      insmod gfxterm
      set locale_dir=$prefix/locale
      set lang=pt_BR
      insmod gettext
    fi
    terminal_input at_keyboard
    terminal_output gfxterm

    insmod png

    if background_image $prefix/grub-16x9.png; then
      set color_normal=white/black
      set color_highlight=black/white
    else
      set menu_color_normal=cyan/blue
      set menu_color_highlight=white/blue
    fi

    if [ ${grub_platform} == "pc" ]; then
      set color_normal=yellow/black
      set color_highlight=black/yellow
      set menu_color_normal=yellow/black
      set menu_color_highlight=black/yellow
    fi

    function gfxmode {
    	set gfxpayload="${1}"
    }
    set linux_gfx_mode=
    export linux_gfx_mode

    menuentry "Detectar grub.cfg..."  {
        insmod part_gpt
        insmod part_msdos
        insmod fat
        insmod ext2

                 for efi in (*,gpt*)/*/grub.conf (*,gpt*)/*/*/grub.cfg (*,msdos*)/*/grub.conf (*,msdos*)/*/*/grub.conf ; do
                    regexp --set=1:efi_device '^\((.*)\)/' "${efi}"
                    if [ -e "${efi}" ]; then
                        efi_found=true

                        menuentry --class=grub "${efi}" "${efi_device}" {
                            root="${2}"
                            configfile "${1}"
                        }
                    fi
                done

                if [ "${efi_found}" != true ]; then
                    menuentry --hotkey=q --class=find.none "No GRUB files detected." {menu_reload}
                else
                    menuentry --hotkey=q --class=cancel "Cancel" {menu_reload}
                fi
        }
    }

I’m not a programmer, and I need help

here is the fdisk -l of it too:

fdisk -l /dev/sde
Disk /dev/sde: 28,82 GiB, 30943995904 bytes, 60437492 sectors
Disk model: DataTraveler 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0B51B60B-C353-9643-9CE1-9A47D67B2393

Device     Start      End  Sectors  Size Type
/dev/sde1   2048     4095     2048    1M BIOS boot
/dev/sde2   4096    40926    36831   18M EFI System
/dev/sde3  40960 60437458 60396499 28,8G Linux filesystem

thanks for reading, if anyone wants the recipe to create this usb flash drive I can share, only issue is that I don’t really know how to put any isos in it lol.

Peace

For booting multiple ISO’s, I suggest Ventoy, it’s in the repos.

We have an Xfce persistent ISO and you can also build your own:

1 Like

Thank you, I will check it out.

I was able to get the grub.cfg working by going at the arch linux wiki multiboot section, there I found a grub.cfg menuentry and copy pasted changed few things and it worked with Manjaro :-).

Friends why does my computer freezes up when the grub from Debian tries to boot up Manjaro??

here is the entry from it:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Manjaro Linux (20.2) (on /dev/sdb4)' --class manjarolinux --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-632b2838-1c60-4573-b69a-ce7521c30599' {
	insmod part_gpt
	insmod ext2
	set root='hd1,gpt4'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt4 --hint-efi=hd1,gpt4 --hint-baremetal=ahci1,gpt4  632b2838-1c60-4573-b69a-ce7521c30599
	else
	  search --no-floppy --fs-uuid --set=root 632b2838-1c60-4573-b69a-ce7521c30599
	fi
	linux /boot/vmlinuz-5.10-x86_64 root=UUID=632b2838-1c60-4573-b69a-ce7521c30599 rw quiet udev.log_priority=3
	initrd /boot/intel-ucode.img
}

System:
  Kernel: 5.9.0-1-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.9.0-1-amd64 
  root=UUID=cc3c7915-c387-46b2-ba2f-b9683631655f ro 
  root=/dev/mapper/criptografado 
  cryptdevice=UUID=ad2fd291-9e68-4078-9b37-c4216373910a:criptografado quiet 
  Desktop: MATE 1.24.1 info: mate-panel wm: marco 1.24.1 dm: LightDM 1.26.0 
  Distro: Debian GNU/Linux bullseye/sid 
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B450M-GAMING/BR v: Rev X.0x 
  serial: <filter> UEFI: American Megatrends v: 2202 date: 07/14/2020 
CPU:
  Info: Quad Core model: AMD Ryzen 5 3400G with Radeon Vega Graphics 
  socket: AM4 bits: 64 type: MT MCP arch: Zen+ family: 17 (23) 
  model-id: 18 (24) stepping: 1 microcode: 8108109 L1 cache: 384 KiB 
  L2 cache: 2048 KiB L3 cache: 4000 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 65606 
  Speed: 1262 MHz min/max: 1400/4100 MHz base/boost: 4100/4200 boost: enabled 
  volts: 1.5 V ext-clock: 100 MHz Core speeds (MHz): 1: 1253 2: 1260 3: 1259 
  4: 1259 5: 1257 6: 1254 7: 1252 8: 1260 
  Vulnerabilities: Type: itlb_multihit status: Not affected 
  Type: l1tf status: Not affected 
  Type: mds status: Not affected 
  Type: meltdown status: Not affected 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: 
  disabled, RSB filling 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: AMD Picasso vendor: ASUSTeK driver: amdgpu v: kernel 
  bus ID: 08:00.0 chip ID: 1002:15d8 
  Display: server: X.Org 1.20.8 compositor: marco v: 1.24.1 driver: amdgpu,ati 
  unloaded: fbdev,modesetting,vesa display ID: :0.0 screens: 1 
  Screen-1: 0 s-res: 1280x1024 s-dpi: 96 s-size: 338x270mm (13.3x10.6") 
  s-diag: 433mm (17") 
  Monitor-1: DisplayPort-0 res: 1280x1024 hz: 60 dpi: 102 
  size: 320x240mm (12.6x9.4") diag: 400mm (15.7") 
  OpenGL: renderer: AMD Radeon Vega 11 Graphics (RAVEN DRM 3.39.0 
  5.9.0-1-amd64 LLVM 11.0.0) 
  v: 4.6 Mesa 20.2.2 direct render: Yes 
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: ASUSTeK 
  driver: snd_hda_intel v: kernel bus ID: 08:00.1 chip ID: 1002:15de 
  Device-2: AMD Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel 
  v: kernel bus ID: 08:00.6 chip ID: 1022:15e3 
  Sound Server: ALSA v: k5.9.0-1-amd64 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASUSTeK driver: r8169 v: kernel port: f000 bus ID: 07:00.0 
  chip ID: 10ec:8168 
  IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:
  Local Storage: total: 2.28 TiB used: 644.04 GiB (27.5%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/sda vendor: Seagate model: ST2000DM005-2CW102 size: 1.82 TiB 
  block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
  rotation: 5425 rpm serial: <filter> rev: 0001 temp: 33 C scheme: GPT 
  ID-2: /dev/sdb vendor: Western Digital model: WDS480G2G0B-00EPW0 
  size: 447.14 GiB block size: physical: 512 B logical: 512 B speed: 6.0 Gb/s 
  serial: <filter> rev: 0000 temp: 30 C scheme: GPT 
  ID-3: /dev/sdc type: USB vendor: Kingston model: DataTraveler 3.0 
  size: 28.82 GiB block size: physical: 512 B logical: 512 B serial: <filter> 
  scheme: GPT 
Partition:
  ID-1: / raw size: 39.06 GiB size: 38.20 GiB (97.79%) used: 10.44 GiB (27.3%) 
  fs: ext4 block size: 4096 B dev: /dev/dm-0 
Swap:
  Kernel: swappiness: 30 (default 60) cache pressure: 100 (default) 
  ID-1: swap-1 type: file size: 4.00 GiB used: 0 KiB (0.0%) priority: -2 
  file: /swap 
Sensors:
  System Temperatures: cpu: 41.5 C mobo: N/A gpu: amdgpu temp: 41.0 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 235 Uptime: 24m wakeups: 0 Memory: 6.79 GiB 
  used: 1.45 GiB (21.3%) Init: systemd v: 246 runlevel: 5 Compilers: gcc: N/A 
  Packages: apt: 1430 lib: 843 Shell: Bash (sudo) v: 5.1.0-rc2 
  running in: mate-terminal inxi: 3.1.09

That’s why, there is no kernel IMG specified. That line should be:

initrd  /boot/intel-ucode.img /boot/initramfs-5.10-x86_64.img

Manjaro has a custom grub, you can’t boot it after installing another OS. Either install other OSs first, or reinstall GRUB from Manjaro.

There are good tips searching the old forum:

https://archived.forum.manjaro.org/search?q=restore%20grub

thanks for the answer, let me try to explain better my situation I have debian in a luks encrypted partition, I want that to be the first option because I also have it setup so that I type the password once then I can mount root automatically without re-typing the same password.
So I want the Debian to be taking care of the bootloaders?

Sorry I really don’t know much of what I’m talking about, you think just adding that initramfs line it should work properly?
Then I just have to in Manjaro disable efibootmgr(how would I go about doing that?) ? and when I update the kernel or initram I have to go into debian and do a update-grub?

Thank you
Thanks a lot, really appreciate you guys work.