| Summary: | impossibility to convert a legacy mageia7 to UEFI | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | peter lawford <petlaw726> |
| Component: | Installer | Assignee: | Mageia Bug Squad <bugsquad> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | davidwhodgins, mageia |
| Version: | 7 | ||
| Target Milestone: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | CVE: | ||
| Status comment: | |||
|
Description
peter lawford
2020-07-22 19:21:07 CEST
Installing Mageia on a uefi system requires that the installer has been booted in uefi mode. It may be possible to change it after the fact (I've never tried) by booting a live iso in uefi firmware mode, then grub2-efi in the target install. I don't know if it's better to use chroot or systemd-nspawn for this. Boot a live iso in uefi mode, and mount the root partition and then chroot or systemd-spawn into it. For chroot ... #!/bin/bash MountPoint=/targetroot # mkdir -p $MountPoint for dir in dev proc run sys ; do mount --bind /$dir $MountPoint/$dir ; done chroot $MountPoint #killall ssh-agent for dir in dev proc run sys ; do umount $MountPoint/$dir ; done For systemd-nspawn, instead of the for/chroot lines ... systemd-nspawn -D /target Mount the ESP on /boot/EFI in the target system, and then install grub2-efi or refind. May be able to use mcc to select re-install boot loader. Please report back here if it succeeds or not. CC:
(none) =>
davidwhodgins (In reply to Dave Hodgins from comment #1) > Installing Mageia on a uefi system requires that the installer has been > booted in uefi mode. > > It may be possible to change it after the fact (I've never tried) by > booting a live iso in uefi firmware mode, then grub2-efi in the target > install. > > I don't know if it's better to use chroot or systemd-nspawn for this. > > Boot a live iso in uefi mode, and mount the root partition and then > chroot or systemd-spawn into it. > > For chroot ... > #!/bin/bash > MountPoint=/targetroot > # mkdir -p $MountPoint > > for dir in dev proc run sys ; do mount --bind /$dir $MountPoint/$dir ; done > chroot $MountPoint > #killall ssh-agent > for dir in dev proc run sys ; do umount $MountPoint/$dir ; done > > For systemd-nspawn, instead of the for/chroot lines ... > systemd-nspawn -D /target > > > Mount the ESP on /boot/EFI in the target system, and then install grub2-efi > or refind. May be able to use mcc to select re-install boot loader. > > Please report back here if it succeeds or not. OK, I'll let you inform (In reply to peter lawford from comment #2) > (In reply to Dave Hodgins from comment #1) > > Installing Mageia on a uefi system requires that the installer has been > > booted in uefi mode. > > > > It may be possible to change it after the fact (I've never tried) by > > booting a live iso in uefi firmware mode, then grub2-efi in the target > > install. > > > > I don't know if it's better to use chroot or systemd-nspawn for this. > > > > Boot a live iso in uefi mode, and mount the root partition and then > > chroot or systemd-spawn into it. > > > > For chroot ... > > #!/bin/bash > > MountPoint=/targetroot > > # mkdir -p $MountPoint > > > > for dir in dev proc run sys ; do mount --bind /$dir $MountPoint/$dir ; done > > chroot $MountPoint > > #killall ssh-agent > > for dir in dev proc run sys ; do umount $MountPoint/$dir ; done > > > > For systemd-nspawn, instead of the for/chroot lines ... > > systemd-nspawn -D /target > > > > > > Mount the ESP on /boot/EFI in the target system, and then install grub2-efi > > or refind. May be able to use mcc to select re-install boot loader. > > > > Please report back here if it succeeds or not. > > OK, I'll let you inform question: for chroot, why to run #killall ssh-agent? (In reply to Dave Hodgins from comment #1) > Installing Mageia on a uefi system requires that the installer has been > booted in uefi mode. > > It may be possible to change it after the fact (I've never tried) by > booting a live iso in uefi firmware mode, then grub2-efi in the target > install. > > I don't know if it's better to use chroot or systemd-nspawn for this. > > Boot a live iso in uefi mode, and mount the root partition and then > chroot or systemd-spawn into it. > > For chroot ... > #!/bin/bash > MountPoint=/targetroot > # mkdir -p $MountPoint > > for dir in dev proc run sys ; do mount --bind /$dir $MountPoint/$dir ; done > chroot $MountPoint > #killall ssh-agent > for dir in dev proc run sys ; do umount $MountPoint/$dir ; done > > For systemd-nspawn, instead of the for/chroot lines ... > systemd-nspawn -D /target > > > Mount the ESP on /boot/EFI in the target system, and then install grub2-efi > or refind. May be able to use mcc to select re-install boot loader. > > Please report back here if it succeeds or not. please tell me if I have well understood what you mean: I am used tu use chroot. first, in the BIOS, I set CSM > Enabled > UEFI only and boot on the medialive (USB key) after that: I'll do the following sequence of commands: for dir in dev proc run sys ; do mount --bind /$dir $MountPoint/$dir ; done chroot $MountPoint #here /dev/sda2 is the ESP mkdir -p /boot/EFI mount /dev/sda2 /boot/EFI mkdir -p /boot/EFI/EFI/mageia grub2-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=mageia umount /dev/sda2 exit for dir in dev proc run sys ; do umount $MountPoint/$dir ; done umount $MountPoint I reboot and remove the medialive have I well understood? thank you for replying (In reply to peter lawford from comment #3) > question: for chroot, why to run #killall ssh-agent? It's commented out. In my system, as I have ssh keys setup ssh-agent is auto started at login. Unlike most things, it normally continues running after logout. Stopping it is needed before the file systems used in the chroot can be unmounted. (In reply to peter lawford from comment #4) > please tell me if I have well understood what you mean: I am used tu use > chroot. > first, in the BIOS, I set CSM > Enabled > UEFI only and boot on the > medialive (USB key) > after that: The exact entries shown by the uefi firmware varies depending on the manufacturer and version. When enabled, CSM mode is used to emulate bios firmware mode. It must be disabled to boot in uefi firmware mode. > I'll do the following sequence of commands: > for dir in dev proc run sys ; do mount --bind /$dir $MountPoint/$dir ; done > chroot $MountPoint > #here /dev/sda2 is the ESP > mkdir -p /boot/EFI > mount /dev/sda2 /boot/EFI > mkdir -p /boot/EFI/EFI/mageia > grub2-install --target=x86_64-efi --efi-directory=/boot/EFI > --bootloader-id=mageia > umount /dev/sda2 > exit > for dir in dev proc run sys ; do umount $MountPoint/$dir ; done > umount $MountPoint > > I reboot and remove the medialive > > have I well understood? thank you for replying I think so. Again, I've never actually tried it. For those not comfortable with the command line, there is an easier way. 1. With the Mageia system booted in legacy mode, in the MCC, got to Local disks / Manage disk partitions. Click on your existing EFI system partition (ESP) on the HDD, and set the mount point to /boot/EFI. Answer yes when asked if you want to save /etc/fstab. 2. Boot the classical installer ISO in UEFI mode, and choose the option to upgrade your system. That should quickly run through to the summary screen, where you can select the bootloader and check that it is configured correctly. Finish the upgrade, and your system should now be bootable in EFI mode. CC:
(none) =>
mageia (In reply to Dave Hodgins from comment #6) > (In reply to peter lawford from comment #4) > > please tell me if I have well understood what you mean: I am used tu use > > chroot. > > first, in the BIOS, I set CSM > Enabled > UEFI only and boot on the > > medialive (USB key) > > after that: > > The exact entries shown by the uefi firmware varies depending on the > manufacturer and version. When enabled, CSM mode is used to emulate bios > firmware mode. It must be disabled to boot in uefi firmware mode. > > > I'll do the following sequence of commands: > > for dir in dev proc run sys ; do mount --bind /$dir $MountPoint/$dir ; done > > chroot $MountPoint > > #here /dev/sda2 is the ESP > > mkdir -p /boot/EFI > > mount /dev/sda2 /boot/EFI > > mkdir -p /boot/EFI/EFI/mageia > > grub2-install --target=x86_64-efi --efi-directory=/boot/EFI > > --bootloader-id=mageia > > umount /dev/sda2 > > exit > > for dir in dev proc run sys ; do umount $MountPoint/$dir ; done > > umount $MountPoint > > > > I reboot and remove the medialive > > > > have I well understood? thank you for replying > > I think so. Again, I've never actually tried it. question: what fs use to format the ESP? vfat? ext4? Hallo world the problem is now solved: 1-I couldn't boot the system in UEFI mode using the command line method; but I've forced the installer media mageia7.1 iso to boot in uefi by seeting the csm to disabled; after that, I've updated the system with the installer, and now it can boot without problem in uefi mode; in this case /sys/firmware contains the efi directory. but there is better: if I set the csm to enabled>legacy OPROM, the system boots in legacy mode, but the efi directory vanishes in /sys/firmware Setting once more the csm to disabled, I can boot in uefi mode, and the efi directory reappears in /sys/firmware it means that I can boot in legacy or uefi mode as I want, following that the csm is disabled or enabled. I think it is due to the fact that on my disk sda1 is a bios boot partition and sda2 an ESP; that proves that the two modes of booting can cohabit on the same disk Thanks for the update. Closing the bug as invalid, since this is not a bug, but a request for information. In future, please use either the forums or the discuss mailing list for such requests. Regarding how to format the esp ... # blkid /dev/sda1 /dev/sda1: LABEL_FATBOOT="efi" LABEL="efi" UUID="3DAB-4B6E" TYPE="vfat" As I'm using a dos style mbr partition table format, I don't have or need a bios boot partition since the mbr holds the bootloader. Resolution:
(none) =>
INVALID (In reply to Dave Hodgins from comment #10) > Thanks for the update. Closing the bug as invalid, since this is not a bug, > but a request for information. In future, please use either the forums or > the discuss mailing list for such requests. > > Regarding how to format the esp ... > # blkid /dev/sda1 > /dev/sda1: LABEL_FATBOOT="efi" LABEL="efi" UUID="3DAB-4B6E" TYPE="vfat" > > As I'm using a dos style mbr partition table format, I don't have or need > a bios boot partition since the mbr holds the bootloader. sorry, but I was convinced it was a bug, since I exactly follow the instructions (in french) given in https://wiki.mageia.org/en/Grub2-efi_et_Mageia-fr, and that unsuccessfully That page discusses using Mageia on a uefi system, where the installer is booted in uefi mode. It does not discuss converting a bios firmware mode install to an uefi firmware mode install. While it apparently does work, it's not officially been supported. I've added vfat in the description of the esp partition on the wiki, but as the installer takes care of creating/formatting the partition if it doesn't already exist, that's not a bug. |