0

I have a Gateway (Model DX4850 - Re-branded ACER) that was one of the early adopters of EFI. I don't believe it was UEFI. When I bought it (circa 2012) I wasn't interested in having Microsoft Windows 7 on it at all, so I deleted various partitions and then re-installed it with Ubuntu 12.04. Not knowing about EFI, I believe that I also deleted the EFI partition.

I installed Ubuntu in BIOS mode and many subsequent installations were done in BIOS mode. I have two main partitions for Ubuntu installations (sda1 and sda6), so that my current installation is on one partition and a new installation is put on the other partition. That way, I can continue to work with using my old installation until I get the new installation working properly and my files copied over from the backup.

I noticed that every time I booted, I would get an EFI error and later I noticed that Live CD's and Live USB's detected that it was an EFI motherboard, but would not install in EFI mode. I then realized that I probably had inadvertently deleted the original EFI partition so researched how to restore the EFI partition and created a 200 Mb partition and set the EFI flag.

Now that I had a EFI partition, I installed Ubuntu 16.10 in sda6 in EFI mode. When Ubuntu 17.04 came out, I installed it in sda1 and placed the home folder in a separate partition. However it appeared that the grub files stayed in sda6 and it continued to boot Ubuntu 16.10 until I adjusted the grub menu to boot Ubuntu 17.04 which was item 4 in the menu (I think).

Today I decided to install 17.10 Beta 1 in sda6 and deleted the partition and created two partitions in the space, one for root (/) and one for home (/home). The installation when well, however when it rebooted, it ended up at the grub rescue prompt.

I booted with my Live USB stick, installed boot-repair and tried to fix the problem. I received this message:

An error occurred during the repair.

A new file (~/Boot-Info_2017-09-12__23h48.txt) will open in your text viewer.

In case you still experience boot problem, indicate its content to:
boot.repair@gmail.com 

You can now reboot your computer.
Please do not forget to make your BIOS boot on sda (1000GB) disk!

Here is the output from fdisk -l

Disk /dev/loop0: 1.5 GiB, 1553670144 bytes, 3034512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000df48b

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1           411648   98068479   97656832  46.6G 83 Linux
/dev/sda2        911226878 1953523711 1042296834   497G  5 Extended
/dev/sda3  *          2048     411647     409600   200M ef EFI (FAT-12/16/32)
/dev/sda4         98068480  911224831  813156352 387.8G 83 Linux
/dev/sda5       1936785408 1953523711   16738304     8G 82 Linux swap / Solaris
/dev/sda6        911226880 1008881663   97654784  46.6G 83 Linux
/dev/sda7       1008883712 1936781311  927897600 442.5G 83 Linux

Partition 2 does not start on physical sector boundary.
Partition table entries are not in disk order.

Disk /dev/sdg: 7.5 GiB, 8000110592 bytes, 15625216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1b571474

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdg1  *          0 3142655 3142656  1.5G  0 Empty
/dev/sdg2       3118960 3123567    4608  2.3M ef EFI (FAT-12/16/32)

Running:

dmesg | grep -i "EFI"

yields:

[    0.000000] Command line: BOOT_IMAGE=/casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash ---
[    0.000000] efi: EFI v2.10 by American Megatrends
[    0.000000] efi:  SMBIOS=0xbad2ed98  ACPI=0xbac2b000  ACPI 2.0=0xbac2b000  MPS=0xfcc20 
[    0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[    0.000000] Kernel command line: BOOT_IMAGE=/casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash ---
[    0.167061] Registered efivars operations
[    4.965537] efifb: probing for efifb
[    4.965543] efifb: framebuffer at 0xd0000000, using 1920k, total 1920k
[    4.965544] efifb: mode is 800x600x32, linelength=3200, pages=1
[    4.965544] efifb: scrolling: redraw
[    4.965545] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    4.967076] fb0: EFI VGA frame buffer device
[    5.009887] EFI Variables Facility v0.08 2004-May-17
[    5.368319] fb: switching to inteldrmfb from EFI VGA
[    5.963925] tsc: Refined TSC clocksource calibration: 3392.298 MHz

I would like to bring my desktop computer into a properly working EFI system. How do I do this? I have all my files backed up, so I can rebuild everything from scratch if necessary.

UPDATE: I ran:

sudo gdisk /dev/sda1

and got:

GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Could I allow gdisk to convert the MBR to GPT?

Thank you,

Peter Freeman

1 Answers1

0

Most likely cause that I see.
You have an MBR partitioned disk.
When installing ubuntu in Legacy mode it added grub to the MBR of the disk.
when you added the EFI partition and installed in EFI mode, the grub in the MBR was not updated, so now that you have deleted 16.10 the grub in the MBR can not find the config file that was on the partition for 16.10.

Possible fixes:
1) use an MBR tool to erase grub from the MBR. be sure to flag the EFI partition as the boot partition.
2) start from scratch with repartioning. EFI can use GPT partitioning which has advantages over MBR. 3) return to using Legacy Boot.

NOTE: be sure your EFI partition is formated FAT32. this is a requirement.

ravery
  • 6,874
  • I just ran sudo gdisk /dev/sda and got:

    GPT fdisk (gdisk) version 1.0.1

    Partition table scan:
    MBR: MBR only
    BSD: not present
    APM: not present
    GPT: not present


    Found invalid GPT and valid MBR; converting MBR to GPT format
    in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
    typing 'q' if you don't want to convert your MBR partitions
    to GPT format!


    Could I allow gdisk to do the conversion?

    – Peter Freeman Sep 13 '17 at 03:18
  • Yes, my EFI partition is FAT32 – Peter Freeman Sep 13 '17 at 03:32
  • You forced UEFI install to the old MBR partitioning scheme. Normally UEFI uses gpt. Your install of Windows 7 auto converted drive from gpt to MBR. You can use gdisk to convert to gpt. But you proably still have MBR with old boot loader and depending on settings in UEFI my be booting in BIOS mode or UEFI mode. And Acer (not sure about Gateway) has required UEFI password & setting of trust to boot Ubuntu files in ESP - efi system partition. Acer Aspire E15 will not dual boot, many details Trust settings in step 35 http://askubuntu.com/questions/627416/acer-aspire-e15-will-not-dual-boot – oldfred Sep 13 '17 at 03:40
  • @oldfred - he is dual booting two versions of ubuntu. there is no issue. – ravery Sep 13 '17 at 03:55
  • @ravery - I just wrote the GPT information using the "w" option in gdisk and it looks like it fixed the disk. Now I have to see if boot-repair works. Here is my current information from gdisk:

    GPT fdisk (gdisk) version 1.0.1

    Partition table scan: MBR: protective BSD: not present APM: not present GPT: present

    Found valid GPT with protective MBR; using GPT.

    – Peter Freeman Sep 13 '17 at 04:03
  • if there wasn''t any data loss the grub installed in the EFI partition should work without modification ... caution with bootrepair in the past it has had problems with EFI booting – ravery Sep 13 '17 at 04:06
  • @ravery - I used boot-repair and I can now boot both "17.04" and "17.10 Beta 1". One quirk remains though. When it reboots, I just get a flashing line cursor and nothing happens. After I hit Ctrl-Alt-Del, it reboots again and this time I get the grub menu. I wonder if it it has something to do with the sort order of the partitions and fstab as mentioned in the gdisk documentation, though I would think that fstab is not being looked at prior to the grub men. Or is it? – Peter Freeman Sep 13 '17 at 04:50
  • flashing curser is the system(hardware) boot error. Possibly gdisk, didn't completely erase the MBR signiture. if the problem persists, I would back up your data. use a windows system or boot disk to erase and partition as GPT then restore data. – ravery Sep 13 '17 at 06:53
  • 2
    When doing an MBR-to-GPT conversion, gdisk leaves the MBR boot code alone. It can be deleted with sudo dd if=/dev/zero of=/dev/sda bs=440 count=1, but *BE CAREFUL* with that command! It can trash things badly if you make a mistake! It's safer to disable the CSM, if the computer allows that. It could also be that the EFI boot order is booting something invalid by default. This can be viewed via sudo efibootmgr -v (study BootOrder and BootCurrent) and adjusted via the -o option to efibootmgr. – Rod Smith Sep 13 '17 at 14:13