Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

  1. #1

    Default Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    My issue is quite similar to this https://forums.opensuse.org/showthre...rboard-to-UEFI but probably simpler.

    I want to upgrade a Leap 15.0 system to Leap 15.1. Although the hardware fully supports, and is configured for, booting in secure boot UEFI mode, the system currently boots in legacy mode (don't ask -- life's too short) but it seems that nowadays secure boot is preferred. The existing (Leap 15.0) system seems to be set up for UEFI already:

    From parted -l

    Code:
    Model: ATA KINGSTON SV300S3 (scsi)                                                                                                                                                                                                                     
    Disk /dev/sda: 480GB                                                                                                                                                                                                                                   
    Sector size (logical/physical): 512B/512B                                                                                                                                                                                                              
    Partition Table: gpt                                                                                                                                                                                                                                   
    Disk Flags: pmbr_boot                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                           
    Number  Start   End     Size    File system     Name     Flags                                                                                                                                                                                         
     1      1049kB  8389kB  7340kB                  primary  bios_grub
     2      8389kB  436MB   428MB   fat16           primary  boot, esp
     ...
     6      343GB   480GB   137GB   xfs             primary  legacy_boot, msftdata

    From gdisk -l /dev/sda

    Code:
    Number  Start (sector)    End (sector)  Size       Code  Name
       1            2048           16383   7.0 MiB     EF02  primary
       2           16384          851967   408.0 MiB   EF00  primary

    From /etc/fstab

    Code:
    UUID=4D09-B9A3       /boot/efi            vfat       umask=0002,utf8=true  0 0

    From /etc/mtab

    Code:
    /dev/sda2 /boot/efi vfat rw,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

    From file -sL /dev/sda2

    Code:
    /dev/sda2: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 16, root entries 512, Media descriptor 0xf8, sectors/FAT 208, sectors/track 63, heads 255, hidden sectors 16384, sectors 835584 (volumes > 32 MB), reserved 0x1, serial number 0x4d09b9a3, unlabeled, FAT (16 bit)

    When I tried to upgrade to Leap 15.1 the installer noticed that it had booted with UEFI but the installed system was legacy mode and it warned me in bright red text that proceeding with the upgrade was not a good idea. So I aborted the upgrade and booted Leap 15.0 and used YaST to try to change the boot loader from GRUB to GRUB for EFI. YaST didn't like that; it gave the error:


    Code:
    Execution of command "[["/usr/sbin/shim-install", "--config-file=/boot/grub2/grub.cfg","--no-nvram","--removable"]]" failed
    Exit code: 1
    Error output: Installing for i386-pc platform.
    /usr/sbin/grub2-install: error: install device isn't specified.

    The only anomaly that I can see in the existing installation is that /dev/sda2 is FAT16 rather than the requisite FAT32. Is that the only issue preventing the change to GRUB for EFI? Or is it more complicated than that?

    Obviously if I reformat /dev/sda2 then I'll lose its contents, but does that matter while the system is booting in legacy mode? That is, assuming that /dev/sda2's format is the problem, if I use some partitioning tool to change it to FAT32 will the system still boot in legacy mode given the rest of /boot is on /dev/sda6? I'd rather avoid killing a working system and then having to spend time rescuing it if there is instead a right way to all this.

    Your helpful advice will be gratefully received.

  2. #2
    Join Date
    Sep 2012
    Posts
    5,977

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Quote Originally Posted by greggmoore View Post
    Code:
    Execution of command "[["/usr/sbin/shim-install", "--config-file=/boot/grub2/grub.cfg","--no-nvram","--removable"]]" failed
    Exit code: 1
    Error output: Installing for i386-pc platform.
    /usr/sbin/grub2-install: error: install device isn't specified.
    This is fixed in Tumbleweed. You can disable secure boot both in BIOS and YaST, and then after finally booting in EFI mode enable it again (if required) - first in Yast so it installs correct bootloader and then in BIOS.

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,530
    Blog Entries
    3

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Quote Originally Posted by greggmoore View Post
    Code:
    Execution of command "[["/usr/sbin/shim-install", "--config-file=/boot/grub2/grub.cfg","--no-nvram","--removable"]]" failed
    Exit code: 1
    Error output: Installing for i386-pc platform.
    /usr/sbin/grub2-install: error: install device isn't specified.
    I'm pretty sure that works, without error, in Leap 15.1. Or, at least, it works if done at the command line. I don't know about doing that with Yast.

    The only anomaly that I can see in the existing installation is that /dev/sda2 is FAT16 rather than the requisite FAT32. Is that the only issue preventing the change to GRUB for EFI?
    That will only be a problem if your UEFI firmware is exceptionally fussy. Most will accept FAT16.

    Obviously if I reformat /dev/sda2 then I'll lose its contents, but does that matter while the system is booting in legacy mode?
    That only matters if the content is important. If the only important content is what will be replaced by your install/update, then it should not be a problem.

    Generally speaking, the safest way to switch an existing system to UEFI booting is:

    1: Boot rescue media to UEFI mode. Booting the installer to the rescue system can work for this, but you have to boot to UEFI mode.

    2: Mount the system that you are trying to repair.
    Use something like:
    Code:
    mount /dev/sdaX /mnt
    but replace "/dev/sdaX" with the proper device for your root file system.

    3: Do other needed mount (bind mounts)
    Code:
    mount --bind /dev /mnt/dev
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    4: Go into chroot mode
    Code:
    chroot /mnt
    mount -a
    That last mount command, in chroot mode, should mount anything else needed. This includes "btrfs" subvolumes, the EFI partition at "/boot/efi", etc.

    5: While still in chroot mode, run "yast" at the command line. And change to UEFI booting. Since you are running in UEFI mode in the chroot session, this should work. You will be using the command line "ncurses" version of Yast.

    6: Maybe also, while still in a chroot session:
    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    mkinitrd
    7: Exit from the chroot session (just the command "exit.

    8: Reboot
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  4. #4
    Join Date
    Sep 2012
    Posts
    5,977

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Quote Originally Posted by nrickert View Post
    I'm pretty sure that works, without error, in Leap 15.1. Or, at least, it works if done at the command line. I don't know about doing that with Yast.
    It is unrelated to YaST. It was problem with shim-install which is fixed in 15.1 (same as in Tumbleweed). I guess one could simply update shim to 15.1 version on 15.0, it is pretty much self contained.

  5. #5

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Thank you nrickert for the detailed instructions. System maintenance isn't my day job so the detail is always greatly appreciated.

    Also thank you arvidjaar. Are you saying that if I follow nrickert's steps it might still not work because I will still be using 15.0's version of shim? I've grabbed 15.1's version from the repositories but haven't tried to install it yet (so don't yet know how "self contained" it is), but if shim rather than YaST was the problem should using YaST with the updated shim -- assuming it installs -- now work properly on my running 15.0 installation without having to go via the rescue disk? Or are you saying that I need the updated shim before I can follow nrickert's steps?

  6. #6
    Join Date
    Sep 2012
    Posts
    5,977

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Quote Originally Posted by greggmoore View Post
    if shim rather than YaST was the problem should using YaST with the updated shim -- assuming it installs -- now work properly on my running 15.0 installation without having to go via the rescue disk?
    More or less. The command that was shown should not fail any more, also when called from YaST.
    Or are you saying that I need the updated shim before I can follow nrickert's steps?
    No, I did not mean it. These steps do not depend on updated shim because they call shim-install when booted in EFI mode already and this problem is not triggered then.

  7. #7

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Thanks arvidjaar. zypper installed the updated shim without problem and YaST changed to GRUB for EFI without any error message. I rebooted the machine OK although there was a brief heart-in-the-mouth moment when GRUB drew a rectangle on the screen before clearing it and carrying on with the boot as normal.

    Now I'll see if the upgrade to 15.1 works this time.

    Thank you both for your help.

  8. #8

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Quote Originally Posted by greggmoore View Post
    Now I'll see if the upgrade to 15.1 works this time.
    Unfortunately, not. I have checked and double checked (and triple checked!) the machine's boot options: the BIOS management screen is headed "ASUS UEFI BIOS Utility" (with a footnote that copyright is held by American Megatrends, Inc.) and the Boot options screen shows that secure boot state is "Enabled", platform key (PK) state is "Loaded" and OS type is "Windows UEFI mode".

    But my Leap 15.0 installation does not have a /sys/firmware/efi directory. No surprise then that
    Code:
    # efibootmgr -v
    EFI variables are not supported on this system.
    but I am surprised that Linux boots at all given that the bootloader is now GRUB for EFI.

    Can the missing firmware be installed somehow? I have searched the repositories using YaST but cannot see anything that looks a likely candidate. Or does it mean that the standard distribution doesn't support my hardware? That is, if the efi firmware was available it would have been installed already.

    Finally, in desperation: I'm trying to avoid it because it means a great deal of effort recreating my development environment, but would a clean installation of Leap 15.1 into a new partition make these issues go away or are the problems systemic?

  9. #9
    Join Date
    Sep 2012
    Posts
    5,977

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Quote Originally Posted by greggmoore View Post
    bootloader is now GRUB for EFI.
    It has absolutely no impact on what your BIOS does. It is your BIOS that decides how it will boot, not anything you can do via YaST. Check your BIOS options.

  10. #10
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,530
    Blog Entries
    3

    Default Re: Change installed system from GRUB to GRUB for EFI before upgrade to 15.1

    Quote Originally Posted by greggmoore View Post
    but I am surprised that Linux boots at all given that the bootloader is now GRUB for EFI.
    You actually have two versions of grub installed. You have grub for legacy BIOS booting -- this is mostly in "/boot/grub2/i386-pc". And you have grub for EFI (mostly in "/boot/grub2/x86_64-efi"). And the same "grub.cfg" will work for either.

    Your system configuration says you are using grub for efi. But both are there, and what works depends mostly on your BIOS and how it starts the boot process.
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •