Comment 138 for bug 1289977

Revision history for this message
SatPhil (satphil) wrote :

I hit the problem as well upgrading from 13.10 to 14.04. Quite a shock.

-0- After several tries, I finally got it to do an initial boot using "boot from EFI file" (see details below), but then made two changes, after which it kept rebooting OK without intervention, so not sure which of the two changes was critical. The two changes were:

-1- sudo dpkg-reconfigure grub-efi-amd64
as suggested by olly_b in #130 (thanks, Olly)

-2- in my /boot/efi, moved all subdirectories to /boot/efi/old
sudo mkdir /boot/efi/old
sudo mv Boot EFI Microsoft ubuntu /boot/efi/old/.
    and then did
sudo mkdir /boot/efi/EFI
sudo cp -r /boot/efi/old/EFI/ubuntu /boot/efi/EFI/.

More details:

My configuration:

On a 2012 HP Envy 6 notebook.

It's a dual boot setup: Windows 8.1 Update, using 500GB and 32GB internal drives and Ubuntu set up on a 31.6GB external USB flash drive as an encrypted physical volume /dev/sdc3 with the root file system and swap being on logical volumes.

It boots from EFI with /dev/sdc2 being mounted at /boot and /dev/sdc1 at /boot/efi.

---
$ sudo parted -l
Model: ATA Hitachi HTS54505 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 1049kB 210MB 209MB primary ntfs boot
 2 210MB 479GB 479GB primary ntfs
 3 479GB 500GB 21.0GB primary ntfs
 4 500GB 500GB 113MB primary fat32 lba

Model: ATA SAMSUNG MZMPC032 (scsi)
Disk /dev/sdb: 32.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 1049kB 8589MB 8588MB primary

Model: USB Flash Drive (scsi)
Disk /dev/sdc: 31.6GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
 1 1049kB 512MB 511MB fat32 boot
 2 512MB 768MB 256MB ext2
 3 768MB 31.6GB 30.9GB

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-root: 22.4GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number Start End Size File system Flags
 1 0.00B 22.4GB 22.4GB ext4

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-swap_1: 8485MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number Start End Size File system Flags
 1 0.00B 8485MB 8485MB linux-swap(v1)

Error: /dev/mapper/sdc3_crypt: unrecognised disk label
---

Having an EFI boot setup, I should have run "sudo debconf-show grub-efi-amd64" but didn't before I fixed the problem. Anyway, this is how it looks now:

---
$ sudo debconf-show grub-pc
  grub2/kfreebsd_cmdline_default: quiet splash
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_disks_changed:
  grub2/device_map_regenerated:
  grub-pc/hidden_timeout: true
  grub-pc/install_devices:
  grub-pc/mixed_legacy_and_grub2: true
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/disk_description:
* grub2/linux_cmdline_default: quiet splash
  grub-pc/timeout: 10
  grub-pc/chainload_from_menu.lst: true
* grub2/linux_cmdline:
  grub-pc/kopt_extracted: false
  grub-pc/install_devices_empty: false
  grub-pc/partition_description:
  grub-pc/install_devices_failed: false
  grub2/kfreebsd_cmdline:

$ sudo debconf-show grub-efi

$ sudo debconf-show grub-efi-amd64
* grub2/linux_cmdline_default: quiet splash
  grub2/kfreebsd_cmdline:
  grub2/kfreebsd_cmdline_default: quiet splash
* grub2/linux_cmdline:
  grub2/device_map_regenerated:

---

And again, I should have run "sudo efibootmgr -v" before but didn't and here is how it looks now:

---

$ sudo efibootmgr -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 3003,2001,2002,2003
Boot0000* Notebook Hard Drive BIOS(2,0,18).......................................................................
Boot0001* USB Hard Drive - USB Flash Drive BIOS(7,500,53).......................................................................
Boot0003* ubuntu HD(1,800,f3800,3907ec83-43d5-47ee-99bd-5c58abb58abc)File(\EFI\ubuntu\grubx64.efi)
Boot2001* USB Drive (UEFI) RC
Boot3003* Internal Hard Disk or Solid State Disk RC

---

-0- Getting it to boot initially

after power on, at prompt "Press ESC key for startup menu", press <esc> to interrupt boot
F9 to select "boot device options"
selected "boot from EFI file"
selected first device: ...Usb(0,0)/Usb(1,0)/HD(Part1...
roamed around /boot/efi until I found the subdirectory EFI/ubuntu with grubx64.efi and shimx64.efi, then selected the grubx64.efi to boot from.

Current Contents of /boot/efi

$ ls -lR /boot/efi
/boot/efi:
total 12
drwxr-xr-x 3 root root 4096 May 2 09:08 EFI
drwxr-xr-x 6 root root 4096 May 2 09:07 old
drwxr-xr-x 2 root root 4096 Mar 12 12:22 System Volume Information

/boot/efi/EFI:
total 4
drwxr-xr-x 2 root root 4096 May 2 09:08 ubuntu

/boot/efi/EFI/ubuntu:
total 1448
-rwxr-xr-x 1 root root 120 Nov 1 02:57 grub.cfg
-rwxr-xr-x 1 root root 119296 May 2 09:04 grubx64.efi
-rwxr-xr-x 1 root root 1355656 Nov 1 02:57 shimx64.efi

/boot/efi/old:
total 16
drwxr-xr-x 2 root root 4096 Nov 1 16:05 Boot
drwxr-xr-x 5 root root 4096 Nov 1 16:05 EFI
drwxr-xr-x 3 root root 4096 Nov 1 16:05 Microsoft
drwxr-xr-x 2 root root 4096 Nov 1 16:05 ubuntu

/boot/efi/old/Boot:
total 128
-rwxr-xr-x 1 root root 127488 Nov 1 16:05 bootx64.efi
-rwxr-xr-x 1 root root 0 Nov 1 16:05 bootx64.efi.grb

/boot/efi/old/EFI:
total 12
drwxr-xr-x 2 root root 4096 Nov 1 16:05 Boot
drwxr-xr-x 3 root root 4096 Nov 1 16:05 Microsoft
drwxr-xr-x 2 root root 4096 Nov 1 02:57 ubuntu

/boot/efi/old/EFI/Boot:
total 128
-rwxr-xr-x 1 root root 127488 Nov 1 16:05 bootx64.efi
-rwxr-xr-x 1 root root 0 Nov 1 16:05 bootx64.efi.grb

/boot/efi/old/EFI/Microsoft:
total 4
drwxr-xr-x 2 root root 4096 Nov 1 16:05 Boot

/boot/efi/old/EFI/Microsoft/Boot:
total 256
-rwxr-xr-x 1 root root 127488 Nov 1 16:05 bootmgfw.efi
-rwxr-xr-x 1 root root 0 Nov 1 16:05 bootmgfw.efi.grb
-rwxr-xr-x 1 root root 127488 Nov 1 16:05 bootx64.efi
-rwxr-xr-x 1 root root 0 Nov 1 16:05 bootx64.efi.grb

/boot/efi/old/EFI/ubuntu:
total 1448
-rwxr-xr-x 1 root root 120 Nov 1 02:57 grub.cfg
-rwxr-xr-x 1 root root 119296 May 2 09:04 grubx64.efi
-rwxr-xr-x 1 root root 1355656 Nov 1 02:57 shimx64.efi

/boot/efi/old/Microsoft:
total 4
drwxr-xr-x 2 root root 4096 Nov 1 16:05 Boot

/boot/efi/old/Microsoft/Boot:
total 256
-rwxr-xr-x 1 root root 127488 Nov 1 16:05 bootmgfw.efi
-rwxr-xr-x 1 root root 0 Nov 1 16:05 bootmgfw.efi.grb
-rwxr-xr-x 1 root root 127488 Nov 1 16:05 bootx64.efi
-rwxr-xr-x 1 root root 0 Nov 1 16:05 bootx64.efi.grb

/boot/efi/old/ubuntu:
total 128
-rwxr-xr-x 1 root root 127488 Nov 1 16:05 grubx64.efi

/boot/efi/System Volume Information:
total 4
-rwxr-xr-x 1 root root 76 Mar 12 12:22 IndexerVolumeGuid

You can see there were lots of *.efi files dated Nov 1 [2013] 16:05 with file size 127488 bytes. "cmp" confirmed these were all the same file. However, in the /boot/efi/EFI/ubuntu directory the .efi file was (initially) dated Apr 30 [2014] (the date I did the 13.10 to 14.04 upgrade) and had a different size, 119296 bytes. After I did the "sudo dpkg-reconfigure grub-efi-amd64" this changed date to May 2 [2014] (today's date), and still 119296 bytes in size. So the idea of renaming all the /boot/efi directories into /boot/efi/old, was to get them out of the way so nothing would try to boot them and then moving the EFI/ubuntu directory back to /boot/efi/EFI/ubuntu so there would be only one efi file to pick up and boot from. [I assume at some stage in the past I've done a "boot repair" and it duplicated all the EFI files.]

As I say, I'm not sure whether the "sudo dpkg-reconfigure grub-efi-amd64" or the renaming of the /boot/efi subdirectories fixed the problem, but I'm rebooting OK now without any manual intervention.