Grub hell. Can I just delete the EFI partition and reinstall ubuntu?
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Good news is I got the usb key to work. Holy shit it boots in like 2 minutes instead of 20. I'm never burning isos to dvds again. I'm so old fashioned I'm still from the knoppix days. This is awesome.
Ok I should show you the boot order (have I yet?):
Notice there are two ubuntu's- actually it was like that even before I did the reinstall. I can't remember why but when I did the original install last year I did something by accident and made two. But anyway just now I attempted both and got the same results with both.
I don't see anything that stands out other then your missing /boot/grub/x86_64-efi directory.
Might be something wrong with the initramfs in /boot. Follow this tutorial https://linoxide.com/linux-how-to/fi...d-image-linux/
after mounting your root partition to /mnt mount the efi partition to /mnt/boot/efi before running the mount --bind commands.
before exiting out of the chroot run
root@ubuntu:/# ls /boot/*initrd*
/boot/old-initrd.img-5.0.0-23-generic /boot/old-initrd.img-5.3.0-28-generic
so I renamed them both to old.[]
Oh wait it says that's only for centos and fedora; the red line. Even still... it's a mistake. Anyway I moved on using the debian version, but I didn't know which one to use since there's two so I assumed the newer version:
root@ubuntu:/# apt install grub-efi
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
grub-efi-amd64
The following packages will be REMOVED:
grub-gfxpayload-lists grub-pc
The following NEW packages will be installed:
grub-efi grub-efi-amd64
0 upgraded, 2 newly installed, 2 to remove and 272 not upgraded.
Need to get 50.4 kB of archives.
After this operation, 414 kB disk space will be freed.
Do you want to continue? [Y/n]
Err:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 grub-efi-amd64 amd64 2.02-2ubuntu8.14
Could not resolve 'us.archive.ubuntu.com'
Err:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 grub-efi amd64 2.02-2ubuntu8.14
Could not resolve 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/grub2/grub-efi-amd64_2.02-2ubuntu8.14_amd64.deb Could not resolve 'us.archive.ubuntu.com'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/grub2/grub-efi_2.02-2ubuntu8.14_amd64.deb Could not resolve 'us.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ve and 272 not upgraded.
Anyway I went ahead and did it anyway and it looks like it did some EFI magic anyway:
Code:
root@ubuntu:/# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.3.0-28-generic
Found initrd image: /boot/initrd.img-5.3.0-28-generic
Found linux image: /boot/vmlinuz-5.0.0-23-generic
grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
Adding boot menu entry for EFI firmware configuration
done
Alright well I hope you're asleep! Tomorrow I guess I'll just reinstall and map the efi drive properly this time; that's the next thing to try. Unless you want to keep going tomorrow as an exercise, I'm willing, I'm learning a lot. gnight thanks so much,
exit
The echo commands appends nameserver line to your /etc/resolv.conf
Oh yea I should've thought of that- the reason apt-get couldn't resolve the package is just because there's no dns. Btw I didn't know that echo could actually change a file; I thought it was just for displaying and changing env variables.
oohhhh right- I need to do the "for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done" thing from stackoverflow again first, right? I thought those were mutually exclusive. So I do that procedure first before the initrd tutorial?
Oh ok all I had to do was mount the efi. Ok I just did it (outside of chroot in a different window), but it worked without complaining:
Code:
root@ubuntu:/# apt install grub-efi
Reading package lists... Done
Building dependency tree
Reading state information... Done
grub-efi is already the newest version (2.02-2ubuntu8.14).
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 272 not upgraded.
root@ubuntu:/# grub-install
Installing for x86_64-efi platform.
Installation finished. No error reported.
Should I do the rest of the tutorial over? (It's all already written to disk right), or should I skip to the end-
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.