My grub boot partition belongs to another Linux install and I want to get it back.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
My grub boot partition belongs to another Linux install and I want to get it back.
Hi,
I'm running Linux Mint 21.3.
Ok, so I wanted to get rid of Windows completely, so I deleted the windows partition and moved and resized my root and home partitions to take advantage of the freed space.
After rebooting I arrived at a grub screen with a > prompt and couldn't boot into Linux. I tried some terminal commands, Boot Repair multiple times, rescatux, and super grub disk. Nothing worked, the boot/efi partition seemed to be corrupted and none of the tools could write to it.
I eventually deleted and reformatted the boot/efi partition and installed another copy of Linux Mint to a new partition.
This installation used the correct boot/efi partition to install and I was able to get back into my main Linux Mint installation.
However, now I'm having some errors during updates and installs, especially around initramfs and initramfs-tools. The boot and logout processes now seem to take longer and show the commands running rather than the nice splash screens from before.
So, I'd like to bring control of the boot/efi partition back to my main Mint install to avoid any problems building up.
Does anyone have any ideas how to do this?
Your post is a bit confusing, but, perhaps, try re installing grub.
Which part is confusing?
Here's the sequence:
1. Deleted Windows
2. Moved and resized Linux Mint root and home partitions
3. On restart I couldn't get past grub
4. Used live USBs to try to fix it with boot repair, plus various commands and other tools
5. Nothing worked - seemed like boot/efi partition was corrupted
6. Deleted boot/efi partition
7. Created a new partition and installed Mint to that partition, which created a new boot/efi partition
8. Was able to boot into my old Mint install, everything was still there
9. I now have problems with initramfs etc, I guess because the boot/efi partition is owned by the other Mint installation?
10. I want to return control of the boot/efi partition to my main Mint install.
Which procedure for reinstalling grub would you recommend in this case?
I would guess that when you deleted windows you also deleted the vfat partition which contained the Mint EFI files. That would explain the error you report. If you did not delete this partition, it's possible it could have been corrupted during the resizing operation. Reinstalling Grub rather than Mint again as suggested might have resolved the problem if you did not delete the EFI partition. Since you mention using boot repair, why did you not follow the instructions on their home page to post the output from the option to Create Bootinfo Summary rather than trying repairs which likely made things worse.
I'm not sure what you mean by the 'correct' /boot/efi partition? How many EFI partitions do you have and how many drives? Too many possibilities so your best option is to run boot repair again and this time get the report and post the link here so we have some details to review.
I would guess that when you deleted windows you also deleted the vfat partition which contained the Mint EFI files. That would explain the error you report. If you did not delete this partition, it's possible it could have been corrupted during the resizing operation. Reinstalling Grub rather than Mint again as suggested might have resolved the problem if you did not delete the EFI partition. Since you mention using boot repair, why did you not follow the instructions on their home page to post the output from the option to Create Bootinfo Summary rather than trying repairs which likely made things worse.
I'm not sure what you mean by the 'correct' /boot/efi partition? How many EFI partitions do you have and how many drives? Too many possibilities so your best option is to run boot repair again and this time get the report and post the link here so we have some details to review.
Hi Yancek,
Thanks for the reply.
I don't think I deleted the vfat partition, only the one where the windows C: drive lived. I think it was corrupted during the resize.
I tried reinstalling grub n number of times, but it didn't fix the problem. I didn't post the output from Bootinfo because it was a Sunday, I needed the laptop for work the next day, and the solution of installing another copy of Mint has worked for me before.
I should have said the new installation created the boot/efi files in the correct partition. I have one disk, one efi partition, but 8 partitions in total. I can't run boot repair right now as I need to finish work today, but I'll run it tomorrow and post the results here if it hasn't fixed the problem.
Cheers!
I would guess that when you deleted windows you also deleted the vfat partition which contained the Mint EFI files. That would explain the error you report. If you did not delete this partition, it's possible it could have been corrupted during the resizing operation. Reinstalling Grub rather than Mint again as suggested might have resolved the problem if you did not delete the EFI partition. Since you mention using boot repair, why did you not follow the instructions on their home page to post the output from the option to Create Bootinfo Summary rather than trying repairs which likely made things worse.
I'm not sure what you mean by the 'correct' /boot/efi partition? How many EFI partitions do you have and how many drives? Too many possibilities so your best option is to run boot repair again and this time get the report and post the link here so we have some details to review.
Ok, so this evening I used a live USB and ran boot repair again. I restarted, but the boot stopped at the grub command prompt. I had to reinstall the second mint again to fix the problem so I could boot back into my main install. The output of Boot repair is here:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p5 during installation
UUID=0ca5353e-75f2-4bde-83a3-4163b5161c2d / ext4 noatime,errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
#UUID=F8A8-ECEB /boot/efi vfat umask=0077 0 1
/dev/mapper/nvme0n1p6_crypt /home ext4 noatime,defaults 0 2
/swapfile none swap sw 0 0
UUID=BDDB-2C6B /boot/efi vfat defaults 0 1
It appears you have a linux system install on /dev/nvme0n1p3 and /dev/nvme0n1p5
These are the issues as I see them:
1. The uuid in the EFI/ubuntu/grub.cfg on the efi partition needs to changed to the uuid of either /dev/nvme0n1p3 or /dev/nvme0n1p5
2. There is no grub.cfg in /boot of /dev/nvme0n1p5
3. The conflict of your post
versus the output of the boot-repair
The linux on /dev/nvme0n1p5 is my main system, this is the one I want to regain control of the boot partition. How do I do that?
Boot into the system on /dev/nvme0n1p5, open a terminal,
Code:
sudo grub-install
sudo update-grub
If you still get a grub> open a termial,
change the uuid of /boot/efi/EFI/ubuntu/grub.cfg to the uuid /dev/nvme0n1p5: 0ca5353e-75f2-4bde-83a3-4163b5161c2d
Code:
sudo nano /boot/efi/EFI/ubuntu/grub.cfg
Last edited by colorpurple21859; 04-05-2024 at 05:57 PM.
Boot into the system on /dev/nvme0n1p5, open a terminal,
Code:
sudo grub-install
sudo update-grub
If you still get a grub> open a termial,
change the uuid of /boot/efi/EFI/ubuntu/grub.cfg to the uuid /dev/nvme0n1p5: 0ca5353e-75f2-4bde-83a3-4163b5161c2d
Code:
sudo nano /boot/efi/EFI/ubuntu/grub.cfg
Thanks Colorpurple.
I've attempted some other ways of solving the problem and the outputs of previous commands may have changed. So I've rerun the commands and pasted the outputs below. I haven't rerun Boot-repair from a live USB because I don't want to break grub again.
From my experimenting, there seems to be some unresolvable problem between initramfs and available fonts.
Here are the outputs:
sudo grub-install:
Code:
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
sudo update-grub:
Code:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/63_mint-theme-2k.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
/usr/sbin/grub-probe: error: failed to get canonical path of `/boot/grub/fonts/UbuntuMono32.pf2'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
I haven't rerun Boot-repair from a live USB because I don't want to break grub again.
I'd suggest you go back to the boot repair site (link below) and read through the 4th paragraph highlighted on that page where it explains that there is an option to gather information (Create Bootinfo Summary) to be used for people who are not familiar with Linux bootloader. If you select that option, it will gather information and will not make any changes and since you have run it several times, it is possible you crated additional problems.
I would suggest when you are modifying partitions that you keep detailed records/notes as to exactly what steps you take, how you took the steps (specific software used) so you have that information available if you have problems and need help.
How were you trying to reinstall Grub when you got the 'cannot find EFI directory' message? Booted from partition 5, partition 3, a live usb? Was your original install of Mint on partition 5 an EFI install? Your boot repair output shows 0ca5353e-55f2-4bde-85a3-4183a5361c2d as the UUID for partition 5. Your most recent output from lsblk shows b5b94bdb-d97d-48d0-8f30-bcedf470b919 as the UUID for partition 5 yet the grub.cfg file on your EFI partition shows it as 80260417-5663-426b-b6c0-a7c6fc7c9a4e. The UUID in the grub.cfg file on the EFI partition must have the correct UUID for the partition it is pointing to, 3 or 5 whichever you choose and that is not the case. Are you aware that every time you reinstall you get a new UUID for the partition you are using? Put the correct UUID in the grub.cfg file on the EFI partition as suggested previously, save the change and reboot.
Was your original install of Mint on partition 5 an EFI install? You are also using LVM, was that on the original Mint or the newer Mint or both? I don't use LVM so have no advice on that.
It appears you have done a re-install. You now have two efi partitions, only need /dev/nvme0n1p1.
During the re-install is there a reason you kept the /dev/nvme0n1p3 partition?
I'd suggest you go back to the boot repair site (link below) and read through the 4th paragraph highlighted on that page where it explains that there is an option to gather information (Create Bootinfo Summary) to be used for people who are not familiar with Linux bootloader. If you select that option, it will gather information and will not make any changes and since you have run it several times, it is possible you crated additional problems.
I would suggest when you are modifying partitions that you keep detailed records/notes as to exactly what steps you take, how you took the steps (specific software used) so you have that information available if you have problems and need help.
How were you trying to reinstall Grub when you got the 'cannot find EFI directory' message? Booted from partition 5, partition 3, a live usb? Was your original install of Mint on partition 5 an EFI install? Your boot repair output shows 0ca5353e-55f2-4bde-85a3-4183a5361c2d as the UUID for partition 5. Your most recent output from lsblk shows b5b94bdb-d97d-48d0-8f30-bcedf470b919 as the UUID for partition 5 yet the grub.cfg file on your EFI partition shows it as 80260417-5663-426b-b6c0-a7c6fc7c9a4e. The UUID in the grub.cfg file on the EFI partition must have the correct UUID for the partition it is pointing to, 3 or 5 whichever you choose and that is not the case. Are you aware that every time you reinstall you get a new UUID for the partition you are using? Put the correct UUID in the grub.cfg file on the EFI partition as suggested previously, save the change and reboot.
Was your original install of Mint on partition 5 an EFI install? You are also using LVM, was that on the original Mint or the newer Mint or both? I don't use LVM so have no advice on that.
Hi Yancek,
Thanks for the help.
Here's the latest Boot Info summary run from within my main install: http://sprunge.us/1S5Jul
I got the 'cannot find EFI directory' message trying to install grub from with my main installation, which is now p4. I don't know if my original install of Mint on partition 5 was an EFI install. The machine originally had windows on it and I installed Linux Mint alongside that.
As per colorpurple21859's instructions, I have already put the correct (I think) UUID in grub.cfg and rebooted, to no obvious effect.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.