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.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Rep:
grub re-install can't find EFI directory
Not exactly a newbie to linux but I am with pure EFI boots.
I am trying to give back control of grub to my main install which is kubuntu on sda3. Please see output fdisk -l below
Disklabel type: gpt
Disk identifier: 47F4F7C8-1323-4270-9F4C-59053B5DC8A5
Device Start End Sectors Size Type
/dev/sda1 2048 1128447 1126400 550M EFI System
/dev/sda2 1128448 144488447 143360000 68.4G Microsoft basic data
/dev/sda3 144488448 322303999 177815552 84.8G Linux filesystem
/dev/sda4 322304000 411922431 89618432 42.7G Linux filesystem
/dev/sda5 411922432 500117503 88195072 42.1G Linux filesystem
Things were going along fine with a fresh install of windows 10, pclos and kubuntu on a new SSD when I decided to add one more "play with" distro, mageia (sda5). On install it did as I figured and took over the grub menu. I can boot anything fine from there. But I want kubuntu (sda3)to have control so I booted a live usb and attempted the fix I always do but grub is giving me "can't find EFI directory" it is right there - sda1 but no way of mounting I try gets the job done - can you tell me where I am going wrong? I have done this fix more times than I can count on legacy/BIOS but EFI is new to me.
The tool efibootmgr is very likely all you need, to change the boot order from Mageia first to Kubuntu first.
If you installed Mageia by mistake in legacy mode, you'll need to reinstall it in UEFI mode, or utilize expert talent to reconfigure it from legacy mode to UEFI mode. When installed in UEFI mode, the ESP filesystem is mounted to /boot/efi/, and the directories that the UEFI BIOS and efibootmgr utilize are found.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Original Poster
Rep:
Hello Mr This new SSD has never been booted in legacy mode. I went EFI all the way and mageia is EFI boot as well. It just has control of the grub menu and I don't let any of my "for playing" distros do that. I could get it back to kubuntu in a heartbeat if it was legacy. As a last resort I can just reinstall kubuntu. I can be up and running within an hour but I want to learn how to fix this without resorting to reinstall. I like to play with different distros, I have to know how to fix such. I will take a look at that tool. thx
If you can boot Kubuntu from the grub menu, I can see no reason why you need to boot from to a live usb system. In the grub menu, select your Kubuntu menu entry. When the boot completes, check to make sure the EFI directory is mounted (findmnt should do that, or lsblk -fs), then reinstall grub from that boot and regenerate the grub config file to add the newly installed system to the boot menu.
I haven't run any version of Ubuntu in a number of years, so I've no idea of the commands to install grub and update the config. I normally use the raw grub commands:
If all the installs were EFI then all you should need to do it to change the order in the BIOS firmware as suggested above to put the Kubuntu first. From whichever Linux you can boot, you should be able to look at the /bootefi/EFI partion and see the directories for each Linux just to verify they are all EFI. Some computers don't work well with efibootmgr (HP in particular) but making that change in the BIOS is very simple.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Original Poster
Rep:
Quote:
Originally Posted by smallpond
Can you give the output of "lsblk -f"?
Also please give the full command you are attempting.
lsblk is a lot of output and I forget how to put it in scrollbox here. My apologies just let me know how to do it for future. But I think this is the relevant portion?
Commands: I tried just my usual: sudo mount /dev/sda3 /mnt (that's where the kubuntu is)
then sudo grub-install --boot-directory=/mnt/boot /dev/sda (it worked for legacy but obviously not UEFI)
Messed around with some things I googled to direct grub to boot/EFI but just returned errors. All the installs can be loaded fine and I changed the default (through Mageia's control panel) to kubuntu but I really want to learn to do this the right way. I looked at the wiki for the EFI mgmt tool and it started going way over my head.
Once you get Kubuntu back in control, you'll want to prevent the others from taking it back. There are multiple approaches to this. One is to uninstall Grub from all but Kubuntu, but that might require you do some manual reconfiguration via /etc/grub.d/*_custom so that Kubuntu can use kernel and initrd symlinks of the other distros instead of needing to change as kernel versions increment. This is my foundational method. Another is to simply reconfigure /etc/fstab on each of the others so that the ESP doesn't get mounted automatically (option noauto), or remove the ESP entry entirely. Inability to write to the ESP by the others will ensure Kubuntu should stay in control. I do this as well. Only one bootloader is needed no matter how many distros are installed. I have upwards of a dozen distros each on a bunch of UEFI PCs. I use Tumbleweed's Grub for booting on all.
Distribution: Mint Cinnamon, Debian sid KDE, PCLOS Cinnamon, Manjaro XFCE
Posts: 280
Original Poster
Rep:
<SOLVED> grub re-install can't find EFI directory
Quote:
Originally Posted by yancek
If all the installs were EFI then all you should need to do it to change the order in the BIOS firmware as suggested above to put the Kubuntu first. From whichever Linux you can boot, you should be able to look at the /bootefi/EFI partion and see the directories for each Linux just to verify they are all EFI. Some computers don't work well with efibootmgr (HP in particular) but making that change in the BIOS is very simple.
Yancek, yes it was easy to do in the bios. I just did it now to get this all over with - but I want to learn why I can't get ubuntu in control again similar to what Mr is saying I want my main install to not lose control. Before I went all UEFI on this new disk- old disk I actually had partitioned gpt, with legacy ROMs enabled buthad UEFI - I knew that was nasty to mix as an occasional windows boot could end up with Dell blue screen trying to fix something that wasn't broke, so I went all out UEFI when I set up the new disk.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.