Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've a HP Pavilion g6 2320tx laptop with pre installed Windows 8.

While installing Ubuntu 13.04 64-bit from a USB created with pendrive linux, I didn't get the option to do partition like the one shown in: http://www.ubuntu.com/download/desktop/install-desktop-latest.

I had an unallocated space of 42 GB in my hard disk. The installation used that space. I couldn't boot Ubuntu. I corrected it using boot repair, but I get a lot of extra options than the normal grub screen. The boot repair link is: http://paste.ubuntu.com/5725287/.

Is it possible that the installation went wrong because I had unallocated space and so didn't use the partition during installation?

share|improve this question
1  
To get the option to do partitioning, you had to choose the option "Something else" when installing Ubuntu. When there's unallocated (free) space on your hard disk at the time of installing Ubuntu, you get an option that says "Install Ubuntu alongside Windows". If you choose that option, Ubuntu will use all of that unallocated space and install itself there. So, what option did you choose when installing Ubuntu? –  Alaa Jun 3 '13 at 6:31
    
yes, I chose "Install Ubuntu alongside Windows". So its okay to use the unallocated space ? I mean having that unallocated space couldnt be any reason for error ? –  abhivij Jun 3 '13 at 6:43
2  
Okay, that option automatically uses up the unallocated space on your hard disk to install Ubuntu. And (I have very little knowledge about this Windows 8 dual-booting thing, but) since you had Windows 8 pre-installed, something went wrong with booting and all that UEFI fiasco, but you fixed it. So, if your intention was to install Ubuntu in that space, then it has been done successfully. If your intention was to use another partition and to do some partition editing yourself, then you should have chosen the "Something else" option. –  Alaa Jun 3 '13 at 6:56
    
@Alaa : My intention was indeed to install ubuntu in that space but installation wasnt successful. I used boot repair but I dont get the usual boot screen. What can I do to get the usual boot screen ? –  abhivij Jun 3 '13 at 12:51
1  
Could you edit your question to include a photo of the grub menu? –  chaskes Jun 3 '13 at 16:05
show 3 more comments

1 Answer

up vote 0 down vote accepted

The short answer is: No, the presence or absence of unallocated space has nothing to do with the subsequent boot problems you encountered.

To install Linux, the disk must contain either unallocated space in which the Linux installer can create partitions or partitions that already exist and that the installer can take over for use by Linux. If the disk contains neither of these, the installer will shrink an existing partition to make room for Linux. The details of which of these options is best supported and how they're done depend on the distribution and the options you choose during installation. Although the choices you (or the installation program) make during installation can affect the boot process, a complete failure to boot after installation indicates a bug.

On a working EFI-based computer, the computer's NVRAM holds a list of boot loaders and the order in which they're to be used. Thus, you can set GRUB to boot before Microsoft's boot loader, as an example. In your case, many EFI-based HP computers are known to have a bug that makes them ignore EFI boot variables. Instead, the computer blindly boots the Windows boot loader (EFI/Microsoft/Boot/bootmgfw.efi). This is almost certainly the problem that you encountered.

Ubuntu's Boot Repair tool juggles the boot loaders, moving Microsoft's boot loader to another name and placing a copy of GRUB where the Microsoft boot loader used to reside. It makes several other similar changes. The end result is, as you've observed, an explosion in the number of boot entries on the GRUB menu. If you were using a non-buggy EFI, I'd recommend undoing the Boot Repair changes by re-running it and using the "Restore EFI Backups" options on its advanced menu, as described here. If you do this, though, you'll wind up back with a computer that boots straight to Windows. You might still want to do this and then do a less ham-fisted repair yourself, in any of three ways:

  • You can boot to Windows and use Windows' own bcdedit command to set GRUB as the default boot loader. Open an Administrator Command Prompt window and type bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi. (This assumes that you've disabled Secure Boot. If it's enabled, substitute shimx64.efi for grubx64.efi in this command.) This option might not work, but if it does, it will result in GRUB starting up by default and showing fewer boot options.
  • You can boot a Linux emergency disc, mount the ESP somewhere convenient, copy EFI/Microsoft/Boot/bootmgfw.efi to some other name (I recommend moving it down one level), and copying EFI/ubuntu/grubx64.efi to EFI/Microsoft/Boot/bootmgfw.efi. (If you're booting with Secure Boot active, copy shimx64.efi over bootmgfw.efi and also place a copy of grubx64.efi, under that name, in the EFI/Microsoft/Boot directory.) You'll also need to run update-grub to have GRUB regenerate its boot list and create an option to boot Windows.
  • After undoing the Boot Repair operation from your regular Ubuntu setup but before rebooting, install the Debian package of rEFInd. Once it's installed, type sudo mvrefind.sh /boot/efi/EFI/refind /boot/efi/EFI/Microsoft/Boot. This places rEFInd as the default boot loader in place of Microsoft's boot loader, using a hack that's similar to what Boot Repair does; but it should result in fewer redundant boot entries. There are likely to be at least two ways to boot Linux, though: One via GRUB and one more directly. If both work, you can uninstall GRUB (and perhaps manually delete its /boot/efi/EFI/ubuntu/grubx64.efi file) to remove the GRUB entry. Note that this option requires additional steps if you're booting with Secure Boot active.

Note that you need to do only one of these things, although if you try one and it doesn't work, you can try another one. I recommend backing up the entire ESP before you begin so that if you make a mistake, you can restore the original state of the ESP. A simple file-level copy or creating a tarball should suffice for the backup.

share|improve this answer
    
I've used rEFInd and its been working fine for quite some days. Thanks for that. Now I get 2 options for ubuntu and 1 for windows. But Windows button does not have the windows logo but the unknown type logo in rEFInd boot screen. And every time I choose Ubuntu from GRUB(after rEFInd) I get a black screen with the message [15.80871] kvm disabled by BIOS .(the number keeps changing each time). Should I be bothered about these 2 things ? Thanks again. –  abhivij Jun 7 '13 at 12:21
    
yesterday when I changed the time for POST from 5 sec to 0 sec, I got another graphic icon for ubuntu in boot screen. I also had done some updates in ubuntu. maybe because of that. I changed the time for POST back to 5 sec, but that icon is still there. Will the number of icons keep increasing this way ? And another issue is , in w8 I see 5 hours battery. But in ubuntu maximum is 2 hours. –  abhivij Jun 12 '13 at 14:34
    
It's probably best to just not worry about the Windows icon issue. It's probably fixable, but it's not 100% clear how your system is configured, so I can't provide detailed instructions on correcting the problem. You could always remove GRUB if you want to remove its icon, or use the dont_scan_dirs or dont_scan_files option in refind.conf to remove its icon from rEFInd's menu. As to your battery life, that's not a boot issue, so you should post another question about it. –  Rod Smith Jun 13 '13 at 19:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.