5

I use Ubuntu 14.04 (alone, no dual boot) and today it installed a new kernel (3.13.0-49). For some reason, it did not work well with my system, the mouse did not respond, and neither did my network. So I booted using an older kernel (3.13.0-37) and it worked fine.

But every time I booted I had to press shift and choose the working kernel, so I looked around on how to configure my boot so it loaded the previous one.

Not knowing exactly what I was doing, i followed the steps on this thread, basically editing the /etc/default/grub file where it read GRUB_DEFAULT=0 to GRUB_DEFAULT=2. And then running sudo update-grub on Terminal.

Then I restarted my PC and all I got was the ASUS UEFI BIOS Utility. No Grub, no Ubuntu, no nothing. Holding shift or c did not do anything. I made a Live USB from a freshly downloaded .iso of Ubuntu and now I'm running Ubuntu from the USB drive. But I can't recover my old grub file (I did had it backed up before messing with it). I can access my HDD, with three partitions: sda1, where I think (as I am very ignorant in these matters) my PC boots from; sda2 (not sure what it is) and sda3, where most of my files are, but it is in a file system called "crypto_LUKS"

I got this by reading in the BootInfo summary from boot-repair.

I've tried solving the problem three different ways:

  1. using boot-repair recommended repair (like this) -- it says it finds the /boot, says it does the repairing, but after booting I just go back to my UEFI BIOS. If I choose "advanced options" I cannot see anything under the tabs "GRUB location", "GRUB options" or "MBR options".

  2. following these steps (answer #2) via terminal. After trying

    sudo mount /dev/sda1 /mnt and

    sudo grub-install --root-directory=/mnt /dev/sda

(with both sda1 and sda3), I get

Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.
  1. editing the grub file in my sda3 (now in /media/ubuntu/5810cd14-bf74-4b7d-a312-81129f4bc7aa/etc/default) back to the way it was, which I managed to do using sudo su (the drive was read-only) -- but then when I try to run sudo update-grub it gives me the following error message: "/usr/sbin/grub-probe: error: failed to get canonical path of `/cow'."

What should I do? I really don't want to reinstall Ubuntu, all my files seem to be intact and all I need to do is get my system to boot! I can't believe I'm in all this mess by simply (and stupidly) editing a single character in a single file.


EDIT:

I combined oldfred's link about UEFI boot repairing with the other one I had posted, about encrypted partitions boot repairing and did get grup-install to run installing grub-efi-amd64.

Then I got an error message saying I should change my /etc/default/grub config file to include the line GRUB_ENABLE_CRYPTODISK=1. Did it and it did not work. Then I've seen here there's a bug, the correct line would be GRUB_ENABLE_CRYPTODISK=y.

Did it and got yet another error message I can't recall now. Got fed up after two days working on this and reinstalled Ubuntu with a fresh format. Working well since then, although booting is taking a little longer since then.

angrato
  • 86
  • From Boot-Repair run the Summary report and post above the link it gives, so we can see details. But it sounds like an UEFI install and now you are trying to boot or repair in BIOS mode. Report will give us details. – oldfred Apr 23 '15 at 03:47
  • http://paste.ubuntu.com/10869407/ – angrato Apr 23 '15 at 03:54
  • You have an UEFI system with efi, /boot & LVM install partition with full drive encryption. I do not know LVM nor encryption, but with Boot-Repair or any manual repairs you must use pass phase to unencrypt partitions so you can update them. Be sure to always boot in UEFI mode especially when making repairs. – oldfred Apr 23 '15 at 15:20
  • OK, so knowing that that's trhe problem, how do I go about solving it? Let me state that I am almost completely ignorant as to what I'm doing here. – angrato Apr 23 '15 at 16:45
  • I followed this and got to the point where I can activate my partitions, but I don't know which of them should I mount in order to run install-grub and update-grub. – angrato Apr 23 '15 at 18:30
  • My ls -la /dev/mapper results are: lrwxrwxrwx 1 root root 7 Apr 23 18:19 luks-98484e8b-b595-4b21-86cc-2a882c7afddb -> ../dm-0 lrwxrwxrwx 1 root root 7 Apr 23 18:19 ubuntu--vg-root -> ../dm-1 lrwxrwxrwx 1 root root 7 Apr 23 18:19 ubuntu--vg-swap_1 -> ../dm-2 – angrato Apr 23 '15 at 18:31
  • Your sudo grub-install that said installing for i386-pc is the grub-pc version for BIOS boot. You need to be sure to install grub-efi-amd64 for UEFI boot. You should have only gottine the grub-pc version if booted in BIOS mode, unless somehow update uninstalled UEFI and installed BIOS by mistake?? If so that is a bug. – oldfred Apr 23 '15 at 18:52
  • How do I force grub-install to install grub-efi-amd64 instead of i386-pc? – angrato Apr 23 '15 at 20:46
  • IF you boot Boot-Repair in UEFI mode it should work. Or you need to chroot, but use your LVM and decrypted partitions as mounts. Do not know enough about LVM to help otherwise. http://askubuntu.com/questions/53578/can-i-install-in-uefi-mode-with-the-alternate-installer/57380#57380 Some more info: http://askubuntu.com/questions/226969/how-do-i-create-a-multiboot-environment-using-lvm-for-your-buntu-operating-syst/226982#226982 – oldfred Apr 23 '15 at 20:58
  • Thanks a lot oldfred! You did what you could and you almost got me there... I guess UEFI and partition encryption are still very hard to work with in Ubuntu, specially with someone not so tech-savvy like me. – angrato Apr 24 '15 at 02:42

1 Answers1

2

If you still have access to Linux, try using Grub Customizer. http://ubuntuhandbook.org/index.php/2014/04/install-grub-customizer-ubuntu-1404/ See if you can find your old Ubuntu partition, put it at the top of the list (it doesn't necessarily have to be at the top of the list. I just suggested the top so that it would boot automatically if you don't press any keys within 10 seconds) and save the file.

JC A
  • 21
  • Running it now, but when I choose sda1 as partition, i get "this seem not to be a root file system (no fstab found)". When i choose sda2, I get "Mount failed" and I can read in terminal mount: unknown filesystem type 'crypto_LUKS'. – angrato Apr 23 '15 at 02:51
  • BTW, i also get errors in Grub Customizer for both DEVICEMAP_FILE and OUTPUT_FILE (red "!" instead of green "V"). – angrato Apr 23 '15 at 02:54