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.
Grub hell. Can I just delete the EFI partition and reinstall ubuntu?
What happens if I just delete the EFI partition and reinstall ubuntu?
I'm having problems reinstalling ubuntu and it has something to do with either grub or EFI or both. So can I just delete that partition and will the installer make a new one?
Here's the story:
I was having problems with python/django so out of frustration I decided to just reinstall ubuntu entirely.
My /home directory was on the same partition as /.
So before the reinstall I used gparted and resized the partition and made room for 100g for the new install.
When I installed (18.04), In the installer I set the mount point for what *was* the old ubuntu as /home, and use the new empty partition as /
I installed, when I rebooted it threw errors and dropped to cli. So I figured grub was trying to point at the /boot on the old install partition. (why didn't the installer tell grub to point to the new / partition? why would it tell grub to point to the /home/boot?)
So I figured, I'll just hide every directory in what *was* the old install into a directory called (oldboot) so the installer can't even find a boot directory, and then I deleted the 100g partition and then I reinstalled 18.04 again.
Now what happens is I get the emergency mode cli. (not the same prompt as before (and btw neither one is a grub prompt). This was was the "You are in emergency mode press Ctrl-D to login" prompt)
So what's happening? Is this grub's fault? Maybe grub still hung up on something remnant? Or maybe it's looking at the EFI?
How do I tell the installer to just delete grub entirely and reinstall it, instead of editing the current one?
I don't understand what the installer and/or grub is doing to make it try to even look in the /home directory at all.
How does this happen? This makes no sense.
So what if I just delete the efi parition and try reinstalling again?
What happens if I just delete the EFI partition and reinstall ubuntu?
Assuming your selecting "something else" you would probably be better off deleting the ubuntu directory in the efi partition before beginning the installation. but I don't think that is your problem
If your booting to a cli of some sort then the efi booting is working, could be something wrong with one of the kernel options in the /boot/grub/grub.cfg or mount points in your /etc/fstab.
Quote:
I installed, when I rebooted it threw errors and dropped to cli
The errors will clue you in to what is wrong. If you don't understand the errors post them, so someone can help.
Last edited by colorpurple21859; 02-07-2020 at 08:03 PM.
Assuming your selecting "something else" you would probably be better off deleting the ubuntu directory in the efi partition before beginning the installation. but I don't think that is your problem
If your booting to a cli of some sort then the efi booting is working, could be something wrong with one of the kernel options in the /boot/grub/grub.cfg or mount points in your /etc/fstab.
The errors will clue you in to what is wrong. If you don't understand the errors post them, so someone can help.
Ok thanks quick question- when I'm in the CLI how do I capture what's on the screen besides just taking a photo of all the errors with my phone? (Or is that good enough?)
Also fyi I just tried this (the terminal version):
sudo grub-install --boot-directory=/mnt/ubuntu/boot /dev/sda
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.
Btw it's not an ancient pc; it's only like 3 years old, so it surely supports UEFI.
I also looked there and the comments.... I have no idea what the hell they're talking about, ug I hate all thus boot grub uefi stuff it's hell!
ok I'll be back with a photo in 20 minutes, thanks,
Btw I used to have 18.04.2 and now I'm installing 18.04.4. I can't imagine that'd make a difference? This pc is only like 3 years old- 4 cores, 16g, name brand; pretty vanilla.
This indicates your booting in csm/legacy mode and not uefi mode. When you was doing the partitioning did you select the efi partition to mount /bootefi? To install grub to a gpt partition in legacy mode you need a 1mb partition flagged as bios-boot.
Last edited by colorpurple21859; 02-07-2020 at 09:22 PM.
I noticed a comment in the stackoverflow that @frankbell provided:
Quote:
Installing Ubuntu 18.04, only grub-pc was available. Had to first run sudo apt-get install grub-efi, then these steps. Still got an error message on grub-install, but ignored it and ran update-grub, which found the Windows EFI. I then had to reboot, enter the boot management, and update the Boot Sequence option. It wasn't listed, but it gave me the option to add a boot option, then search for file, which I found in the right file system + EFI directory. Set the new boot option as first, and it finally worked! – iisisrael Jul 12 '18 at 19:47
So maybe this is specifically and 18.04.4 problem?
So I tried installing grub-efi first and then the error changed now it does this:
Oh wait I have a theory- maybe there's an old setting in the efi parition that's point at sda2 (the old install where I set at /home and hid the /boot directory during the install). So hence, it's throwing "can't find EFI directory" because it's still looking at sda2? Or am I totally wrong.
@colorpurple- ok the efi parition was already there from the old installation, so I didn't flag anything. Should I delete it during the install and make a new one? And is the "flag" an option in the installer or do I do that in gparted?
my touchpad has been acting screwy, so I had to edit post #6, it posted in the middle of typing somehow.
What I was attempting to say it appears your booting the installer in legacy mode, grub wasn't installed during the reinstallaion because a 1mb bios-grub partition doesn't exist. The when you reboot your still booting with the grub bootloader on the efi partition in uefi mode.
Last edited by colorpurple21859; 02-07-2020 at 09:27 PM.
If you had deleted the efi partition you wouldn't be booting at all except for the live iso. Use gparted to create a 1mb empty partition and flag as bios boot to boot in legacy mode.
Last edited by colorpurple21859; 02-07-2020 at 09:38 PM.
If you had deleted the efi partition you wouldn't be booting at all except for the live iso. Use gparted to create a 1mb empty partition and flag as bios boot
Yea I knew the iso is independent of this chaos. Ok so I have to run the installer
Quote:
booting the installer in legacy mode
Wow so the installer itself is running in "legacy mode"?
Ok anyway what's the plan? Do I make a new partition? And/or do I need to expand the current one before another reinstall?
I think your problem is you ran the installer iso in legacy mode when you did the re-install. Don't bother with creating a bios-boot parition. Disable legacy mode in the bios, boot the live iso, follow the steps in the link that frankbell posted.
Last edited by colorpurple21859; 02-07-2020 at 09:50 PM.
I think your problem is you ran the installer iso in legacy mode when you did the re-install. Don't bother with creating a bios-boot parition. Disable legacy mode in the bios, boot the live iso, follow the steps in the link that frankbell posted.
OK I'll do it right now- one question tho- if I boot to the live cd in uefi mode and just reinstall again, would the steps in that link be needed? I mean would the installer just do it right this time?
I'll try your way and the steps first since it's easier but I'm just wondering if a reinstall would work since the live disk isn't legacy mode anymore.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.