• EFI directory problem

    From Grimble@2:250/1 to All on Tue Jul 27 17:19:33 2021
    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition 16MiB Flags msftres
    /dev/sda2: Basic data partition ntfs 200MiB Flags msftdata
    /dev/sda3: / Mageia 8 50GiB
    ...... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition fat32 BOOT 500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition ntfs Windows 460MiB
    ........
    Trying to re-install grub2 boot loader with Mageia Rescue but it reports
    that it cannot find EFI directory.
    Am I correct in thinking that if grub2-install could find /dev/sdb1, the
    boot loader could be installed?
    If so, how do I arrange that?
    I don't want to re-install Mageia 8 from scratch, because I have done a
    lot of personalisation.
    Thanks.
    (PS they didn't bork it - this problem arose because of previous
    problems with the Windows installation)
    --
    Grimble
    Registered Linux User #450547
    Machine 'Bach' running Plasma 5.20.4 on 5.10.52-desktop-1.mga8 kernel.
    Mageia release 8 (Official) for x86_64

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Tue Jul 27 20:34:29 2021
    On Tue, 27 Jul 2021 12:19:33 -0400, Grimble <grimble@nomail.afraid.org> wrote:

    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition 16MiB Flags msftres /dev/sda2: Basic data partition ntfs 200MiB Flags msftdata
    /dev/sda3: / Mageia 8 50GiB
    ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition fat32 BOOT 500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition ntfs Windows 460MiB
    .......
    Trying to re-install grub2 boot loader with Mageia Rescue but it reports
    that it cannot find EFI directory.
    Am I correct in thinking that if grub2-install could find /dev/sdb1, the
    boot loader could be installed?
    If so, how do I arrange that?
    I don't want to re-install Mageia 8 from scratch, because I have done a
    lot of personalisation.
    Thanks.
    (PS they didn't bork it - this problem arose because of previous
    problems with the Windows installation)

    On any efi system, I strongly recommend installing refind using "mcc/Boot/
    Set up boot system" to switch the Bootloader to use from grub2 to refind.
    It's much simpler to use and configure. It dynamically finds the bootable installs (linux and m$), and available kernels.

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Tue Jul 27 21:54:13 2021
    On Tue, 27 Jul 2021 17:19:33 +0100, Grimble wrote:
    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition 16MiB Flags msftres
    /dev/sda2: Basic data partition ntfs 200MiB Flags msftdata
    /dev/sda3: / Mageia 8 50GiB
    ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition fat32 BOOT 500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition ntfs Windows 460MiB
    .......
    Trying to re-install grub2 boot loader with Mageia Rescue but it reports
    that it cannot find EFI directory.
    Am I correct in thinking that if grub2-install could find /dev/sdb1, the
    boot loader could be installed?
    If so, how do I arrange that?
    I don't want to re-install Mageia 8 from scratch, because I have done a
    lot of personalisation.
    Thanks.
    (PS they didn't bork it - this problem arose because of previous
    problems with the Windows installation)

    I do not do Windows or efi boot. But as I misunderstand it grub looks
    for code of EF02 (non efi) or EF00 (efi) to decide what to do.
    Your "Flags msftres" has confused grub.
    Would not hurt to open a grub bug report to get it fixed.


    To see partition code example
    # gdisk -l /dev/sda
    Number Start (sector) End (sector) Size Code Name
    <snipped>
    10 1471924224 1471926271 1024.0 KiB EF02 bios_grub


    I downloaded systemrescue from https://www.system-rescue.org/
    and use gparted to set the flag Code EF02.

    Download page has instructions for burning iso to usb drive.
    741M systemrescue-8.04-amd64.iso

    --
    The warranty and liability expired as you read this message.
    If the above breaks your system, it's yours and you keep both pieces.
    Practice safe computing. Backup the file before you change it.
    Do a, man command_here or cat command_here, before using it.

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Grimble@2:250/1 to All on Wed Jul 28 10:41:27 2021
    On 27/07/2021 21:54, Bit Twister wrote:
    On Tue, 27 Jul 2021 17:19:33 +0100, Grimble wrote:
    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition 16MiB Flags msftres
    /dev/sda2: Basic data partition ntfs 200MiB Flags msftdata
    /dev/sda3: / Mageia 8 50GiB
    ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition fat32 BOOT 500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition ntfs Windows 460MiB
    .......
    Trying to re-install grub2 boot loader with Mageia Rescue but it reports
    that it cannot find EFI directory.
    Am I correct in thinking that if grub2-install could find /dev/sdb1, the
    boot loader could be installed?
    If so, how do I arrange that?
    I don't want to re-install Mageia 8 from scratch, because I have done a
    lot of personalisation.
    Thanks.
    (PS they didn't bork it - this problem arose because of previous
    problems with the Windows installation)

    I do not do Windows or efi boot. But as I misunderstand it grub looks
    for code of EF02 (non efi) or EF00 (efi) to decide what to do.
    Your "Flags msftres" has confused grub.
    Would not hurt to open a grub bug report to get it fixed.


    To see partition code example
    # gdisk -l /dev/sda
    Number Start (sector) End (sector) Size Code Name
    <snipped>
    10 1471924224 1471926271 1024.0 KiB EF02 bios_grub


    I downloaded systemrescue from https://www.system-rescue.org/
    and use gparted to set the flag Code EF02.

    Download page has instructions for burning iso to usb drive.
    741M systemrescue-8.04-amd64.iso

    --
    The warranty and liability expired as you read this message.
    If the above breaks your system, it's yours and you keep both pieces. Practice safe computing. Backup the file before you change it.
    Do a, man command_here or cat command_here, before using it.

    Thank Bit. I have system rescue already, so your suggestion should be
    easy to implement.
    G

    --
    Grimble
    Registered Linux User #450547
    Machine 'Bach' running Plasma 5.20.4 on 5.10.52-desktop-1.mga8 kernel.
    Mageia release 8 (Official) for x86_64

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Grimble@2:250/1 to All on Wed Jul 28 16:21:36 2021
    On 27/07/2021 21:54, Bit Twister wrote:
    On Tue, 27 Jul 2021 17:19:33 +0100, Grimble wrote:
    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition 16MiB Flags msftres
    /dev/sda2: Basic data partition ntfs 200MiB Flags msftdata
    /dev/sda3: / Mageia 8 50GiB
    ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition fat32 BOOT 500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition ntfs Windows 460MiB

    < snip >

    I do not do Windows or efi boot. But as I misunderstand it grub looks
    for code of EF02 (non efi) or EF00 (efi) to decide what to do.
    Your "Flags msftres" has confused grub.
    Would not hurt to open a grub bug report to get it fixed.


    To see partition code example
    # gdisk -l /dev/sda
    Number Start (sector) End (sector) Size Code Name
    <snipped>
    10 1471924224 1471926271 1024.0 KiB EF02 bios_grub


    Things I have found:
    1. /dev/sdb1 has the flags boot and esp, which Linux.org tells me
    "This flag indicates an UEFI System Partition. GPT uses this flag as an
    alias for "boot". The UEFI firmware stores files on this partition"
    2. gdisk shows this partition with code "EF00", so it should have been
    found.
    3. Using system rescue 8.01, downloaded a couple of months ago, seems to
    have no means of setting the code, although gdisk has that function.
    4. Presumably there should be only one partition where grub2 is installed.
    5. I used a system rescue option to boot into Mageia 8. Can I now safely execute
    grub2-install /dev/sdb
    to fix the problem?


    --
    Grimble
    Registered Linux User #450547
    Machine 'Bach' running Plasma 5.20.4 on 5.10.52-desktop-1.mga8 kernel.
    Mageia release 8 (Official) for x86_64

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Jim@2:250/1 to All on Wed Jul 28 16:49:40 2021
    On Tue, 27 Jul 2021 17:19:33 +0100, Grimble wrote:

    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition 16MiB Flags msftres /
    dev/sda2:
    Basic data partition ntfs 200MiB Flags msftdata /dev/sda3: /
    Mageia
    8
    50GiB ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition fat32 BOOT 500MiB /dev/sdb2:
    Microsoft
    eserved partition /dev/sdb3: Basic data partition ntfs Windows
    460MiB
    .......
    Trying to re-install grub2 boot loader with Mageia Rescue but it reports
    that it cannot find EFI directory.

    I have cobbled together workable EFI/uefi/grub2 on two of my systems.
    I won't tell you what I have is right, because the options I get when
    booting on what to boot are strange, but it does work.

    There must be an EFI system partition somewhere on the system. That
    partition must be named or labeled EFI, and must have a top directory
    named EFI. Under that, there are subdirectory trees for each
    operating system or boot sequence.

    My machine that is Mageia only has subdirectory trees BOOT and mageia.

    My laptop that has mageia and Microsloth 10 has BOOT, HP, mageia,
    and Microsoft. The laptop is an hp, and if I turn it on and
    simply do what it does by default, the HP software will boot it
    into Win10.

    If I tap repeatedly on F9, I get a set of choices: OS boot loader
    which is default hp boot into Microsloth, Boot From EFI File which
    allows a set of choices eventually leading to Mageia or MS, mageia
    which allows choice of Mageia or Win10 boot manager, and Local Disk
    which again a set of choices.

    That said, you have to have the EFI system partition, correctly
    labeled as such and known as EFI by name or label.

    If Mageia Rescue cannot find EFI directory, you probably need to
    create a symbolic link in boot (as root, of course)
    ln -s /boot/efi /boot/EFI and then create /boot/EFI/EFI.

    That done you must mount your EFI system partition on /boot/EFI/EFI.

    Then, grub2-install should find the EFI directory.

    Do note that if your system root is the usb or cd, you will probably
    need to mount your mageia partition on /mnt or chroot and make the
    changes under boot there for that to persist.

    Cheers!

    jim b.




    --
    UNIX is not user-unfriendly, it merely
    expects users to be computer friendly.

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Wed Jul 28 21:23:04 2021
    On Wed, 28 Jul 2021 16:21:36 +0100, Grimble wrote:
    On 27/07/2021 21:54, Bit Twister wrote:
    On Tue, 27 Jul 2021 17:19:33 +0100, Grimble wrote:
    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition 16MiB Flags msftres
    /dev/sda2: Basic data partition ntfs 200MiB Flags msftdata
    /dev/sda3: / Mageia 8 50GiB
    ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition fat32 BOOT 500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition ntfs Windows 460MiB

    < snip >

    I do not do Windows or efi boot. But as I misunderstand it grub looks
    for code of EF02 (non efi) or EF00 (efi) to decide what to do.
    Your "Flags msftres" has confused grub.
    Would not hurt to open a grub bug report to get it fixed.


    To see partition code example
    # gdisk -l /dev/sda
    Number Start (sector) End (sector) Size Code Name
    <snipped>
    10 1471924224 1471926271 1024.0 KiB EF02 bios_grub


    Things I have found:
    1. /dev/sdb1 has the flags boot and esp, which Linux.org tells me
    "This flag indicates an UEFI System Partition. GPT uses this flag as an
    alias for "boot". The UEFI firmware stores files on this partition"
    2. gdisk shows this partition with code "EF00", so it should have been
    found.
    3. Using system rescue 8.01, downloaded a couple of months ago, seems to
    have no means of setting the code, although gdisk has that function.

    If I recall correctly you right click the desired parathion select Flags
    and pick a flag name from list.

    4. Presumably there should be only one partition where grub2 is installed.
    5. I used a system rescue option to boot into Mageia 8. Can I now safely execute
    grub2-install /dev/sdb
    to fix the problem?


    I would think so.I have used the option a few times.


    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Grimble@2:250/1 to All on Thu Jul 29 14:46:31 2021
    On 27/07/2021 17:19, Grimble wrote:
    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition    16MiB    Flags msftres /dev/sda2: Basic data partition ntfs    200MiB    Flags msftdata /dev/sda3: / Mageia 8            50GiB
    ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition    fat32 BOOT    500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition    ntfs    Windows    460MiB
    .......

    I have found a way to specify the EFI partition to grub2-install, so now
    I can select Mageia 8 from the boot menu. Unfortunately, dracut doesn't
    like a change that has happened to the serial number of the vfat
    partition that is /dev/sdb1. It says it can't find
    UUID-by-name-FA07-C2F6, which is the old number of BOOT. The new number C4E6-9FA1 has been entered into /etc/fstab, but the old number persists somewhere (superblock?). How to change dracut's behaviour?


    --
    Grimble
    Registered Linux User #450547
    Machine 'Bach' running Plasma 5.20.4 on 5.10.52-desktop-1.mga8 kernel.
    Mageia release 8 (Official) for x86_64

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Grimble@2:250/1 to All on Thu Jul 29 15:12:17 2021
    On 29/07/2021 14:46, Grimble wrote:
    On 27/07/2021 17:19, Grimble wrote:
    My problem PC has been returned from the supplier, and boots happily
    into Windows 10.
    Disk layout as follows:
    /dev/sda:
    /dev/sda1: Microsoft reserved partition    16MiB    Flags msftres
    /dev/sda2: Basic data partition ntfs    200MiB    Flags msftdata
    /dev/sda3: / Mageia 8            50GiB
    ..... other partitions of mine

    /dev/sdb:
    /dev/sdb1: EFI system partition    fat32 BOOT    500MiB
    /dev/sdb2: Microsoft eserved partition
    /dev/sdb3: Basic data partition    ntfs    Windows    460MiB
    .......

    I have found a way to specify the EFI partition to grub2-install, so now
    I can select Mageia 8 from the boot menu. Unfortunately, dracut doesn't
    like a change that has happened to the serial number of the vfat
    partition that is /dev/sdb1. It says it can't find
    UUID-by-name-FA07-C2F6, which is the old number of BOOT. The new number C4E6-9FA1 has been entered into /etc/fstab, but the old number persists somewhere (superblock?). How to change dracut's behaviour?


    Write out 100 times "I must Google before posting"
    Found out about mlabel

    --
    Grimble
    Registered Linux User #450547
    Machine 'Bach' running Plasma 5.20.4 on 5.10.52-desktop-1.mga8 kernel.
    Mageia release 8 (Official) for x86_64

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Thu Jul 29 16:26:07 2021
    On Thu, 29 Jul 2021 10:12:17 -0400, Grimble <grimble@nomail.afraid.org> wrote:
    On 29/07/2021 14:46, Grimble wrote:
    I have found a way to specify the EFI partition to grub2-install, so now
    I can select Mageia 8 from the boot menu. Unfortunately, dracut doesn't
    like a change that has happened to the serial number of the vfat
    partition that is /dev/sdb1. It says it can't find
    UUID-by-name-FA07-C2F6, which is the old number of BOOT. The new number
    C4E6-9FA1 has been entered into /etc/fstab, but the old number persists
    somewhere (superblock?). How to change dracut's behaviour?

    Write out 100 times "I must Google before posting"
    Found out about mlabel

    Just fyi, the old uuid (serial in dos terms) is stored in the file /boot/initrd-$(uname -r).img. To overwrite it after changing the /etc/fstab, run dracut with the -f option. Without the -f option dracut will not overwrite an existing initrd image.

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.22 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)