[UEFI] unable to reinstall grub from chroot

They thank you for your donated blood today. Please come back soon.

1 Like

Looking for new donors. Is your name on the list? :drop_of_blood:

Na man. I can smell blood a mile away.

Perhaps you can use the wording “mosquito” :mosquito: when you see one :joy:

Things didn’t go well. Today i boot and it goes straight to windows…
I really don’t understand it. I didn’t have this problem on previous machine. I did everything like i did before. Now i watched 20 tutorials and i do the same thing.
Here is my bios:
IMG_20221001_082621
IMG_20221001_082629
IMG_20221001_082638

From system info:
Screenshot 2022-10-01 063608

so i used arch-chroot instead of chroot and grub-install worked…

can you report

inxi -Fza 
test -d /sys/firmware/efi && echo efi || echo bios
sudo parted -l
sudo efibootmgr -v

I’ve had partially similar problems with Windows updates on my laptop, after the update it booted directly to Windows. The update messed with the boot entries.

The fix was quite simple. With the USB installer stick I arch-chrooted to EndeavourOS install. Then

  • I executed programs grub-install and grub-mkconfig with proper parameters for my system.
  • Changed the boot order back from BIOS/Firmware.

I assume the boot order of your system in under the OS Boot Manager entry in BIOS.

Hope this helps. Details may be somewhat different on your system though.

EDIT: the big question remains: UEFI or legacy BIOS, on many levels.

Are

  • Windows
  • EndeavourOS

installed in UEFI or legacy BIOS mode?
And what mode is supported by your hardware?

1 Like

I do notice your UEFI Bios version is F.18 dated 2021. You have a newer HP laptop with 5700U processor. I am 100% sure there are updated versions of the UEFI Firmware (Bios) but i can’t look it up as i need the exact model and sometimes serial number in order to access that info on the HP site. I would suggest while booted in Windows you go to the HP site and find the latest update.

I am also interested in knowing exactly how you installed EndeavourOS on the drive with Windows. I have a number of dual boot Windows EndeavourOS and i don’t seem to run into this issue. It would be helpful if you can post the commands that @Stephane asked above.

This is how you acquire knowledge the hard way :wink:

Use instructions for the tool you are using. If you had read Archwiki, you would have known before it happens :wink:

If you are running a UEFI system you will also need access to EFI variables. Otherwise, when installing GRUB you will receive a message similar to: UEFI variables not supported on this machine:

# mount --rbind /sys/firmware/efi/efivars sys/firmware/efi/efivars/

The other solution is to use assistant utilities, like archroot in this case.

1 Like

Ooo, yeah will check for Bios update. Regarding my installation steps:

  1. Disabled Secure boot and hibernation.
  2. Partitioned disk.
  3. Booted endvos pendrive
  4. Installation started
  5. Picked manual disk assignment.
  6. Edited partition FAT32 partition, picked KEEP option and mount point: /boot/efi
  7. Created new root, home and swap partition.
  8. Continued installation

Right now to repair boot after windows breaks it i do:

  1. Mount / to /mnt
  2. Mount ESP to /mnt/boot/efi
  3. arch-chroot
    4.grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
    5.grub-mkconfig -o /boot/grub/grub.cfg

inxi -Fza:

System:
  Kernel: 5.19.12-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-linux
    root=UUID=10fa7641-98c2-401b-add5-15c9d0fdbfed rw loglevel=3 nowatchdog
    nvme_load=YES
  Desktop: Xfce v: 4.16.1 tk: Gtk v: 3.24.34 info: xfce4-panel wm: xfwm
    v: 4.16.1 vt: 7 dm: LightDM v: 1.32.0 Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP Laptop 15s-eq2xxx v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: HP model: 887A v: 59.11 serial: <superuser required> UEFI: AMI
    v: F.18 date: 11/26/2021
Battery:
  ID-1: BAT0 charge: 40.6 Wh (99.8%) condition: 40.7/40.7 Wh (100.0%)
    volts: 12.8 min: 11.3 model: HP Primary type: Li-ion serial: <filter>
    status: not charging
CPU:
  Info: model: AMD Ryzen 7 5700U with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 2 gen: 3 level: v3 built: 2020-22 process: TSMC n7 (7nm)
    family: 0x17 (23) model-id: 0x68 (104) stepping: 1 microcode: 0x8608103
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 8 MiB desc: 2x4 MiB
  Speed (MHz): avg: 1454 high: 1800 min/max: 1400/4370 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1800 2: 1400
    3: 1400 4: 1400 5: 1400 6: 1397 7: 1400 8: 1400 9: 1400 10: 1400 11: 1469
    12: 1400 13: 1400 14: 1800 15: 1400 16: 1400 bogomips: 57515
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT enabled with STIBP
    protection
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP:
    always-on, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Lucienne vendor: Hewlett-Packard driver: amdgpu v: kernel
    arch: GCN-5.1 code: Vega-2 process: TSMC n7 (7nm) built: 2018-21 pcie:
    gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s ports:
    active: eDP-1 empty: HDMI-A-1 bus-ID: 03:00.0 chip-ID: 1002:164c
    class-ID: 0300
  Device-2: Quanta HP TrueVision HD Camera type: USB driver: uvcvideo
    bus-ID: 1-3:2 chip-ID: 0408:5365 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.4 compositor: xfwm v: 4.16.1 driver:
    X: loaded: amdgpu unloaded: modesetting alternate: fbdev,vesa gpu: amdgpu
    display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 mapped: eDP model: ChiMei InnoLux 0x1538 built: 2020
    res: 1920x1080 hz: 60 dpi: 142 gamma: 1.2 size: 344x193mm (13.54x7.6")
    diag: 394mm (15.5") ratio: 16:9 modes: max: 1920x1080 min: 640x480
  OpenGL: renderer: AMD RENOIR (LLVM 14.0.6 DRM 3.47 5.19.12-arch1-1) v: 4.6
    Mesa 22.1.7 direct render: Yes
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 03:00.1 chip-ID: 1002:1637
    class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Hewlett-Packard
    driver: snd_rn_pci_acp3x v: kernel
    alternate: snd_pci_acp3x,snd_pci_acp5x,snd_pci_acp6x,snd_acp_pci,snd_sof_amd_renoir
    pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s
    bus-ID: 03:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 03:00.6 chip-ID: 1022:15e3
    class-ID: 0403
  Sound Server-1: ALSA v: k5.19.12-arch1-1 running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.58 running: yes
Network:
  Device-1: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter
    vendor: Hewlett-Packard driver: rtw_8822ce v: N/A modules: rtw88_8822ce
    pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 01:00.0
    chip-ID: 10ec:c822 class-ID: 0280
  IF: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth Radio type: USB driver: btusb v: 0.8
    bus-ID: 1-4:3 chip-ID: 0bda:b00c class-ID: e001 serial: <filter>
  Report: bt-adapter note: tool can't run ID: hci0 rfk-id: 0 state: down
    bt-service: disabled rfk-block: hardware: no software: yes address: N/A
Drives:
  Local Storage: total: 931.51 GiB used: 6.57 GiB (0.7%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 980 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B
    speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: 2B4QFXO7
    temp: 31.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 175 GiB size: 171.2 GiB (97.83%) used: 5.57 GiB (3.3%)
    fs: ext4 dev: /dev/nvme0n1p5 maj-min: 259:5
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%) used: 65.5 MiB
    (25.6%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 317 GiB size: 310.96 GiB (98.09%) used: 959 MiB
    (0.3%) fs: ext4 dev: /dev/nvme0n1p7 maj-min: 259:7
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 48.9 C mobo: N/A gpu: amdgpu temp: 41.0 C
  Fan Speeds (RPM): fan-1: 0 fan-2: 0
Info:
  Processes: 304 Uptime: 9m wakeups: 483 Memory: 14.96 GiB used: 2.53 GiB
  (16.9%) Init: systemd v: 251 default: graphical tool: systemctl
  Compilers: gcc: 12.2.0 Packages: pm: pacman pkgs: 822 libs: 213 tools: yay
  Shell: Bash v: 5.1.16 running-in: xfce4-terminal inxi: 3.3.21

test -d /sys/firmware/efi && echo efi || echo bios:

efi

sudo parted -l:

Model: Samsung SSD 980 1TB (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Warning: failed to translate partition name
Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  274MB   273MB   fat32        EFI system partition          boot, esp
 2      274MB   408MB   134MB                Microsoft reserved partition  msftres
 3      408MB   462GB   462GB   ntfs         Basic data partition          msftdata
 5      462GB   650GB   188GB   ext4
 6      650GB   659GB   8590MB  ext4
 7      659GB   999GB   340GB   ext4
 4      999GB   1000GB  1028MB  ntfs                                       hidden, diag

sudo efibootmgr -v:

BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,9999
Boot0003* GRUB	HD(1,GPT,678c8e72-41e4-4627-ab3a-ec851a44545b,0x800,0x82000)/File(\EFI\GRUB\grubx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 20 08 00 00 00 00 00 72 8e 8c 67 e4 41 27 46 ab 3a ec 85 1a 44 54 5b 02 02 / 04 04 30 00 5c 00 45 00 46 00 49 00 5c 00 47 00 52 00 55 00 42 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot9999* USB Drive (UEFI)	PciRoot(0x0)/Pci(0x1d,0x0)/USB(16,0)0000424f
      dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 1d / 03 05 06 00 10 00 / 7f ff 04 00
    data: 00 00 42 4f

Windows keeps overwriting bootloader but at least im able to repair it with grub-install now.

1 Like

Usually, you don’t need to re-install grub. You should try setting the boot order, if an entry exists for EnOS. If there is no entry, create one. The files/folders should exist on ESP partition.

Please, confirm this can be a solution, as there is an unneeded panic for this. Re-installing grub (if it is not required) is different from creating a UEFI entry without chroot.

Can’t set it if it shows only one thing - it’s either Windows or Grub. I have no idea how to create entry.
photo_2022-10-01_20-37-28

I don’t know what you mean.
Let me use different description (I am no native English).

If the topic issue happens again, then

  • Boot to an EnOS Live ISO, in UEFI mode
  • Start a terminal and run
efibootmgr -v
  • If there is an entry labeled Grub, or EnOS, you can set that one as first in order, using efibootbgr -o <order,list>
  • If there is only WinOS, you can create a new entry, using efibootmgr <parameters>, which normally is set first in order.

That’s a first for me :face_with_head_bandage: .
You should check for an updated BIOS, and/or report to the Vendor. It’s a terrible UEFI implementation.

Archwiki to the rescue. It has every possible example for this.

see this one

  1. check before that /boot/efi is mounted
  2. do ls /boot/efi/EFI/* for find name Endevouros

under chroot , it should be

efibootmgr --verbose --create --disk=/dev/nvme0n1 --part=1 --label=“Endevouros” --loader="\EFI\Endevouros\grubx64.efi"
1 Like

@Esgath
Hopefully you update the Bios first since you are booting in Windows. Then use arch-chroot and fix the problem as have been instructed.

Edit: As i posted earlier make sure that secure boot is disabled and also CSM. On Windows fast start up feature should be turned off in power management.

1 Like