LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-07-2020, 06:32 PM   #1
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Rep: Reputation: Disabled
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?
 
Old 02-07-2020, 08:01 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Quote:
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.
 
Old 02-07-2020, 08:22 PM   #3
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
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):

https://www.howtogeek.com/114884/how...ntu-wont-boot/

And I got this:

Code:
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,

rw

Last edited by Rotwang2; 02-07-2020 at 08:24 PM.
 
Old 02-07-2020, 08:32 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,382
Blog Entries: 28

Rep: Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163
You might find this AskUbuntu thread helpful: https://askubuntu.com/questions/8312...-efi-partition
 
Old 02-07-2020, 08:55 PM   #5
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
OK it looks like a kernel problem looks like your theory was correct!

http://onehammer.com/IMG_20200207_212649.jpg

http://onehammer.com/IMG_20200207_212755.jpg

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.
 
Old 02-07-2020, 08:58 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Quote:
Installing for i386-pc platform.
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.
 
Old 02-07-2020, 09:16 PM   #7
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
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:

Code:
sudo grub-install --boot-directory=/mnt/ubuntu/boot /dev/sda
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
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?

Last edited by Rotwang2; 02-07-2020 at 09:23 PM.
 
Old 02-07-2020, 09:21 PM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
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.
 
Old 02-07-2020, 09:28 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
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.
 
Old 02-07-2020, 09:36 PM   #10
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
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?
 
Old 02-07-2020, 09:40 PM   #11
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
The existence/non-existence of a /sys/firmware/efi directory indicates what mode a linux system is booted in.

Last edited by colorpurple21859; 02-07-2020 at 09:41 PM.
 
Old 02-07-2020, 09:43 PM   #12
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Ok wow this is odd look at this (this is on the new install):

Code:
ubuntu@ubuntu:~/Downloads$ ls -al /mnt/ubuntu/sys/
total 8
drwxr-xr-x  2 root root 4096 Apr 24  2018 .
drwxr-xr-x 24 root root 4096 Feb  7 22:35 ..
So I booted the live cd in legacy mode when I installed? How did I even do that...

Last edited by Rotwang2; 02-07-2020 at 09:47 PM.
 
Old 02-07-2020, 09:47 PM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
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.
 
Old 02-07-2020, 09:53 PM   #14
Rotwang2
Member
 
Registered: Aug 2014
Distribution: Ubuntu, Centos, Fedora
Posts: 210

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
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.
 
Old 02-07-2020, 10:17 PM   #15
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,392

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
It should if the efi partition is setup to be mounted at /boot/efi during the partitioning part of the installation.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I reinstall Grub and Efi (or Uefi) on my external HDD after I accidentally deleted the partition. Choklit Linux - Software 4 12-24-2019 03:42 PM
[SOLVED] Ooooy. EFI boot mmx64.efi.efi not found bulgin Linux - Newbie 12 12-20-2018 11:03 AM
[SOLVED] Can't find /boot/efi/EFI/Slackware/vmlinuz kernel configuration ironQiu Slackware 4 02-09-2015 06:21 AM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Can I delete and reinstall Ubuntu 8.04 and keep a home partition? win_to_lin_migrant Ubuntu 4 01-18-2009 12:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration