boot-repair should check partition order in GPT table

Bug #1600514 reported by Sneetsher on 2016-07-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Boot-Repair
Undecided
Unassigned

Bug Description

I have a case with Dell Latitude E6410 (firmware ver A16), That doesn't boot in UEFI mode because EFI partition wasn't the first in partition table (/dev/sda4) where it was in the first on disk (start sector 2048).

That was with fresh Ubuntu 16.04 install and run Boot-Repair after that. I repeat the installation multiple times.

Ubuntu entry appears in UEFI boot menu, selecting it comes with no boot media message.

 I would suggest if you have such similar cases that boot-repair fix the partition table order like (gdisk > s). Or at least warn user about partition order issue in GPT table with some UEFI firmwares.

`sudo dmidecode`

BIOS Information
    Vendor: Dell Inc.
    Version: A16
    Release Date: 12/05/2013
...
System Information
    Manufacturer: Dell Inc.
    Product Name: Latitude E6410

`sudo sfdisk -d /dev/sda`

label: gpt
label-id: 4A4481B5-0322-411E-8D05-552FBE6189AC
device: /dev/sda
unit: sectors
first-lba: 34
last-lba: 976773134

/dev/sda1 : start= 4194304, size= 127924224, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=F1D50A87-ACB2-4868-B1EA-66C3D5223EA4, name="Linux filesystem"
/dev/sda2 : start= 874115072, size= 98463744, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=C96E6320-18EA-40B2-BA46-79FC66407917, name="Linux filesystem"
/dev/sda4 : start= 2048, size= 409600, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=BCB6E471-44F7-4C42-81EC-B276F1D6B6E6, name="EFI"
/dev/sda5 : start= 154339328, size= 715456512, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=AEBBA3F2-F8B6-40C0-ABFE-9F530FC5F641, name="Linux filesystem"
/dev/sda6 : start= 136513536, size= 17825792, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=515C9B77-B282-4007-8F1A-B0C5D908591E, name="Linux swap"

YannUbuntu (yannubuntu) wrote :

Thanks for the report and sorry for late answer.

What did you do exactly to fix this ?
If I understood correctly, you used gdisk to assign your EFI partition to sda1 instead of sda4, and fixed fstab accordingly?

Changed in boot-repair:
status: New → Incomplete
Sneetsher (sneetsher) wrote :

No problem.

---
* What did you do exactly to fix this ?
---
You may check directly my question in AskUbuntu, (in good format Q/A) https://askubuntu.com/questions/796749/unable-to-boot-newly-installed-ubuntu-16-04-using-uefi-mode

I followed instructions below to fix that:

    1. Boot using Live USB

    2. Backup GPT table

    sudo su
    swapoff
    sfdisk -d /dev/sda > sda.bkp

    3. Modify new table with new order (EFI is the first)

    cp sda.bkp sda.new
    nano sda.new

    sda.new

    label: gpt
    label-id: 4A4481B5-0322-411E-8D05-552FBE6189AC
    device: /dev/sda
    unit: sectors
    first-lba: 34
    last-lba: 976773134

    /dev/sda1 : start= 2048, size= 409600, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=BCB6E471-44F7-4C42-81EC-B276F1D6B6E6, name="EFI"
    /dev/sda2 : start= 4194304, size= 127924224, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=F1D50A87-ACB2-4868-B1EA-66C3D5223EA4, name="Linux filesystem"
    /dev/sda5 : start= 136513536, size= 17825792, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=515C9B77-B282-4007-8F1A-B0C5D908591E, name="Linux swap"
    /dev/sda6 : start= 154339328, size= 715456512, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=AEBBA3F2-F8B6-40C0-ABFE-9F530FC5F641, name="Linux filesystem"
    /dev/sda4 : start= 874115072, size= 98463744, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=C96E6320-18EA-40B2-BA46-79FC66407917, name="Linux filesystem"

    4. Restore the GPT table

    sfdisk /dev/sda < sda.new

References:

    Change the number of the partition from sda1 to sda2, http://unix.stackexchange.com/a/90224/12209

    How to renumber GPT partitions on an umounted disk? (simpler but i didn't try it), http://unix.stackexchange.com/questions/127033/how-to-renumber-gpt-partitions-on-an-umounted-disk

---
If I understood correctly, you used gdisk to assign your EFI partition to sda1 instead of sda4, and fixed fstab accordingly?
---
Yes, but I used `sfdisk`, later I found `gdisk` has an easier way. with single command you can order the table entries.

No, I didn't modify fstab, because by default it was using UUID's only.

---
Please, let me know if you need any additional info I still have that laptop.

Changed in boot-repair:
status: Incomplete → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers