Installation – Dennis‘ Notebook

root@ubuntu:/home/ubuntu# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 2001,2002,2003
Boot0000* USB HDD: SanDisk PciRoot(0x0)/Pci(0x1d,0x0)/USB(0,0)/USB(1,0)/HD(2,GPT,1cf7d054-8db5-4194-971c-3c8665684807,0xb610ec,0x279c)RC
dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 1d / 03 05 06 00 00 00 / 03 05 06 00 01 00 / 04 01 2a 00 02 00 00 00 ec 10 b6 00 00 00 00 00 9c 27 00 00 00 00 00 00 54 d0 f7 1c b5 8d 94 41 97 1c 3c 86 65 68 48 07 02 02 / 7f ff 04 00
data: 52 43
Boot0001* Unknown Device: HD(1,GPT,9ba8a0d2-be69-488b-b3ca-d487cbf9091c,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 98 21 00 00 00 00 00 d2 a0 a8 9b 69 be 8b 48 b3 ca d4 87 cb f9 09 1c 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 75 00 62 00 75 00 6e 00 74 00 75 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
data: 52 43
Boot2001* EFI USB Device RC
dp: 7f ff 04 00
data: 52 43
Boot2002* EFI DVD/CDROM RC
dp: 7f ff 04 00
data: 52 43
Boot2003* EFI Network RC
dp: 7f ff 04 00
data: 52 43

root@ubuntu:/home/ubuntu# wipefs -a /dev/sda
/dev/sda: 8 bytes were erased at offset 0x3a38b2de00 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: calling ioctl to re-read partition table: Success

root@ubuntu:/home/ubuntu# parted /dev/sda mklabel gpt
Information: You may need to update /etc/fstab.

Während der Installation manuelle Partition vornehmen:

PartitionGrößeTypFormatierungFlags
/boot/efi1,3GFAT32jaesp, boot
/Restext4ja

Immer noch „No Bootable Device“ nach Neustart!

root@ubuntu:/home/ubuntu# lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
loop0 squashfs 4.0 0 100% /rofs
loop1 squashfs 4.0
loop2 squashfs 4.0
loop3 squashfs 4.0 0 100% /snap/bare/5
loop4 squashfs 4.0 0 100% /snap/core22/1380
loop5 squashfs 4.0 0 100% /snap/firefox/4173
loop6 squashfs 4.0 0 100% /snap/firmware-updater/127
loop7 squashfs 4.0 0 100% /snap/gnome-42-2204/176
loop8 squashfs 4.0 0 100% /snap/gtk-common-themes/1535
loop9 squashfs 4.0 0 100% /snap/snap-store/1124
loop10 squashfs 4.0 0 100% /snap/snapd/21465
loop11 squashfs 4.0 0 100% /snap/snapd-desktop-integration/157
loop12 squashfs 4.0 0 100% /snap/thunderbird/470
loop13 squashfs 4.0 0 100% /snap/ubuntu-desktop-bootstrap/171
sda
├─sda1 vfat FAT32 04F1-A0AE
└─sda2 ext4 1.0 67a7ed67-f52b-4146-8a4e-f5a681b80773
sdb iso9660 Joliet Exten Ubuntu 24.04 LTS amd64 2024-04-24-11-29-09-00
├─sdb1 iso9660 Joliet Exten Ubuntu 24.04 LTS amd64 2024-04-24-11-29-09-00 0 100% /cdrom
├─sdb2 vfat FAT12 ESP 37B6-BC6E
├─sdb3
└─sdb4 ext4 1.0 writable 42fc12fc-0d0d-48c8-b592-820c013df707 8.5G 0% /var/crash
/var/log

GRUB und Bootloader manuell reparieren

root@ubuntu:/home/ubuntu# mount /dev/sda2 /mnt
root@ubuntu:/home/ubuntu# mount /dev/sda1 /mnt/boot/efi
root@ubuntu:/home/ubuntu# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 786M 11M 776M 2% /run
efivarfs 100K 70K 26K 74% /sys/firmware/efi/efivars
/dev/sdb1 5.7G 5.7G 0 100% /cdrom
/cow 3.9G 244M 3.6G 7% /
/dev/disk/by-label/writable 9.0G 26M 8.5G 1% /var/log
tmpfs 3.9G 8.0K 3.9G 1% /dev/shm
tmpfs 5.0M 12K 5.0M 1% /run/lock
tmpfs 3.9G 500K 3.9G 1% /tmp
tmpfs 786M 160K 786M 1% /run/user/1000
/dev/sda2 228G 9.2G 207G 5% /mnt
/dev/sda1 1.1G 6.2M 1.1G 1% /mnt/boot/efi

for i in /dev /dev/pts /proc /sys /run; do mount –bind $i /mnt$i; done

chroot /mnt

root@ubuntu:/# grub-install –target=x86_64-efi –efi-directory=/boot/efi –bootloader-id=ubuntu
Installing for x86_64-efi platform.
grub-install: warning: EFI variables cannot be set on this system.
grub-install: warning: You will have to complete the GRUB setup manually.
Installation finished. No error reported.

root@ubuntu:/# update-grub
Sourcing file `/etc/default/grub‘
Generating grub configuration file …
Found linux image: /boot/vmlinuz-6.11.0-21-generic
Found initrd image: /boot/initrd.img-6.11.0-21-generic
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings …
done

chroot beenden: exit

root@ubuntu:/home/ubuntu# efibootmgr –create –disk /dev/sda –part 1 –label „ubuntu“ –loader /EFI/ubuntu/grubx64.efi
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,2001,2002,2003
Boot0001* USB HDD: SanDisk PciRoot(0x0)/Pci(0x1d,0x0)/USB(0,0)/USB(1,0)/HD(2,GPT,1cf7d054-8db5-4194-971c-3c8665684807,0xb610ec,0x279c)RC
Boot0002* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC
Boot0000* ubuntu HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\grubx64.efi)

Nach Neustart: Immer noch „No Bootable Device“!

root@ubuntu:/home/ubuntu# mount /dev/sda1 /mnt
root@ubuntu:/home/ubuntu# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 786M 11M 776M 2% /run
efivarfs 100K 84K 12K 88% /sys/firmware/efi/efivars
/dev/sdb1 5.7G 5.7G 0 100% /cdrom
/cow 3.9G 135M 3.8G 4% /
/dev/disk/by-label/writable 9.0G 27M 8.5G 1% /var/log
tmpfs 3.9G 8.0K 3.9G 1% /dev/shm
tmpfs 5.0M 12K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /tmp
tmpfs 786M 164K 786M 1% /run/user/1000
/dev/sda1 1.1G 6.2M 1.1G 1% /mnt

root@ubuntu:/home/ubuntu# ls -R /mnt
/mnt:
EFI

/mnt/EFI:
BOOT ubuntu

/mnt/EFI/BOOT:
BOOTX64.EFI fbx64.efi mmx64.efi

/mnt/EFI/ubuntu:
BOOTX64.CSV grub.cfg grubx64.efi mmx64.efi shimx64.efi

cp /mnt/EFI/ubuntu/grubx64.efi /mnt/EFI/BOOT/BOOTX64.EFI

Nach Neustart: Immer noch „No Bootable Device“!

BIOS:

Boot-Menü
Secure Boot: enabled
Security-Menü:
Select a UEFI file as trusted for executing: EFI/ubuntu/grubx64.efi

Nach Neustart: Immer noch „No Bootable Device“!

Live-System: efibootmgr -v

root@ubuntu:/home/ubuntu# efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 2001,2002,2003
Boot0000* USB HDD: SanDisk PciRoot(0x0)/Pci(0x1d,0x0)/USB(0,0)/USB(1,0)/HD(2,GPT,1cf7d054-8db5-4194-971c-3c8665684807,0xb610ec,0x279c)RC
dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 1d / 03 05 06 00 00 00 / 03 05 06 00 01 00 / 04 01 2a 00 02 00 00 00 ec 10 b6 00 00 00 00 00 9c 27 00 00 00 00 00 00 54 d0 f7 1c b5 8d 94 41 97 1c 3c 86 65 68 48 07 02 02 / 7f ff 04 00
data: 52 43
Boot0001* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 98 21 00 00 00 00 00 9e 8e e0 b7 00 ff 33 47 82 2d 6d 1c d8 e6 35 70 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 75 00 62 00 75 00 6e 00 74 00 75 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
data: 52 43
Boot0002* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 98 21 00 00 00 00 00 9e 8e e0 b7 00 ff 33 47 82 2d 6d 1c d8 e6 35 70 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 75 00 62 00 75 00 6e 00 74 00 75 00 5c 00 73 00 68 00 69 00 6d 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
data: 52 43
Boot2001* EFI USB Device RC
dp: 7f ff 04 00
data: 52 43
Boot2002* EFI DVD/CDROM RC
dp: 7f ff 04 00
data: 52 43
Boot2003* EFI Network RC
dp: 7f ff 04 00
data: 52 43

root@ubuntu:/home/ubuntu# efibootmgr –create –disk /dev/sda –part 1 –label „ubuntu“ –loader ‚\EFI\ubuntu\grubx64.efi‘
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0003,2001,2002,2003
Boot0000* USB HDD: SanDisk PciRoot(0x0)/Pci(0x1d,0x0)/USB(0,0)/USB(1,0)/HD(2,GPT,1cf7d054-8db5-4194-971c-3c8665684807,0xb610ec,0x279c)RC
Boot0001* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
Boot0002* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC
Boot0003* ubuntu HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\grubx64.efi)

Nach Neustart: Immer noch „No Bootable Device“!

Live-System:
mount /dev/sda1 /mnt
cp /mnt/EFI/ubuntu/grubx64.efi /mnt/EFI/Boot/bootx64.efi

root@ubuntu:/home/ubuntu# efibootmgr
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 2001,2002,2003
Boot0001* USB HDD: SanDisk PciRoot(0x0)/Pci(0x1d,0x0)/USB(0,0)/USB(1,0)/HD(2,GPT,1cf7d054-8db5-4194-971c-3c8665684807,0xb610ec,0x279c)RC
Boot0002* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
Boot0003* ubuntu HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\grubx64.efi)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC

root@ubuntu:/home/ubuntu# efibootmgr -b 0001 -B
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 2001,2002,2003
Boot0002* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
Boot0003* ubuntu HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\grubx64.efi)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC
root@ubuntu:/home/ubuntu# efibootmgr -b 0003 -B
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 2001,2002,2003
Boot0002* Unknown Device: HD(1,GPT,b7e08e9e-ff00-4733-822d-6d1cd8e63570,0x800,0x219800)/File(\EFI\ubuntu\shimx64.efi) File(.䍒)
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC
root@ubuntu:/home/ubuntu# efibootmgr -b 0002 -B
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 2001,2002,2003
Boot2001* EFI USB Device RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network RC

Nach Neustart: Immer noch „No Bootable Device“!

mkdir -p /mnt/efi
mount /dev/sda1 /mnt/efi
mkdir -p /mnt/efi/EFI/Microsoft/Boot
cp /mnt/efi/EFI/ubuntu/grubx64.efi /mnt/efi/EFI/Microsoft/Boot/bootmgfw.efi
cp /mnt/efi/EFI/ubuntu/grubx64.efi /mnt/efi/EFI/Boot/bootx64.efi

Ganau das wars: Ubuntu startet!


Backup der GRUB-Bootloader-Datei (bootmgfw.efi)

Falls beim Kernel-Update bootmgfw.efi überschrieben wird, sichern.

mkdir -p /boot/efi/EFI/Backup

cp /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/Backup/bootmgfw_GRUB_backup.efi

GRUB nach Ubuntu-Update sichern (vorsichtshalber)

Bei Ubuntu-Kernel-Updates wird GRUB oft neu generiert, aber die Datei grubx64.efi bleibt unverändert. Trotzdem gut, sie regelmäßig zu sichern:

cp /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/Backup/grubx64_backup.efi

Skript: GRUB automatisch als bootmgfw.efi kopieren

Nach einem Update sicherstellen, dass GRUB immer im „Microsoft-Versteck“ landet (Bsp.: /usr/local/sbin/fix-grub-acer.sh):

#!/bin/bash

set -e

EFI_SRC="/boot/efi/EFI/ubuntu/grubx64.efi"
EFI_DST="/boot/efi/EFI/Microsoft/Boot/bootmgfw.efi"
BACKUP_DIR="/boot/efi/EFI/Backup"

echo "==> Sicherung bestehender bootmgfw.efi..."
mkdir -p "$BACKUP_DIR"
cp "$EFI_DST" "$BACKUP_DIR/bootmgfw_$(date +%F-%H%M%S).efi" || echo "Kein Original vorhanden."

echo "==> Kopiere GRUB (grubx64.efi) nach Microsoft/Boot..."
cp "$EFI_SRC" "$EFI_DST"
echo "GRUB erfolgreich kopiert als Windows-Bootloader."

Berechtigungen setzen:

chmod +x /usr/local/bin/fix-grub-acer.sh

Hook-Skript in /etc/kernel/postinst.d/ anlegen

nano /etc/kernel/postinst.d/zz-fix-grub-acer
#!/bin/bash
# Hook: Kopiert GRUB nach Microsoft-Verzeichnis bei Kernel-Updates

/usr/local/sbin/fix-grub-acer.sh
chmod +x /etc/kernel/postinst.d/zz-fix-grub-acer