5

I have recently received a machine with a OEM Windows 10 installed. But I couldn't install Ubuntu on it, because the UEFI partition was in NTFS format. Instead of vfat/fat32 like the the UEFI specification stipulates. NTFS is not even mentioned there. But like always: Microsoft is bigger than any international standards, so others need to adapt.

I tried different methods to recreate the UEFI partition, but I couldn't get it working without removing the Windows installation. I was considering to reinstall Windows 10 and try to force the UEFI in FAT format.

But I was able to talk the customer/user out of using Windows natively, since he only needs this to Admin Windows servers and simulate problems of Windows users/customers. Remmina will do to connect to the Windows servers and virtual machines will do to simulate Windows software problems.

Still I think it would be a good idea to collect workarounds/fixes for the dual boot with NTFS UEFI partitions. Since I fear I won't be the only person confronted with this issue.

muru
  • 197,895
  • 55
  • 485
  • 740
jringoot
  • 838
  • Aren't you confusing ESP (EFI partition) that must be FAT32 with a small boot partition for Windows which is typically NTFS and characteristic of a BIOS install? Windows 10 can be installed in older (or new) non-UEFI computers and also installed in the same mode in UEFI ones by turning on CSM/Legacy (why would someone do that beats me, but it's possible). –  Aug 04 '17 at 09:37
  • I assure you that it was truly the EFI partition, marked as EFI in the partition table, as found by the ubuntu installer and by debian installer as well.

    I know that windows 10 can be installed on older computers. I was just astonished that, besides UEFI is used, an NTFS UEFI partitiion was used, which is apparently readable by the BIOS... but for which Linux is not ready.

    – jringoot Aug 04 '17 at 12:27
  • Have you tried to install by booting Ubuntu in UEFI mode, then use something else and select that EFI partition as is, along with all the other necessary partitions for Ubuntu? This is assuming you want a dual boot. If not, seriously, what's stopping you? Simply selecting "Erase disk and install..." will create and format a proper ESP if it can't use the one already there. And I still think you're mistaken about the ESP's file system because depending on the tool used the results may not be as clear and we would like. –  Aug 04 '17 at 12:33
  • I'd like to see the output of sudo parted -l and sudo blkid on this system with the allegedly-NTFS ESP. I've seen such claims a couple of times before, but without evidence. At best, such a configuration would be hideously standards-defiant, so I'm skeptical that the diagnosis is correct. That said, if it is set up that way, the best approach is to create a second valid (FAT32) ESP and (temporarily) unmark the NTFS pseudo-ESP as an ESP for the Ubuntu installation. Please provide the parted -l and blkid output first, though; that could provide vital information. – Rod Smith Aug 05 '17 at 00:32
  • Hi Michael, Hi Rod,

    The current output of those commands will show a FAT EFI since I already did a new install on it. I expect other systems of the same make soon. I will provide the output. If I made a mistake, I will mention it here and then remove this question.

    Thanks.

    – jringoot Aug 14 '17 at 05:24

1 Answers1

1

EDIT: Turns out, the below was "false alarm" of sorts; somewhat later, I realized the disk hosting this NTFS "EFI" partition is formatted MBR, not GPT; and it does not have an EFI folder either, nor typical expected Windows EFI files as EFI/Microsoft/Boot/bootmgfw.efi. I guess, the presence of the "esp" flag on this partition is what got me confused.

In the end, I ended up doing this:

  • First installed Ubuntu on a spare partition from an EFI booted USB, and ignored fails in installing grub on NTFS
  • I hoped that I could flash GRUB2 manually on NTFS partition, but grub2 2.04 has explicit check for FAT, so that is for the time being impossible:
if (!efidir_is_mac && grub_strcmp (fs->name, "fat") != 0)
  grub_util_error (_("%s doesn't look like an EFI partition"), efidir);
  • Then I tried recommendation in comments:

To change the off ntfs EFI partition, just copy the files off, change the partition type and reformat to FAT, then copy the files back

This still didn't help dual boot at this point, however, now that I had a FAT32 partition, I could re-install Ubuntu, from stick booted in EFI mode, while flashing GRUB2 on this partition.

  • Now Ubuntu did start up, but os-prober simply did not detect Windows at all; boot-repair did not correct anything, but it mentioned that it saw "legacy windows"
  • Finally, from the Ubuntu installation, I re-installed grub2 on the partition, but with --target=i386-pc; and forced legacy-only boot from BIOS
  • Rebooting into Ubuntu now, boot-repair removed all grub EFI-related packages - and finally, os-prober could see Windows partition; but the entry it added (with chainload) could not boot into Windows, claiming disk was not bootable (which it isn't, as the Windows install is on partition 2, which is not marked bootable)
  • Finally, as per suggestion in How to boot into Windows 7 when grub is installed in the Windows partition? - I added manuall a Windows 10 entry which used ntldr ($root)/bootmgr - and finally I have dual boot!

Which is to say - this first NTFS partition, which was bootable (and marked esp) was most likely not a real EFI partition - maybe it somehow facilitated recovery or something; which is (I guess) proven by the fact, that I could only achieve dual boot to Windows, by forcing legacy boot.


Not an answer, but just wanted to respond to this:

I'd like to see the output of sudo parted -l and sudo blkid on this system with the allegedly-NTFS ESP. I've seen such claims a couple of times before, but without evidence. ...

Please provide the parted -l and blkid output first, though; that could provide vital information.

Yup, just ended up with a system like that, refurbished ThinkPad.

I booted up Slax on my USB thumbdrive on this laptop (in legacy mode), and it provides this information (note that I've done a bit of manual partitioning, in addition to what was present upon disk already; I've also removed info about other drives):

root@slax:~# parted -l
Model: ATA KINGSTON SUV400S (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags 1 1049kB 368MB 367MB primary ntfs boot, esp 2 368MB 54.1GB 53.7GB primary ntfs 4 54.1GB 118GB 64.4GB extended 5 54.1GB 75.5GB 21.5GB logical ext4 6 75.5GB 108GB 32.2GB logical ntfs 7 108GB 118GB 10.7GB logical linux-swap(v1) 3 118GB 120GB 1611MB primary ntfs diag

So, partition 1 is marked both as ntfs, and as boot & esp.

root@slax:~# blkid
/dev/zram0: TYPE="swap"
...
/dev/sda1: LABEL="System" UUID="64C89227C891F78E" TYPE="ntfs" PARTUUID="5e4a12da-01"
/dev/sda2: LABEL="Windows" UUID="EE3E98553E9818A3" TYPE="ntfs" PARTUUID="5e4a12da-02"
/dev/sda3: LABEL="Recovery" UUID="28DE98A6DE986E36" TYPE="ntfs" PARTUUID="5e4a12da-03"
/dev/sda5: UUID="80bbb011-a20f-489f-99dc-bbcc9422f7f4" TYPE="ext4" PARTUUID="5e4a12da-05"
/dev/sda6: LABEL="XXXXXX" UUID="3BBF7C062DC0E351" TYPE="ntfs" PARTUUID="5e4a12da-06"
/dev/sda7: UUID="abf91577-e9e8-4cd5-9e3f-48393f6c084c" TYPE="swap" PARTUUID="5e4a12da-07"
/dev/sdb1: UUID="D4D5-9DAC" TYPE="vfat" PARTUUID="000568d1-01"

I wanted to install Ubuntu dual-boot on this machine along with Windows, so I booted up the mini.iso from USB thumbdrive (in EFI mode), which runs the text installer; originally it showed this state of partitions:

textinst-parts-01

I then tried to to set up partition 1 to be "Used as" EFI system partition, which resulted with this state being shown:

textinst-parts-02

... however, the text installer would have none of it - and it failed with "The attempt to mount a file system with type vfat in SCSI2 (0,0,0), partition #1 (sdb) at /boot/efi failed.":

textinst-parts-03

So, yeah - the text installer does seem to make the assumption that the EFI partition is always vfat, and as in this case it is NTFS, the process there fails ...

So I cannot really tell, what I can do, to have Ubuntu installed on this system in dual boot configuration with Windows - without changing the EFI partition ...


EDIT: Here are approximately the files present on this first NTFS partition, mounted on /mnt here (I had cut off some obvious translation and font files to make it easier to read) - note that there is no EFI folder anywhere:

$ tree /mnt/

/mnt/ ├── Boot │ ├── BCD │ ├── BCD.LOG │ ├── BCD.LOG1 │ ├── BCD.LOG2 │ ├── bg-BG │ │ └── bootmgr.exe.mui │ ├── BOOTSTAT.DAT │ ├── bootuwf.dll │ ├── bootvhd.dll │ ├── cs-CZ │ │ ├── bootmgr.exe.mui │ │ └── memtest.exe.mui │ ├── da-DK │ │ ├── bootmgr.exe.mui │ │ └── memtest.exe.mui ... │ ├── Fonts │ │ ├── chs_boot.ttf │ │ ├── cht_boot.ttf ... │ │ ├── segoen_slboot.ttf │ │ ├── segoe_slboot.ttf │ │ └── wgl4_boot.ttf │ ├── fr-CA │ │ └── bootmgr.exe.mui ... │ ├── memtest.exe │ ├── nb-NO │ │ ├── bootmgr.exe.mui │ │ └── memtest.exe.mui ... │ ├── Resources │ │ ├── bootres.dll │ │ ├── da-DK │ │ │ └── bootres.dll.mui ... │ ├── ro-RO │ │ └── bootmgr.exe.mui ... │ └── zh-TW │ ├── bootmgr.exe.mui │ └── memtest.exe.mui ├── bootmgr ├── BOOTNXT ├── gboot │ └── grub ├── grub ├── manboot │ ├── bcd │ ├── bootfix.bin │ ├── boot.sdi │ ├── efisys.bin │ ├── efisys_noprompt.bin │ ├── etfsboot.com │ └── fonts │ ├── chs_boot.ttf │ ├── cht_boot.ttf │ ├── jpn_boot.ttf │ ├── kor_boot.ttf │ └── wgl4_boot.ttf └── System Volume Information └── tracking.log

sdaau
  • 3,056
  • 1
    With an MSDOS partition type, you could have legacy bootloaders, as well as a mislabeled ntfs partition (which may not even be used). Thinkpads allow a preference, (UEFI over legacy), but if UEFI fails, the boot tries legacy (and succeeds?). To change the off ntfs EFI partition, just copy the files off, change the partition type and reformat to FAT, then copy the files back. The UEFI bootloaders are just files.Then set up any needed boot entries with efibootmgr (are any set presently?). Device bootloader in .../EFI/Boot/bootx64.efi may be present and work. – ubfan1 Feb 07 '21 at 17:30
  • Thanks @ubfan1 - tried the conversion to FAT, that in itself didn't work - but it turns out, this was likely not a "real" EFI partition, as the only way I could achieve dual boot to Windows, was by forcing legacy boot (updated my post with findings). – sdaau Feb 08 '21 at 10:42
  • With MSDOS partition table Windows is bound to legacy boot, so Ubuntu should be installed in legacy boot mode too. An Efi Sysem Partition is not needed, Grub will install to MBR, not to ESP in legacy boot mode. Grub-efi cannot boot Windows in legacy mode, that's the reason why os-prober does not add a menu-entry for Windows. – mook765 Feb 08 '21 at 11:20