PDA

View Full Version : [ubuntu] 12.04 install seemed OK, won't boot



ruberad
June 18th, 2014, 06:04 AM
Hey all,

I just got a NUC, it was super easy to slap in the 180gb SSD and 4+4GB ram, I had 12.04 ready to go on a USB stick, went through the install, everything seemed to go ok, but when I took the USB out and tried to boot, it seems to not be able to find anything to boot from. I tried to play around with boot settings in BIOS (turn off UEFI and rely on "Legacy", I see the SSD listed in there, but when I try to boot it gives an error message something like wrong boot device or boot device not found or insert boot device and hit a key or something like that. And actually before that, it prints the mac address and spins for a while saying "DHCP")

I'm thinking the error might have to do with how I set up the partitioning. I have an 180GB SSD, I want partitions for /, /home, and /data, I also need swap of course, and an error message told me I need at least 35MB of EFI. I was confused about whether to do primary or logical, what I ended up doing was this (I can see this in the Disks utility when booting off the "live USB")

1mb free (I couldn't get it to not waste 1mb free space before and after)
sda1 499mb EFI
sda2 29GB ext4 /
sda3 15GB swap
sda4 35GB ext4 /home
sda5 100GB ext4 /data
1mb free

I chose "logical" for all of them, because I saw something on the webz about no more than 4 primary partitions allowed. Should I have made at least one primary?

(The reason I want partitioning like this is so if necessary I can reinstall the entire OS to the / partition without mounting /home or /data, and then get change the mounting after the reinstall is OK)

Also in the disk utility, I can see that it says for the USB live drive that it is "Bootable" (and W95 FAT32), but none of the partitions on the SSD have a Partition Type that is described as "bootable". Also I was able to mount the EFI partiition, and it has a directory EFI/ubuntu/ with four files: grub.cfg, grubx64.efi, MokManager.efi, and shimx64.efi. The contents of grub.cfg is small:


search.fs_uuid 2d36fa61-8275-4269-b67d-33d343f03b81 root hd0,gpt2
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

That's all I can think of that might be relevant, I'd appreciate any pointers about an appropriate way to repartition (I'm ok with redoing the install from scratch), or step-by-step instructions how to get into the grub menu (I can get that when booting from the USB) and force a boot from the SSD, and what changes would be necessary to make it stick)

thanks in advance!

TheFu
June 18th, 2014, 12:27 PM
TL;DR.

Please post the boot-info created link back here for more help.
Sometimes a BIOS will install the boot record to the flash drive - which isn't what we want, but ....

Either use UEFI or don't. This is a machine setting. It is too much hassle to enable/disable for every OS on a multi-boot machine. Also, re-reading the Ubuntu UEFI how-to may be helpful.

ruberad
June 18th, 2014, 02:47 PM
Hey thanks, I had never heard of UEFI before, reading the howto was informative. Since I have no other OS going on this computer I think I will just start over and do legacy only; one less partition.

And research some more about how to best set up primary/logical/extended partitions.

Will try this tonight.

TheFu
June 18th, 2014, 03:21 PM
If using GPT (not MBR) partitioning, then extended and logical are not used. GPT only has primary partitions. Linux will work with GPT and not UEFI. It is Windows that requires UEFI with GPT. I prefer GPT partitioning over MBR - it is simplier. If you ever intend to boot Windows, then you'll want UEFI+GPT. Set that up now.

If you do want to go "legacy" and MBR, then you'll need to reformat the entire HDD for MBR partitioning. With just Linux, no need to worry about extended+logical partitions. There are 4 primary to work with -
/ - 20G or so (just for programs+settings)
swap 2G or equal to RAM in system (depends on if you hibernate or not.
/home - whatever is left for your stuff + data
is all you need.

ruberad
June 19th, 2014, 01:01 AM
thx for advice. I definitely intend to NEVER install windoze. So I will go ahead and use up the 4 primary on /, swap, /home, /data. Is there any kind of switch in there to force MBR vs GPT? Or does the installer just automagically decide based on whether there are any EFI partitions?

ruberad
June 19th, 2014, 04:30 AM
OK I tried it, about the same results. After finalizing my partitioning in the installer and trying to advance to the next installer screen (timezone I think), it gave me a stern warning again about needing an EFI partition at least 35mb or boot may not work, you may be able to repair boot later. I ignored it. Finished install. Same behavior. Attempted bootup without USB shows


Intel(R) Boot Agent, etc
Initializing and establishing a link
CLIENT MAC ADDR: etc
DHCP... <spin for 30sec>

PXE-E53: No boot filename received

PXE-M0F: Exiting Intel BOot Agent.

Reboot and Select proper Boot device
or Insert Boot Media in selected Boot devince and press a key

I booted back into liveUSB, opened the disks utility, and once again no partition was "bootable". I changed the /dev/sda (/) partition with the check flag for "legacy bootable". Still no joy.

Booted back into liveUSB again, followed online instructions for boot-info, here is the link: http://paste.ubuntu.com/7666927/

oldfred
June 19th, 2014, 05:02 AM
With UEFI the FAT32 formatted partition must have the boot flag if using gparted to create it. It is not like a boot flag in BIOS which defines which partition is the Windows boot partition, but is the UEFI ESP or efi partition. It actually has a very long GUID which tells the UEFI that it will find efi boot files in it.
Only one efi partition per drive, usually Windows creates a 100MB one, but suggest somewhat larger at 300MB or so.
If having / of 29GB and /home of 35GB, but most data is going into data partition I might not have a separate /home. My /home is 2GB with 3/4s of that being .wine. So when all data is elsewhere you can easily backup /home for a new install. We suggest /home as separate partition as setting up data partitions can not be done as part of install and a new user may have issues creating a separate partition and mounting it with fstab and linking data back into /home.

Intel has released many fixes to kernel, support software and video drivers. But much of that has only made it into the 14.04 release. Some new systems even work better using the kernel & support software from future release.

Intel NUC
http://blog.dustinkirkland.com/2013/12/everything-you-need-to-know-about-intel.html
http://blog.dustinkirkland.com/2013/12/why-i-returned-all-of-my-i3-intel-nucs.html
http://www.phoronix.com/scan.php?page=article&item=intel_baytrail_nuc&num=1
UEFI - in efi partition Manual copy grubx64.efi to bootx64.efi to make it work.
http://arstechnica.com/gadgets/2014/02/linux-on-the-nuc-using-ubuntu-mint-fedora-and-the-steamos-beta/
BIOS update fixes some issues
http://arstechnica.com/gadgets/2014/02/new-intel-nuc-bios-update-fixes-steamos-other-linux-booting-problems/

ruberad
June 19th, 2014, 05:09 AM
Well on advice from TheFu above, since I do not have windoze and never will, I was aiming to skip EFI altogether and go pure legacy. But that doesn't seem to be working either.

I will take a look at your links, thx,

r

ruberad
June 19th, 2014, 05:33 AM
That arstechnica link looked promising; symptoms sound like mine, I followed the link to intel, it listed my specific NUC kit (D34010WYK) so I got and applied the BIOS update, but no joy.

TheFu
June 19th, 2014, 09:56 AM
thx for advice. I definitely intend to NEVER install windoze. So I will go ahead and use up the 4 primary on /, swap, /home, /data. Is there any kind of switch in there to force MBR vs GPT? Or does the installer just automagically decide based on whether there are any EFI partitions?

There are many moving parts here. Your HDD is already formatted with GPT, so it would be easiest to
* keep that.
* create a "bios_grub" partition to hold UEFI boot info
* create the other partitions as desired

Here's an example of 12.04 system with GPT, legacy boot (non-UEFI system), LVM:

$ sudo parted -l
Model: ATA HGST HMS5C4040AL (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 258MB 256MB ext2
3 258MB 4001GB 4001GB lvm

Here's an example 14.04, GPT, legacy boot (UEFI system), no LVM (on a wiped C720 chromebook):

$ sudo parted -l
Model: ATA SC2 M2 SSD (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 17.8MB 16.8MB bios_grub
7 17.8MB 91.0GB 91.0GB ext4 ROOT-C
15 107GB 126GB 18.8GB ext4
2 126GB 128GB 2202MB linux-swap(v1)

The high partition numbering is because ChromeOS creates lots and lots of little partitions that I've since removed. It wasn't worth fighting to move sda7 to sda1 to me.

Anyway, I hope you see that a small partition is needed for GPT boots (sda1) whether the system is legacy or UEFI booted.

I should point out that both of these systems are NOT desktops, nor are they main systems. DO NOT COPY the partition sizes. The first 1 is a media playback XBMC+Plex+NFS server box. The 2nd is a travel netbook, that could use some partition/data fixing. The other systems here are all MBR boot.

oldfred
June 19th, 2014, 04:58 PM
If UEFI you need the FAT32 with boot flag, If BIOS you need bios_grub unformatted partition.

This is my 64SSD. I only have BIOS but planned on moving it to a UEFI system when I configured it. With gdisk a ef00 is the efi partition and an ef02 is a bios_grub partition where parted & gparted use boot flag for efi and bios_grub flag.


fred@fred-Precise:~$ sudo gdisk -l /dev/sdd
[sudo] password for fred:
GPT fdisk (gdisk) version 0.8.1

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

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdd: 117231408 sectors, 55.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 85A657E7-D379-4592-B060-E8EA09953D80
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 117231374
Partitions will be aligned on 2048-sector boundaries
Total free space is 3645 sectors (1.8 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 616447 300.0 MiB EF00
2 616448 618495 1024.0 KiB EF02
3 618496 58925055 27.8 GiB 8300 Precise
4 58925056 117229743 27.8 GiB 8300 TrustySSD

ruberad
June 19th, 2014, 05:28 PM
Thx both for detailed info.

Sorry to be stupid, but where does this "bios_grub" flag come from? In the partition editor inside the 14.04 installer, all I see is primary/logical. Is that another choice of filesystem type like ext4/fat32/swap?

Should I use liveUSB + gparted to partition & format the disk, and then go through the installer and let it use that disk? Maybe even let Linux do its own thing, putting the whole shebang on one partition (I guess plus a bios_grub partition), and then after it's able to boot, then mess with fstab to get my extra partitions the way I want them.

oldfred
June 19th, 2014, 05:56 PM
If you just install in BIOS mode, it should auto create it. But if you partition in advance with gparted you have to create a 1 or 2MB unformatted partition and right click to set bios_grub flag.
If installing UEFI mode it should also auto create a FAT32 efi partition, but I do not know what size it will default to.

I just prefer to partition in advance with gparted and add both efi & bios_grub partitions. Then you can easily install in either mode. Gparted is a bit easier to work with than installer, but you still have to use Something else and choose mount for / (root) at the minimum and format like ext4. If partitions are created in advance you click change not + or -.

I used gparted and selected gpt under device, advanced & select gpt over msdos(MBR) default partitioning....
You do not want MBR partitioning.

You can actually install to boot in either mode. This was a flash drive but same procedure would apply to any device.

Flash drive to boot in UEFI or BIOS - sudodus
https://help.ubuntu.com/community/Installation/UEFI-and-BIOS

GParted partitioning software - Full tutorial
http://www.dedoimedo.com/computers/gparted.html
Screenshots of using gparted
http://www.howtoforge.com/partitioning_with_gparted

ruberad
June 19th, 2014, 07:19 PM
I recognize those three screens from the installer -- what is BIOS or UEFI "mode" of installation? Is there a choice somewhere that you make?

1 or 2 mb unformatted partition: is that why the installer partition editor leaves 1mb of free space in front of my first partition no matter what?

Looking at one of your links, I see the statement "Boot into UEFI mode from the install drive" -- what does that mean? wrangle the bios to force liveUSB booting to use UEFI vs BIOS? Does the liveUSB have both EFI and grub_bios "partitions"? And then depending on which way the computer boots the liveUSB, that's the way the installer wants to set up linux booting?

oldfred
June 19th, 2014, 07:46 PM
BIOS & UEFI are not compatible, so once you start booting from UEFI/BIOS menu you cannot change modes. So how you boot flash drive or DVD is how it installs. Boot-Repair or manual commands to change grub from UEFI to BIOS can be done but only if drive is gpt partitioned.

Normally installer will not use gpt unless drive is somewhat over 1TB and empty or over 2TiB and then gpt is required or if installing in UEFI boot mode which requires gpt.

The space at the beginning of a BIOS/MBR drive is for compatiblitiy with new SSDs or new 4K drives.
First, understand that most partitioning tools have moved to a policy of aligning partitions on 1 MiB (2048-sector) boundaries as a way of improving performance with some types of arrays and some types of new hard disks (those with 4096-byte physical sectors). See article by srs5694:
http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
Post on 8-sector boundaries alignment by srs5694
http://ubuntuforums.org/showthread.php?t=1685666

Live installer is both BIOS using syslinux boot loader in MBR and grub since installer is FAT32 UEFI will look for a /efi/boot folder for efi boot files which also exists on installer. You should see two boot options from UEFI menu for flash drive. One usually is clearly UEFI and the other just may have label or name of flash drive but is the BIOS boot mode.

Shows install with screen shots for both BIOS(purple) & UEFI(grub menu), so you know which you are using.
https://help.ubuntu.com/community/UEFI

Others have posted some screens, your may not look the same but should have similar boot options somewhere in UEFI boot screen. Some have to turn on a setting to allow UEFI booting of flash drive for security reasons. And some even have to set a password, but if you have to set password never ever lose that or you may lock system permanently.

ruberad
June 21st, 2014, 01:06 AM
OK progress, went around a couple times trying different schemes like that, it still wasn't booting, but I discovered that in my BIOS, there's two "tabs" (this is the window-iest bios I've ever seen!), one for UEFI (which I have unchecked) and one for Legacy; the Legacy one has a rectangle that "sees" my SSD (and the label includes "boot" -- don't know why it doesn't just boot it); I can double click on that thingy, it asks if I want to save BIOS before booting, I say yes, and it reboots successfully into Ubuntu!

So that's my workaround, I'd like of course to get it to do it the first time around (I've tested rebooting, it gets stuck again as above, I have to reboot, F2 to get into BIOS, then double-click on the SSD to reboot into it).

FYI, here's my partition info from parted -l
Model: ATA INTEL SSDMCEAW18 (scsi)
Disk /dev/sda: 180GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 20.0GB 20.0GB ext4
3 20.0GB 36.0GB 16.0GB linux-swap(v1)
4 36.0GB 66.0GB 30.0GB ext4
5 66.0GB 180GB 114GB ext4


If it would be helpful, I can install and run that boot-repair thing and paste a new link again

ruberad
June 21st, 2014, 01:20 AM
oopx, duplicate comment edited away

oldfred
June 21st, 2014, 04:34 AM
Do not know about NUC specifically. But what I have seen was all UEFI with the latest version of Ubuntu as that includes many of the Intel fixes for various Intel systems.

I might add an efi partition even if you want to force system in BIOS mode. Some Intel systems will not boot without a partition with a boot flag. Or later you may want to experiment with UEFI. And then when system is fully configured it is difficult to add an efi at beginning of the drive.

TheFu
June 21st, 2014, 11:49 AM
Yeah - there are many buggy BIOS implementations out there still that do not follow the specs, especially around booting GPT disks. Some assume that UEFI is required to boot GPT - that is NOT in the specs.