1

I almost follow the instructions given at How To Install Ubuntu 20.04 LTS (Focal Fossa) On UEFI and Legacy BIOS System to try to install a UEFI-based Ubuntu operating system. But it does not work, not with an erase-and-install from a UEFI-optioned Ubuntu Live SSD even.

The trick is that I downloaded the image file and copied it to an SSD instead of a USB stick, using the same dd command as in the previous reference. And the good part about that is that it shows both options, the Legacy Boot and also the UEFI boot in the Bios selection menu, for the Ubuntu Live image.

Indeed, when I boot the UEFI Live Ubuntu image on the SSD, I also have the install option to make a UEFI partition, even with a complete erase and install. And Ubuntu-Live is smart enough also that it recognizes that the disk that it is booting from is not the disk to install the regular operating system on.

Everything seems to go smoothly with the install, with the Ethernet Internet Cable plugged in for the latest updates. And at the installation's conclusion, there is even the message that it completed fine.

But alas, after the installation, there is no UEFI option for the installed Ubuntu LTS Operating System. There is just a single option for the disk. And selecting simply does not work from the BIOS menu.

The ironic part is that I am able to update the GRUB-configuration file for the Ubuntu-Live operating system. So, if I enter "c" to get to the GRUB-Live-UEFI-command-line, I am able to navigate to the .efi UEFI image as expected in its place. And I can even issue the chainloader command. See the section menuentry "GRUB chainloader".

And I do not need to load any special modules. I do, however, after the chainloader command on the Live-GRUB-command-line need to issue the boot command.

And all goes well, with the Ubuntu LTS system (regular install, not Live SSD) booting fine. I know it is a UEFI boot because I boot with the chainloader to an .efi image. Just as an aside: I tested it with Memtest86 Version 10.1.0009 that only boots in UEFI using the same technique. And it works also just the same.

So the GRUB image from the Live disk works fine. I can even update its configuration. But the one from the LTS install is hopelessly broken. I tried a lot of different references. Just recently, one reference Section 5.4. Using chroot completed without error. But, still, the install does not work. For that disk, it does not show any UEFI boot option in the boot menu. It is just one entry. And when I try to boot from that top entry, the system goes on to boot the next entry. Perhaps the bios cannot have two internal UEFI disks. It would seem odd if so.

I am stuck. I have enough space for the 3.6 GB image that needs to be copied to the USB stick Ubuntu Focal ISO Size Descriptions and Download Links. But for all of the other issues that I have encountered so far with booting, I have found that the end-resolution is workable with internal SSD drives as well. I have plenty of internal SSD drives to use as candidates, nearly for free. So these internal SSD drives (nearly perfect health, with just life-time wear issues) are a very attractive approach.

I appreciate the community's help and suggestions. Thank you.

Update: I finally got frustrated enough to order and use the USB stick according to web-published instructions. I downloaded a fresh version of ubuntu-22.04.1-desktop-amd64.iso, and I copied it using dd following the instructions at this reference. Since only the USB stick is so small, it is easy to identify which device file it is using cfdisk -l. When I go to the BIOS boot menu, I am able to see both UEFI and Legacy options for the USB stick Live Image boot. The SSD where the Desktop Version is installed, however, has only one entry; and selecting that entry does not boot, but results in an error that there is no boot-able operating system. However, I am able to select the Live USB stick, select c to enter the command line for GRUB. And I can even navigate to the SSD installation and successfully boot to it using chainloader and then boot. And I know that I am booted to the UEFI image because I booted to the .efi file and also I can check it using the /sys/firmware/efi (see: itsfoss check-uefi-or-bios) method.

Update: I downloaded the Ubuntu 22.04.1-desktop iso. As root, I opened the .iso image with Disks. There were three partitions in the image. I decided to isolate the issue. The first partition was an unknown file system type. The second one was the UEFI vfat. And the third was unknown. So I just copied the first two partitions to an SSD and I was able to boot fine, with BIOS recognizing both the Legacy and the UEFI options. Just as an aside, every time that the BIOS boot recognizes the both options, it is able to boot. And every time there is just the one option, it is not.

So I continued with the Linux install. The Linux install complained that the UEFI partition was too small. So I just resized the partition, erased it completely with dd. Then I installed a FAT32 because I expanded it to something like 10 GB, and FAT16 or FAT12 could not handle that size.

The Ubuntu Live disk was able to complete its install. And now as to be expected, after the system was unable to find the operating system. So I used the USB boot disk workaround in command line mode (in GRUB); I was able to navigate to the Ubuntu operating system and indeed boot from it.

But still GRUB on the SSD boot disk was not available. So I used dd with an offset and the same number of 512 Byte blocks to transfer the first partition back to the SSD from the Ubuntu .iso image. I erased the contents on the larger UEFI second partition, using dd if=/dev/zero to the FAT32 file system. Then I FAT32 rebuilt the file system and copied everything over again with gnome-disks and the root terminal.

So I was able with the USB stick to again navigate and boot to the SSD Ubuntu operating system. And I made the Grub changes recommended by PassMark Memtest GRUB install to update the GRUB on the internal SSD. I verified that the security was completely off in the BIOS and that it was running in ACHI mode. The USB stick had to boot with Legacy support though in the BIOS. It kind of worked.

It now boots from the internal SSD, but only if the USB stick is attached!!! That is bizarre, and still not a very comfortable solution. The solution should not require an external USB stick to boot!

Update: I bought another 16 GB USB stick and I installed Ubuntu ubuntu-22.04.1-desktop-amd64.iso on it using the Linux Startup Disk Creator. I changed the computer that I ran the desktop install on, roughly following the instructions at itz geek post how to install ubuntu 20 04 lts, just adjusting the size of the home partitions and root partitions, I remember. I have a larger 240 GB SSD, and that installation was somewhat successful. On one computer, it basically works, except that I cannot access the grub menu, even after reinstalling grub using grub-install, using the X64 UEFI instructions. There was a problem with grub-install not recognizing the /boot/efi directory as legitimate. The problem was I needed to pass grub-install the /boot/efi/EFI directory and everything was fine -- only with one computer.

On the one computer, with the new installation, it boots to UEFI Ubuntu fine. The other does not show the two install options and it does not boot fine.

There seems to be some incompatibility in the one computer that does not boot. Perhaps something broke down. I am not sure. An older SSD disk that I made for Ubuntu Live using dd boots fine. The whole thing is still very odd for me.

If there are additional suggestions, please let me know. Thank you.

Additional Related References:

Memtest86 hangs on Boot from USB -- PassMark Support Forums with Download Link for the 10.1.0009.zip file

  • 1
    have you tried "Installation type" - "Something else"? and then "Device for boot loader installation"? – Andra Dec 21 '22 at 17:04
  • 1
    Please copy & paste the pastebin link to the BootInfo summary report ( do not post report), do not run the auto fix till reviewed. Use often updated ppa version over somewhat older ISO with your USB installer or any working install. https://help.ubuntu.com/community/Boot-Repair The dd command totally erases a drive and makes a hybrid DVD/flash drive type configuration. If using a larger drive, best not to totally erase it. For UEFI only boot you can just create a FAT32 partition with boot,esp flags & extract ISO into that partition. Then system should offer to boot that ESP. – oldfred Dec 21 '22 at 17:12
  • 2
    Create a 8GB FAT32 or NTFS partition on one of the SSD's. Extract the Ubuntu ISO to that. Boot using F2, F9, F10, F12, etc. UEFI will boot the extracted ISO. See also: https://askubuntu.com/a/1442054/43926. – C.S.Cameron Dec 22 '22 at 01:41
  • Thaks to C.S. Cameron for the additional link. As to his suggestion, yes, it is possible to UEFI boot to the extracted ISO. However, the extracted ISO is a Live Image, not an LTS installation. And that is the crux of the problem. The SSD Desktop install is not a live image; it seems that GRUB is looking for a BOOT Partition that it cannot find and hence reports an error that there is no BOOT Partition. It would be nice to go into GRUB manually on the SSD installation with the command line there and not to need the USB stick. I have not gotten to there, yet --still struggling! – Stephen Elliott Dec 25 '22 at 13:57
  • 1
    I thought the EFI partition had to be FAT, not ntfs, so if your initial "live" copy of the ISO goes there, and it has the efi and boot flags, all conditions are met for that partition being an EFI partition (as well as the live root), and the system should boot, and allow you to install to the other SSD. – ubfan1 Dec 25 '22 at 17:01
  • Re user68186: the problem is very much similar with the Live USB stick or a second Live Ubuntu SSD inside the computer. If I could could get to the grub menu just booting from the installed version of GRUB, that would be a huge step forward I guess. – Stephen Elliott Dec 26 '22 at 12:57
  • Re Andra: yes, I tried something else. The .efi file gets installed as grubx64.efi in the directory /boot/efi/EFI/ubuntu. When running df -l the mount point for /dev/sda2 is identified as /boot/efi. When I navigate to the file with the Ubuntu Life USB Stick with the c command at its menu, I just go to chainloader (hd0,gpt2)/efi/ubuntu/grubx64.efi and then boot and the .efi file boots fine. – Stephen Elliott Dec 26 '22 at 13:07
  • Re: oldfred: Also, the Boot Repair Pastebin link is here – Stephen Elliott Dec 26 '22 at 13:27
  • Update: I tried to reboot, and there was only the one option for the SSD where the operating system was installed on. There were not the two separate options of Legacy and UEFI that I get with the USB stick option. After the Boot Repair I collected a new Boot Info PasteBin updated-here. – Stephen Elliott Dec 26 '22 at 13:49
  • Regarding ubfan1: I understand, that officially, the UEFI partition needs to be on a GPT disk. That partition type does not have any boot flag, as the partition type itself is the boot flag. It is an interesting idea to put the UEFI installation on a legacy partition. However, I am pretty sure that this is a problematic approach. – Stephen Elliott Dec 27 '22 at 08:13
  • Re: ufan1 I thought the EFI partition had to be FAT, not ntfs,: I ran gnome-disks as root in terminal. It reports that the first partition is 10GB - (yes, I wanted to make sure there was enough space!) The partition type is GUID Partition Table - EFI System, at sda1. And the contents are FAT (32-bit version) — Mounted at /boot/efi. I currently access the desktop boot using the Ubuntu 20.04.1 LTS Desktop with full updates. I partitioned the disk so that the EFI partition had enough space. The partitioning is: df -lh sda1 /boot/efi 9.3G sda2 /boot 18G sda3 / 79G sda4 /home 87G – Stephen Elliott Dec 27 '22 at 11:40
  • Re: ubfan1 @ 17:01 The partition-table-type that the FAT32 file system can be used on is either of the GPT or MBR disk partition tables. Currently a search of fat max size shows that the FAT16 file system has a 2 GB maximum size, so I chose that. The partition table of GPT (newer type) has a different concept of the boot flag. The EFI System Partition Type, the ESP is the BOOT FLAG. The older mbr disk table partition type has these flags. I remember that Windows 10 is compatible with UEFI disk partition types. Also mbr is fine for legacy Win 10 installs. – Stephen Elliott Jan 04 '23 at 12:43

1 Answers1

1

Update: today I was able to just use SSD disks and dd if=/....iso of=/dev/sda conv=sync to generate the boot disk. This was from a different computer than the one that was giving me trouble. I used two separate SSD's, one with the image file. The other I loaded the Ubuntu 20.04.01 LTS live image on it.

Strangely enough, the image was not able to boot in uefi mode as verified with /sys/firmware/efi not existing. Strangely enough also, I was initially able to set the first partition as a 2GB FAT16 UEFI partition type. (FAT16 supports up to 4 GB). And I got a warning that Reserved BIOS space of at least 1 MB needed to be allocated in the first SSD partition.

 Device    Size  Type
/dev/sda1  1M    BIOS boot            
/dev/sda2  15.3G Linux swap
/dev/sda3  46.6G Linux filesystem
/dev/sda4  46.6G Linux filesystem
/dev/sda5   1.9G EFI System

The partition table I set is above. I again basically followed How To Install Ubuntu 20.04 LTS (Focal Fossa) On UEFI and Legacy BIOS System adjusting the partition sizes to my liking. The first time, the Unix partition tool crashed after making its partitions. I tried again and everything was fine.

I kept the live disk inside the system. Sure enough the Ubuntu install had corrupted the GRUB boot loader. It understandably installed a Legacy loader because it booted in legacy mode.

So, I had to use grub-install, following the Ubuntu man page. There are some surprises. First, the UEFI directory was initially /boot/efi. With that grub-install gives a cryptic message that this does not look like a UEFI directory. That is because grub-install expects /boot/efi/EFI as the UEFI install directory. Also, one has to select the 64 bit UEFI type of install. And a really big surprise is that the removable option has to be selected or else grub-install gives another cryptic option.

I had to carefully adjust the BIOS of the computer to boot in UEFI mode. After a few more difficulties being solved - (sorry I am limited on time now) - I set secure boot off and the OS type as not Windows, in the BIOS. I installed the PassMark 10.1.009 MemTest following the instructions linked in the question along to the link to the 10.1.009 download listed in the question.

And Thank G-d that it worked on the one computer. I have not tested it on the other (previously problematic computer). It may be that the disk now works there too, but that would be an update to the answer.

  • 1
    Congratulations :-) – sudodus Jan 03 '23 at 18:21
  • 1
    1-4-23 SE: With the problem computer, I was able to use a USB-to-SSD adapter to take a pretty much worthless SSD that had a broken connector- and it worked perfectly. And I used the Ubuntu Startup Disk Creator to create the Live ubuntu-22.04.1-desktop-amd64.iso boot drive. The problematic computer recognized the Live Legacy and UEFI options-both at startup. I created filesystems - like before, except partition 1 BIOS BOOT, but now partition 2 the EFI System type. GRUB did not get installed properly still, but with the Live disk I can navigate and boot EFI on the problem computer! – Stephen Elliott Jan 04 '23 at 13:59