You are not logged in.

#1 2013-04-07 17:21:27

mattbarszcz
Member
Registered: 2012-06-25
Posts: 34

[Solved] efibootmgr not creating entries

I used dd to move my GPT dual boot system onto a new drive of the same size.

Prior to the move to the new disk, I had been using rEFInd to dual boot Windows 7 and Arch without issue.  The first time I booted the system with the new drive, rEFInd loaded fine, I I selected linux, and the system booted.

After a reboot, the system loaded directly into Windows instead of loading rEFInd.  After checking my boot options, I realized I no longer had an entry for rEFINd.  It seemed that something erased it.  A quick check with a live CD showed that my EFI partition was still intact and all my rEFInd binaries and config files were still there, so I went to add a new entry with efibootmgr.

 # modprobe efivars
 # efibootmgr -c -g -d /dev/sda -p 1 -w -L "rEFInd" -l '\EFI\refind\refind_x64.efi'

I rebooted, but there was still no entry for rEFInd.  So I went back to the live cd, I ran efibootmgr with no arguments, and sure enough there was only 1 entry for the Windows Boot Manager.  It seems that efibootmgr commands don't seem to take effect.  I referenced the rEFInd page here: http://www.rodsbooks.com/refind/installing.html#windows and followed the procedure to install an entry for rEFInd from Windows.  I was able to add an entry no problem through windows.

For reference, here is my partition layout:

[root@matt /home/matt ]# gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.6

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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 500118192 sectors, 238.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 50FBE015-E56D-4173-AF0C-2A7590822C98
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 4062 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved part
   3          468992       458172415   218.2 GiB   0700  Basic data partition
   4       458174464       495923199   18.0 GiB    8300  Arch
   5       495923200       500118158   2.0 GiB     8200  Swap

And here is the output of efibootmgr

[root@matt /home/matt ]# efibootmgr
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001
Boot0000* rEFInd
Boot0001* Windows Boot Manager

Just to confirm that the GPT didn't get messed up at the end of the disk, here is the output of gdisk verifying the it.

[root@matt /home/matt ]# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.6

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): v

No problems found. 4062 free sectors (2.0 MiB) available in 2
segments, the largest of which is 2048 (1024.0 KiB) in size.

Does anyone have any suggestions as to why this doesn't work?  Nothing has changed about the system other than the disk.

Thank you in advance for your help,
Matt

Last edited by mattbarszcz (2013-04-07 19:30:40)

Offline

#2 2013-04-07 17:27:51

sidneyk
Member
From: Bonner Springs, KS. USA
Registered: 2011-04-22
Posts: 129

Re: [Solved] efibootmgr not creating entries

It is possible that your disk identifiers changed, check that and boot with the March install medium in EFI mode, remount all partitions per the beginner's guide, including EFI and try the efibootmgr command from there. I couldn't get it to work from my running system and this is what I had to do.

Offline

#3 2013-04-07 17:31:43

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [Solved] efibootmgr not creating entries

mattbarszcz wrote:

So I went back to the live cd, I ran efibootmgr with no arguments, and sure enough there was only 1 entry for the Windows Boot Manager.  It seems that efibootmgr commands don't seem to take effect.

Because of bugs in efibootmgr and/or EFI implementations, efibootmgr doesn't always work. Using bcfg from an EFI shell or bcdedit in Windows can be more effective on some systems. That said, if efibootmgr worked for you before, I'm not sure why it would stop working, or why an existing entry might disappear. (Some EFIs do delete entries that they detect are no longer valid. This shouldn't have happened with a whole-disk dd copy, but if you duplicated the partition table and then used dd to copy partitions, it might well have happened to you. I suppose it's conceivable that the firmware detected the change from one physical disk to another, too, and deleted the original entry because of that change.)

I referenced the rEFInd page here: http://www.rodsbooks.com/refind/installing.html#windows and followed the procedure to install an entry for rEFInd from Windows.  I was able to add an entry no problem through windows.
...
Does anyone have any suggestions as to why this doesn't work?  Nothing has changed about the system other than the disk.

It's unclear from your post whether the entry you created in Windows now works. If it does, then don't sweat it; just keep using that entry, and if you need to make changes and efibootmgr doesn't work in the future, plan to use either Windows or the bcfg command from an EFI version 2 shell.

Offline

#4 2013-04-07 18:11:38

mattbarszcz
Member
Registered: 2012-06-25
Posts: 34

Re: [Solved] efibootmgr not creating entries

sidneyk wrote:

It is possible that your disk identifiers changed, check that and boot with the March install medium in EFI mode, remount all partitions per the beginner's guide, including EFI and try the efibootmgr command from there. I couldn't get it to work from my running system and this is what I had to do.

When I originally tried to use efibootmgr it was from the lastest April install medium doing following those steps.  Is there something different about the March media?

srs5694 wrote:

It's unclear from your post whether the entry you created in Windows now works. If it does, then don't sweat it; just keep using that entry, and if you need to make changes and efibootmgr doesn't work in the future, plan to use either Windows or the bcfg command from an EFI version 2 shell.

The entry I created in Windows does work, so I suppose it doesn't really matter. 

I just can't understand why it used to work, but doesn't any longer.  Unless it is just some oddly specific hardware compatibility issue.

Motherboard: Asus P8Z77-V LE Plus
Old Drive: OCZ Agility 4 256GB
New Drive: Samsung 840 Pro 256GB.

Last edited by mattbarszcz (2013-04-07 18:20:15)

Offline

#5 2013-04-07 18:33:52

mattbarszcz
Member
Registered: 2012-06-25
Posts: 34

Re: [Solved] efibootmgr not creating entries

I found a BIOS update for my motherboard (upgraded to 0901 from 0606).

The update claims it fixes:

1.Fix WINPE UEFI mode can't boot.
2.Fixed sometimes CPU ratio error.
3.Support new CPUs.

There must have been something broken in the UEFI implementation that ASUS knew about (and only surfaced for me when I changed drives) that was fixed in the update.  After applying the bios update efibootmgr works perfectly, I can add/delete entries without issue.

Hopefully this may help someone else with the same issue.

Offline

#6 2013-04-08 07:47:24

sidneyk
Member
From: Bonner Springs, KS. USA
Registered: 2011-04-22
Posts: 129

Re: [Solved] efibootmgr not creating entries

mattbarszcz wrote:
sidneyk wrote:

It is possible that your disk identifiers changed, check that and boot with the March install medium in EFI mode, remount all partitions per the beginner's guide, including EFI and try the efibootmgr command from there. I couldn't get it to work from my running system and this is what I had to do.

When I originally tried to use efibootmgr it was from the lastest April install medium doing following those steps.  Is there something different about the March media?

Other than being a month or so older, I don't know. I'm sure lots of files have probably changed. I do know that it uses a 3.7.x kernel where my system is using a 3.8.x kernel. I just know that I was trying to help someone else solve an issue with efibootmgr commands not seeming to stick and discovered that, even though I thought I had previously ran efibootmgr from my running system and made entries in my firmware boot manager, that it was now not working. I used the March media because I didn't have any newer ready yet and this was the one I used to set up my current Arch install. Once booted and partitions all mounted and chrooted, the same command ran fine and did what it was supposed to do creating a rEFInd entry in my firmware's boot manager.

Offline

#7 2013-04-15 01:40:27

ClientAlive
Member
Registered: 2013-04-04
Posts: 12

Re: [Solved] efibootmgr not creating entries

Sorry if this isn't perfectly on target, I didn't take the time to read the entire thread. I just went through problems adding a boot entry with efibootmgr (I'm just booting from the kernel stub w/ no bootloader). I found out that it's, apparently, due to a bug in the 2013.04.01 installer and/or efibootmanager in that installer. I rebooted, with the older 2013.03.01 installer, loaded my modules (efivars and whatever else), chrooted again, and performed that last step with it. Everything went without a hitch and the system now boots fine.

-hth

Offline

Board footer

Powered by FluxBB