PDA

View Full Version : [SOLVED] UEFI boot



u._newbie
February 20th, 2015, 02:52 AM
Got a new computer, no OS yet, wrote ubuntu-14.04.1-server-amd64.iso to an USB stick, booted and installed.
However, a reboot brings me to the Asus UEFI EZ BIOS screen. So far I have not succeeded in booting Ubuntu from disk.
Booting from USB again I can get a rescue shell prompt, but the utilities people advise (gdisk, boot-repair, boot-info) are not found. The network is not up yet. Gparted lists three partitions: bios_grub, ext4, swap v1 on a GPT table. The installation procedure said that GRUB had been installed on the MBR, which does not sound appropriate. Reinstall GRUB asks on which partition to install. Maybe the Ubuntu install should have created an ESP partition? If that is what I need, how do I create it?

fantab
February 20th, 2015, 06:14 AM
You have to install boot-repair (https://help.ubuntu.com/community/Boot-Repair) on you live ubuntu and use it.
Post the 'bootinfo summary' url generated by boot-repair here to see the details of your boot process.

u._newbie
February 20th, 2015, 02:48 PM
You have to install boot-repair (https://help.ubuntu.com/community/Boot-Repair) on you live ubuntu and use it.
Post the 'bootinfo summary' url generated by boot-repair here to see the details of your boot process.
Downloaded boot-repair-disk-64bit.iso and wrote it to USB stick (dd if=boot-repair-disk-64bit.iso of=/dev/sdc bs=1M).
Insert the stick and boot. Nothing happens: I get the BIOS screen. So it seems this image is not bootable like ubuntu-14.04.1-server-amd64.iso is. The question is: how to get a computer that can boot Ubuntu from disk. The secondary question: how to get a bootable USB stick with boot-repair.

oldfred
February 20th, 2015, 04:22 PM
Rather than download Boot-Repair directly download the Desktop version of Ubuntu and install Boot-Repair to it.

If you have a bios_grub partition, then you have installed in BIOS boot mode on a gpt partitioned drive. You then should just need to make sure you have UEFI turned off and/or BIOS/CSM boot mode turned on in UEFI.

Only if you install in UEFI mode would you have an efi partition.
I have not installed server version so do not know details. But with Desktop you have to boot in UEFI mode to install in UEFI mode.

u._newbie
February 20th, 2015, 04:41 PM
Rather than download Boot-Repair directly download the Desktop version of Ubuntu and install Boot-Repair to it.
If you have a bios_grub partition, then you have installed in BIOS boot mode on a gpt partitioned drive. You then should just need to make sure you have UEFI turned off and/or BIOS/CSM boot mode turned on in UEFI.
Only if you install in UEFI mode would you have an efi partition.
I installed Ubuntu from the image mentioned above. No questions were asked, no choices were made by me.
(But I will try again, just to be sure.)
It is not quite clear to me how I could install Boot-Repair into the Ubuntu desktop and make a bootable USB image.
As far as I can see, it is not possible to turn UEFI off. There are several possible CSM settings, and I think I tried them all.
During boot the word GRUB is never shown on the screen. I think the installed GRUB loader is in a place not encountered during boot.
That is why I asked what to do to get an ESP partition, if that is what I need.
I do not have Windows. I do not have a GUI, just a text screen and command line.

oldfred
February 20th, 2015, 05:10 PM
You just boot the Live Desktop version and install Boot-Repair to it with the ppa.
Boot Repair -Also handles LVM, GPT, separate /boot and UEFI dual boot.:
Precise, Trusty, Vivid, & Utopic all should work now with current ppa
https://help.ubuntu.com/community/Boot-Repair

From Live installer you can use gparted (boot flag) or use gdisk (ef00) and create an efi partition. UEFI suggests that efi partition should be first on drive, but most Windows installs make it second or even third partition, but not far into drive. Not sure if essential or not.
With Desktop I think you still have to install gdisk.
sudo apt-get install gdisk

http://www.rodsbooks.com/gdisk/

What system is this. Many vendors now modify UEFI to only boot the entry in UEFI that by desription says "Windows". That is not UEFI standard. Perhaps a Microsoft requirement?
But we have many work arounds. If only Ubuntu we can change the name of the grub entry in UEFI to Windows to match what UEFI expects. Or UEFI still boots a hard drive entry bootx64.efi and we make that be grub.

Several work arounds:

http://ubuntuforums.org/showthread.php?t=2234019

These were all desktop installs, adjust as you desire for a server install:

For the Total space you want for Ubuntu:
Ubuntu's standard install is just / (root) & swap, but it is better to add another partition for /home if allocating over 30GB.:
Only if gpt - all partitions in gpt are primary:
gpt: 300 MB efi FAT32 w/boot flag (for UEFI boot or future use for UEFI, you only can have one per drive, so if already existing do not attempt another)
gpt: 1 or 2 MB No Format w/bios_grub flag (for BIOS boot not required for UEFI)
for gpt(GUID) or MBR(msdos) partitioning
Ubuntu partitions - smaller root only where hard drive space is limited.
If total space less than about 30GB just use / not separate /home or standard install.
1. 10-25 GB Mountpoint / primary or logical beginning ext4
2. all but 2 GB Mountpoint /home logical beginning ext4
3. 2 GB Mountpoint swap logical

Depending on how much memory you have you may not absolutely need swap but having some is still recommended. I do not hibernate (boots fast enough for me) but if hibernating then you need swap equal to RAM in GiB not GB. And if dual booting with windows a shared NTFS partition is also recommended. But you usually cannot create that as part of the install, just leave some space. Or partition in advance (recommended).
One advantage of partitioning in advance is that the installer will use the swap space to speed up the install. Thanks Herman for the tip.
https://help.ubuntu.com/community/DiskSpace
suggested partitions for just Ubuntu on 3TB drive.
http://askubuntu.com/questions/336439/any-problems-with-this-partition-scheme
Another advanced suggestion from TheFu with Multiple / (root) - Post #5 similar to what I actually do
http://ubuntuforums.org/showthread.php?t=2170308
http://ubuntuforums.org/showthread.php?t=2021534

u._newbie
February 20th, 2015, 06:40 PM
Reinstalled Ubuntu. It seems the above installation iso and/or GRUB are broken in the sense that UEFI is never mentioned. Maybe I should file a bug. GRUB is installed in a place that is not visible during the boot process.
(The 2nd install differed a little from the first: the first time around the 4TB disk had been empty, this time there were partitions already and I told the install to use the entire disk. I'll try once more later, with hand partitioning.)

You just boot the Live Desktop version and install Boot-Repair to it with the ppa.
Since there is no network yet, instructions involving apt-get fail. But there is a nearby Ubuntu systen - I can transfer stuff on an USB stick. As mentioned, there is no gdisk. Bringing a copy from elsewhere failed on missing libicu*. Will try later with gdisk-noicu.

From Live installer you can use gparted (boot flag) and create an efi partition. UEFI suggests that efi partition should be first on drive, but most Windows installs make it second or even third partition, but not far into drive. Not sure if essential or not.
OK. Never used parted, and I haven't seen any instructions yet, but let us try. The first partition has flag bios_grub.

# parted
set 1 boot on
quit

Went back to the install and asked to reinstall grub in /dev/sda1. But "Fatal error: executing grub-install /dev/sda1 failed".
The reboot is again to the BIOS screen.
It would have been nice had grub-install revealed what went wrong. Reboot Live Ubuntu.

# grub-install /dev/sda1
Installing for i386-pc platform
error: unable to identify a filesystem in /dev/sda

I am not sure why there should be a filesystem in /dev/sda. It sounds like a non-UEFI complaint. So GRUB should be convinced to do things that are suitable in an UEFI environment.

What system is this.
This is an Intel i7 on an Asus Sabertooth Z97 Mark 2 motherboard.

But we have many work arounds.
:-) Yesterday I had hoped that installing Ubuntu was a matter of hours, but now I see it is a matter of days, with uncertain outcome.
Should have been warned: the Ubuntu community docs have heading "Easy via trial and error". Good. We try.

oldfred
February 20th, 2015, 07:41 PM
I have an Asus-AR and had a lot of issues with UEFI settings to get to to install the Desktop in UEFI mode. The only setting that actually worked was Other, not Windows on operating system, then in CSM settings to UEFI only. But it seemed very strange that I could only see UEFI settings under CSM. And I think Windows setting meant secure boot, where other was anything without secure boot.

The efi partition should be at least 100MB, better at 300MB, must be formatted FAT32 and with gparted/parted have boot flag.
The bios_grub partition must be unformatted, only needs to be 1 or 2MB and has bios_grub flag.
I create all new gpt drives, including flash drives with both and only use gpt unless it just is an install flash drive which I do not use anymore. I directly boot ISO from grub in a drive. I tried installing server once and then it would not use grub2's loopmount, but have seen that newer version should work that way.

Are you planning on having a gui with your server install? You can install minimal, or desktop and then add server components you want.

u._newbie
February 20th, 2015, 10:00 PM
The efi partition should be at least 100MB, better at 300MB, must be formatted FAT32 and with gparted/parted have boot flag. The bios_grub partition must be unformatted, only needs to be 1 or 2MB and has bios_grub flag.
I create all new gpt drives, including flash drives with both.
Good. Third install. Manual partitioning. Created 300 MB FAT32, 2 MB unformatted, 36 GB swap, 4 TB ext4. Used parted to change the FAT32 from msftdata to boot. Also copied gdisk-noicu. All libs are present.

# gdisk /dev/sda
MBR: protective
GPT: present
command: print
... EF00
... EF02
... 8200
... 8300

# grub-install /dev/sda1
Installing for i386-pc platform
grub-install: warning: filesystem FAT doesn't support embedding
grub-install: error: will not proceed with block lists

So, maybe the partitions are now OK. Still have to convince GRUB that it should forget about MBR things.

oldfred
February 20th, 2015, 11:16 PM
You still do not install grub to a partition. With UEFI it knows that boot files go into the efi partition, but you still specify sda. With BIOS you always must specify sda, unless you have another boot loader.

If you have a 4TB drive, you best have a smaller 25GB / (root) partition. Otherwise your boot files may be anywhere within / which means drive has to jump all over the place just to boot. Use rest of drive then as /home or data partition(s).

In it says it is installing for i386 platform that still is a BIOS boot.

u._newbie
February 20th, 2015, 11:40 PM
You have to install boot-repair (https://help.ubuntu.com/community/Boot-Repair) on you live ubuntu and use it.
Post the 'bootinfo summary' url generated by boot-repair here to see the details of your boot process.
I fixed my network connection, so apt-get works.

# add-apt-repository ppa:yannubuntu/boot-repair
# apt-get update
# apt-get install -y boot-repair
# boot-repair
Traceback (most recent call last):
File "/usr/bin/glade2script", line 48, in <module>
import gi
ImportError: No module named gi

It looks like boot-repair expects an environment different from that provided by ubuntu-14.04.1-server-amd64.iso.

u._newbie
February 21st, 2015, 12:00 AM
You still do not install grub to a partition. With UEFI it knows that boot files go into the efi partition, but you still specify sda. With BIOS you always must specify sda, unless you have another boot loader.

If you have a 4TB drive, you best have a smaller 25GB / (root) partition. Otherwise your boot files may be anywhere within / which means drive has to jump all over the place just to boot. Use rest of drive then as /home or data partition(s).

If it says it is installing for i386 platform that still is a BIOS boot.
My understanding is very limited, but I get the idea that GRUB should install its files in the FAT32 partition sda1.
(If so, I do not understand the remark about the root partition. If that remark is unrelated to booting, it is not interesting yet. First the system must boot from disk. When that works we can worry about efficiency.)
Searching for appropriate commands I find the suggestion to say

# grub-install --target=x86_64-efi --efi-directory=/x

where /x is the mount point of the FAT32 partition sda1.
This command returns the error message

Error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist

So - this Ubuntu install seems to have no UEFI-capable GRUB on board. Strange.
My network now works, so

# apt-get install grub-efi-amd64
# grub-install --target=x86_64-efi --efi-directory=/x

Error: /x doesn't look like an EFI partition.

Well - it is an empty FAT32 partition. Apparently there should be some files already?

u._newbie
February 21st, 2015, 12:30 AM
Installed ubuntu-14.04.1-server-amd64.iso. So far I have not succeeded in booting Ubuntu from disk.

You have to install boot-repair (https://help.ubuntu.com/community/Boot-Repair) on you live ubuntu and use it.

# boot-repair
ImportError: No module named gi

Maybe the missing part was python-gobject.

# apt-get install python-gobject
# boot-repair
<lots of error messages> Gtk-CRITICAL ...
/usr/share/boot-sav/gui-g25launch.sh line 29: 22295 Segmentation fault

There is no graphics environment on this server, but boot-repair tries to start one and crashes.

oldfred
February 21st, 2015, 12:36 AM
You installed in BIOS boot mode, so you have not UEFI nor files in efi partition.
You have to install grub to MBR of gpt drive to boot in BIOS mode.

You need to use Live installer or desktop version for Boot-Repair. Always good to have a working live system flash drive or DVD of current installed version to make repairs if system has issues.

You always specify drive like sda whether UEFI or BIOS, not a partition. Grub knows where to install its boot loader, but other major parts of grub are in /boot folder and /etc folder.

I think you have to boot in UEFI mode for UEFI updates to work. Boot-Repair does a convert from BIOS to UEFI by uninstalling grub-pc (BIOS) and installing grub-efi-amd64 (UEFI). But I think it is best to boot in UEFI mode.
I have seen users install server in UEFI mode, but do not know differences with Desktop as I only have Desktop.

The first part of Boot-Repairs Summary report is the old script bootinfoscript. I run this as part of my rsync backup so I have all the latest info on my configuration backed up. The updated fork is the version that will correctly parse the MBR with new grub2 versions.

Updated fork as bootinfoscript does not seem to be maintained
https://github.com/arvidjaar/bootinfoscript
Boot Info Script courtesy of forum members meierfra & Gert Hulselmans
Boot Info Script 0.61 is released April 2, 2012
boot_info_script.sh" file renamed to "bootinfoscript
http://sourceforge.net/projects/bootinfoscript/files/latest/download
Page with instructions and link to above download:
http://bootinfoscript.sourceforge.net/

u._newbie
February 21st, 2015, 01:37 AM
bootinfoscript
Thank you! So far I was trying things blindly. This gives me one eye.
I have not yet found the other eye, with info on the UEFI status.

u._newbie
February 21st, 2015, 04:11 AM
You installed in BIOS boot mode, so you have not UEFI nor files in efi partition.
You have to install grub to MBR of gpt drive to boot in BIOS mode.
Installed for the 4th time. Now with 5 partitions (300 MB FAT32, 2 MB biosgrub, 40 GB ext4 on /, 40 GB swap, 4 TB ext4 on /home).
GRUB installed in MBR as before. Bootinfo says:
GRUB2 is installed in the MBR, looks at sector 585728 for core.img. core.img is at this location and looks in partition 112 for .
I don't know what to think about that second sentence.

Booted some fifty times with various combinations of BIOS options, but every boot from disk booted to the BIOS screen. The word GRUB has never appeared on the screen.

Since you advise boot-repair, and that requires a GUI, I suppose I'll give up on this server install, and try a desktop version.

I wondered: 4 TB is 2^42 bytes, 2^33 512-byte sectors. Could it be that the Ubuntu install still thinks that the number of sectors fits in an (unsigned) integer?

fantab
February 21st, 2015, 04:39 AM
The FAT32 EFI System Partition [ESP] MUST carry the 'boot' flag. If it does not have the 'boot' flag it will not be used.
Remove the 'bios_grub' flag from the 2Mb partition so the installer doesn't use it.
Also Ubuntu installs the way its booted. Meaning, if the install media boots in BIOS/Legacy mode then it will only install in that mode.
If it boot in UEFI mode then only will the grub install to ESP. Identifying which mode the live ubuntu media boots in (https://help.ubuntu.com/community/UEFI#Identifying_if_the_computer_boots_the_Ubuntu_ DVD_in_EFI_mode)...

Check your UEFI/Bios menu and set the boot to UEFI....

How old is your Mobo?
You haven't yet posted the 'bootinfo summary'.

oldfred
February 21st, 2015, 05:35 AM
You must have used an older copy of bootinfoscript. That issue of not showing correct partition with newer grub2 is from the older script. The new fork has just a couple of minor changes that fix that issue and will show correct partition numbers. And Boot-Repair now uses the newer version as part of its Summary Report.

With one install, you do not get grub menu, normally. With a BIOS install you have to hold shift key, with UEFI install you have to press escape key, before grub menu would appear or while UEFI/BIOS is ending. Then you should get menu.
If reverting back to UEFI/BIOS then you have not installed correctly or installed in one mode but are default booting in the other mode.
It is relatively easy to boot installer in BIOS mode but still have UEFI set as default. Then system will not boot as if you boot installer in BIOS mode it installs in BIOS Mode. But if default boot is UEFI it may not see the install to boot. Vice-versa also. Check mode installed and settings in UEFI.

u._newbie
February 21st, 2015, 05:56 AM
The FAT32 EFI System Partition [ESP] MUST carry the 'boot' flag.
I created it by hand and gave it that flag. But since no EFI code is installed, it probably doesnt matter.

Also Ubuntu installs the way its booted. Meaning, if the install media boots in BIOS/Legacy mode then it will only install in that mode.If it boot in UEFI mode then only will the grub install to ESP. Identifying which mode the live ubuntu media boots in (https://help.ubuntu.com/community/UEFI#Identifying_if_the_computer_boots_the_Ubuntu_ DVD_in_EFI_mode)...
After booting from USB, the system is not in UEFI mode. It looks like a boot from disk must be in UEFI mode.
Perhaps that is another reason why Ubuntu install will always fail.

Check your UEFI/Bios menu and set the boot to UEFI....
There is no such easy choice...

How old is your Mobo?
I got it yesterday or the day before. The BIOS software on it is dated 2014-05-29.

You haven't yet posted the 'bootinfo summary'.
I have posted that the utility boot-repair crashes.

u._newbie
February 21st, 2015, 06:16 AM
You must have used an older copy of bootinfoscript. That issue of not showing correct partition with newer grub2 is from the older script. The new fork has just a couple of minor changes that fix that issue and will show correct partition numbers. And Boot-Repair now uses the newer version as part of its Summary Report.

With one install, you do not get grub menu, normally. With a BIOS install you have to hold shift key, with UEFI install you have to press escape key, before grub menu would appear or while UEFI/BIOS is ending. Then you should get menu.
If reverting back to UEFI/BIOS then you have not installed correctly or installed in one mode but are default booting in the other mode.
It is relatively easy to boot installer in BIOS mode but still have UEFI set as default. Then system will not boot as if you boot installer in BIOS mode it installs in BIOS Mode. But if default boot is UEFI it may not see the install to boot. Vice-versa also. Check mode installed and settings in UEFI.

Removed the bios_grub flag. Reinstall GRUB. Fatal Error. Same from a shell prompt:

# grub-install /dev/sda
Warning: this GPT partition label contains no BIOS boot partition.
Error: will not proceed.

Added the bios_grub flag again. Reinstall GRUB. No error.
Holding down Shift or Esc makes no difference. This BIOS does not boot from MBR, I think.

Bootinfoscript says:
VERSION='0.61';
RELEASE_DATE='1 April 2012';

u._newbie
February 21st, 2015, 06:35 AM
This BIOS does not boot from MBR, I think.
Aha, it does! The trick was to make the covering MBR partition bootable.
Very good. And many thanks for the help!
I hope to play a bit more with BIOS settings later, and come with a final report.

kerry_s
February 21st, 2015, 07:35 AM
You still do not install grub to a partition. With UEFI it knows that boot files go into the efi partition, but you still specify sda. With BIOS you always must specify sda, unless you have another boot loader.

If you have a 4TB drive, you best have a smaller 25GB / (root) partition. Otherwise your boot files may be anywhere within / which means drive has to jump all over the place just to boot. Use rest of drive then as /home or data partition(s).

In it says it is installing for i386 platform that still is a BIOS boot.


so is that a 32bit bios trying to boot a 64bit ubuntu kind of deal ? just curios, cause i wanted to get a zbox pico & the bios is 32bit, but i read there is no 32bit uefi yet.

nevermind i see he got it while i was posting.

u._newbie
February 21st, 2015, 02:06 PM
The first part of Boot-Repairs Summary report is the old script bootinfoscript.

Updated fork as bootinfoscript does not seem to be maintained
https://github.com/arvidjaar/bootinfoscript
Boot Info Script courtesy of forum members meierfra & Gert Hulselmans
Boot Info Script 0.61 is released April 2, 2012
boot_info_script.sh" file renamed to "bootinfoscript
http://sourceforge.net/projects/bootinfoscript/files/latest/download
Page with instructions and link to above download:
http://bootinfoscript.sourceforge.net/

You must have used an older copy of bootinfoscript.
I misparsed your first post (read it as saying that there was a no longer maintained github version, and an updated sourceforge fork, where you meant the opposite). Maybe there is no reason today to mention any sourceforge link or history. I just tried the github version, and it was fine.

u._newbie
February 21st, 2015, 02:46 PM
Got a new computer, no OS yet, wrote ubuntu-14.04.1-server-amd64.iso to an USB stick, booted and installed.
However, a reboot brings me to the Asus UEFI EZ BIOS screen. So far I have not succeeded in booting Ubuntu from disk.

The trick was to make the covering MBR partition bootable.

The Asus Sabertooth Z97 Mark 2 motherboard has a BIOS with lots of options. As it turns out, leaving everything in the default state was OK. No reason to fiddle with Secure Boot or CSM (which is enabled by default) for the present situation where GRUB is installed in the MBR.
But the BIOS probing that discovers bootable devices needs the Boot flag on the MBR partition entry (of type ee) that covers the GPT partition table. Set it using fdisk (the a command).

fantab
February 21st, 2015, 05:16 PM
I am glad that you figured it out.
Grub, unlike Windows, doesn't require a 'boot' flag on MBR. I think the issue is with the OEM BIOS/UEFI firmware.