#1 2015-12-29 20:25:38
- Piexes
- Member
- Registered: 2015-12-29
- Posts: 8
[Solved] Trouble installing GRUB, can’t find EFI directory
Hi guys, first post on here.
I’m trying to install arch using a USB to boot, on a UEFI system using a MBR partition table. I’ve attempted it several times, but always end up starting by deleting my linux partitions and rebooting. My partitions look like this:
sda1 — partition i’m too afraid to touch that was already there
sda2 — main windows partition
sda3 — partition i’m too afraid to touch that was already there (x2)
sda4 — extended
—sda5 root 90G
—sda6 boot 512M
—sda7 home 104G
I think something goes wrong when I create my partitions. I don’t use parted, because quite frankly it confuses me and I’m too afraid that I’ll delete my windows data. Instead, I use cfdisk and I think I miss a few steps. sda6 is set as Bootable, and its type is EFI (Fat-12/16/32). Is that all? The filesystem is set as fat32 using mkfs.fat -F32 /dev/sdxY
When I run the # grub-install —recheck /dev/sda command it just says that it can’t find the EFI directory. Isn’t this /boot? I then did
grub-install —recheck —efi-directory=/boot /dev/sda
which results in
Installing for x86_64-efi platform.
grub-install: error: efibootmgr: not found.
and then nothing happens.
How do I install GRUB successfully in this situation? Sorry for any noobishness, and thanks in advance!
Last edited by Piexes (2015-12-29 21:49:01)
#2 2015-12-29 20:34:57
- Head_on_a_Stick
- Member
- From: London
- Registered: 2014-02-20
- Posts: 6,876
- Website
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
Presuming that Windows is installed in UEFI mode, you will need to share the Windows-generated EFI system partition (sda3?) and mount that to /boot
Use `gdisk -l /dev/sda` to find the EFI system partition.
Post the output of that command if you’re not 100% sure.
EDIT: Just out of curiosity, why are you using GRUB?
Most newbies seem to prefer it in spite of the fact that the Beginner’s Guide has instructions for systemd-boot in UEFI systems.
You are following the Beginner’s Guide, right?
EDIT2: Just to clarify: I think you have created a GNU/Linux partition type (8300) at /dev/sda6 and formatted in to FAT32 when you actually need a specific EFI system partition type (EF00) for GRUB to install successfully.
Last edited by Head_on_a_Stick (2015-12-29 20:39:07)
#3 2015-12-29 20:46:56
- Piexes
- Member
- Registered: 2015-12-29
- Posts: 8
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
I was following this section, but I guess I’ll try to go and do the systemd one. I’ll edit/post with an update.
The output of that command:
http://imgur.com/MXipX1K
Edit: I tried running bootctl install, and it spat out:
File system «/boot» is not on a GPT partition table
hmm
lsblk still shows me that sda6 is still mounted at mountpoint /mnt/boot
it’s fat32 for sure
The wiki says that the boot partition needs gdisk type EF00. I doubt I did this.
Last edited by Piexes (2015-12-29 20:52:22)
#4 2015-12-29 20:50:40
- Head_on_a_Stick
- Member
- From: London
- Registered: 2014-02-20
- Posts: 6,876
- Website
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
Right, sorry, my mistake — you are *not* using a UEFI system (or a GPT disk) so you should be following the non-UEFI instructions:
https://wiki.archlinux.org/index.php/Be … BIOS.2FMBR
Also, in this case, /boot should probably use a POSIX-compliant filesystem rather than FAT.
Last edited by Head_on_a_Stick (2015-12-29 20:54:12)
#5 2015-12-29 20:54:12
- Piexes
- Member
- Registered: 2015-12-29
- Posts: 8
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
Ok, now I’m pretty confused. The wiki tells me to run ls /sys/firmware/efi/efivars and if it’s populated I’m in UEFI mode. It’s definitely populated, it spits out a ton of stuff.
Should I reinstall the .iso again on my flashdrive and delete the linux partitions for a completely fresh start?
Last edited by Piexes (2015-12-29 20:55:53)
#6 2015-12-29 20:57:18
- Head_on_a_Stick
- Member
- From: London
- Registered: 2014-02-20
- Posts: 6,876
- Website
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
Piexes wrote:
It’s definitely populated, it spits out a ton of stuff.
Yes you may be booted in UEFI mode but your Windows system appears to be installed in non-UEFI mode — there is no EFI system partition present.
If you wish to be able to switch between the two without toggling «Legacy» mode, you must install Arch in non-UEFI mode also.
It may be that a UEFI-installed GRUB can actually boot a non-UEFI Windows system if you create the requisite EFISYS partition but I don’t know and have of way of testing.
EDIT: You can attempt to force GRUB to install a non-UEFI loader with:
# grub-install --target=i386-pc --recheck /dev/sda
EDIT2: Can you check from Windows if it is booted in UEFI mode?
Last edited by Head_on_a_Stick (2015-12-29 21:33:31)
#7 2015-12-29 21:38:34
- Piexes
- Member
- Registered: 2015-12-29
- Posts: 8
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
I wiped the slate clean with arch, and did another run through following non-UEFI instructions, which left me without a /boot partition.
I tried doing the grub-install command, and I got met with the same error in the OP. I tried to force it using the command in your edit and I got:
Installing for i386-pc platform.
grub-install: warning: File system ‘ext2’ doesn’t support embedding
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
How do I move on from this?
Edit: I can’t boot into windows, I think from fucking with the bootloader too much. I was considering installing Mint just in order to restore a bootloader. But, on second thought, I might not be able to boot because I fucked with the boot order in the BiOS. I’d check, but I don’t want to shut off right now because I’m at the place I want to be.
Last edited by Piexes (2015-12-29 21:45:54)
#8 2015-12-29 21:45:20
- Head_on_a_Stick
- Member
- From: London
- Registered: 2014-02-20
- Posts: 6,876
- Website
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
Piexes wrote:
grub-install: warning: File system 'ext2' doesn't support embedding
Did you try to specify a partition number in the `grub-install` command?
A partition number should *not* be specified.
You need to post the *exact* command used (and any terminal output) rather than a vague description of the commands used.
#9 2015-12-29 21:47:21
- Piexes
- Member
- Registered: 2015-12-29
- Posts: 8
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
Whoops! Yeah it’s all fixed now. I fixed it using the command:
grub-install —target=i386-pc —recheck /dev/sda
I was specifying partitions before.
Thanks so much, I’d still be stuck without you!
#10 2015-12-29 21:48:19
- Head_on_a_Stick
- Member
- From: London
- Registered: 2014-02-20
- Posts: 6,876
- Website
Re: [Solved] Trouble installing GRUB, can’t find EFI directory
Excellent, glad you got it fixed.
Please add «[SOLVED]» to the thread title for the benefit of others.
-
#1
Hi,
I am having an UEFI appliance running FreeBSD 10.3. I wanted to install GRUB in it.
I compiled and made a package for grub2-efi from /usr/ports/sysutils/grub2-efi.
grub2-efi is installed using pkg install grub2-efi
But when I execute «grub-install», I am getting an error message «efibootmgr not found».
Command used : «grub-install —target=x86_64-efi —root-directory=/efi /dev/da0»
I could not find a package with name «efibootmgr» in /usr/ports
disk is partitioned as given below.
Code:
=> 6 146239733 da0 GPT (558G)
6 10 - free - (40K)
16 128 1 freebsd-boot (512K)
144 262144 2 efi (1.0G)
262288 1048576 3 freebsd-ufs (4.0G)
1310864 2097152 4 freebsd-swap (8.0G)
3408016 1048576 5 freebsd-ufs (4.0G)
4456592 102400 6 freebsd-ufs (400M)
4558992 13107200 7 freebsd-ufs (50G)
17666192 524288 8 freebsd-ufs (2.0G)
18190480 128049248 9 freebsd-ufs (488G)
146239728 11 - free - (44K)
How can I successfully install grub2-efi in FreeBSD 10.3?
Ajay
-
#2
The reason you’re getting the error is because the system isn’t configured to UEFI boot. Judging by the
freebsd-boot
partition you’re using the traditional BIOS boot.
-
Thread Starter
-
#3
Hi Dice,
The box is booting using UEFI. Itz just that, a partition with name «freebsd-boot» is present.
I even confirmed this by deleting «freebsd-boot» partition.
Ajay
-
#4
I’ve only just come across grub2-efi, was previously using the grub2 pkg, but wanted to use grub with gpt.
In the command in OP, it mentions ‘—root-directory=/efi’. Is this something that should already exist?
I note when running man grub-install
that this option is not displayed.
Has anyone managed to get this working?
-
#5
I assume that ‘—root-directory’ should be ‘—efi-directory’ and it should refer to the efi partition (/dev/da0p1)… and that needs to be mounted eg mount -t msdosfs /dev/da0p1 /mnt
when running grub-install
…
Am I correct in thinking the efi partition can be recreated using
as I think I may have messed it up…
dd if=/boot/boot1.efifat of=/dev/da0p1
I thought I had installed it but on reboot I didn’t see any Grub menu, so will have to try again.
-
#6
The dd
trick is probably the simplest way to recreate the EFI partition. Here’s a sample incantation for GRUB:
Code:
grub-install --boot-directory=/rpool/boot --bootloader-id=grub
--efi-directory=/mnt/efisys --no-nvram --target=x86_64-efi
Set —boot-directory to wherever you want the grub folder installed on your system (i.e., where you’ll keep your
grub.cfg
). If you don’t have any other EFI loaders installed, you can set —bootloader-id=boot to use the default path of
/EFI/boot/
. Lastly, the —no-nvram option should disable the call to efibootmgr
.
Last edited: Jun 4, 2017
-
#7
Thanks for the suggestion… I’m obviously doing something wrong because on reboot the system goes straight into the FreeBSD EFI boot block showing Loader path: /boot/loader.efi. I don’t really know what to expect with the Grub EFI loader, but nothing appears, so it doesn’t seem to have installed properly even though grub-install
showed no errors found.
I did read elsewhere that a small bios-boot partition needed to be installed for grub-efi to work. I have installed one but it is the seventh partition, so I don’t know if this is the problem. Also I’m not sure if I’ve specified ‘—efi-directory’ correctly. I’m assuming that it should point at the the EFI partition on the disk, so if I mount /dev/da0p1 /mnt
, should efi directory be
/mnt
or
/mnt/efi
?
-
#8
In your case, you’ll want to use —efi-directory=/mnt. And there’s no need for a bios-boot partition when using UEFI.
As for the actual problem, if FreeBSD’s loader is what you’re getting at boot then, presumably, that’s what lives on the EFI partition at
EFI/boot/bootx64.efi
. You can verify this by mounting the partition and comparing this file to
/boot/boot1.efi
. They should be identical. Unless one is more up-to-date than the other. If that’s the case, just hexdump
the file and search for «FreeBSD» to verify its contents.
Since you want GRUB to be the default bootloader, the .efi file generated by grub-install
will have to be what resides at
EFI/boot/bootx64.efi
. If you used —bootloader-id=grub then this file will have been installed to
EFI/grub/grubx64.efi
.
-
#9
Here is a directory listing of what I have on my EFI partition:-
Code:
./:
drwxr-xr-x 1 root wheel 512 Apr 12 2016 efi
./efi:
drwxr-xr-x 1 root wheel 512 Apr 12 2016 boot
drwxr-xr-x 1 root wheel 512 Apr 26 08:25 efi
./efi/boot:
-rwxr-xr-x 1 root wheel 131072 Apr 12 2016 bootx64.efi
-rwxr-xr-x 1 root wheel 12 Apr 12 2016 startup.nsh
./efi/efi:
drwxr-xr-x 1 root wheel 512 Apr 26 08:25 boot
./efi/efi/boot:
-rwxr-xr-x 1 root wheel 128512 Apr 26 08:25 grubx64.efi
Are you referring to EFI (above) as the EFI partition or a directory within the EFI partition?
From what I can make out I need to create a
grub
partition under
/dev/da01p1
and copy
grubx64.efi
to it…
Does that sound OK?
-
#10
Are you referring to EFI (above) as the EFI partition or a directory within the EFI partition?
Pardon the confusion. Whenever I used EFI in a path it was the name of a directory.
It appears you just nested the install path one level too deep. Try laying things out like this:
Code:
./efi
./efi/boot
./efi/boot/bootx64.efi # GRUB
./efi/boot/bootx64.efi.old # FreeBSD's loader
./efi/boot/startup.nsh
-
#11
Many thanks, I finally have it working. Don’t why it took me so long to sort it, but without your help it would have taken much longer. Now I can finally get my Multiboot USB stick configured to my liking… Still don’t know why the EFI partition takes up so much space…
-
#12
Pardon the confusion. Whenever I used EFI in a path it was the name of a directory.
It appears you just nested the install path one level too deep. Try laying things out like this:
Code:
./efi ./efi/boot ./efi/boot/bootx64.efi # GRUB ./efi/boot/bootx64.efi.old # FreeBSD's loader ./efi/boot/startup.nsh
I thought I had this working, but when trying install grub-efi again on another system, I get:
Code:
./efi
./efi/boot
./efi/boot/bootx64.efi # 131072 Apr 12 2016
./efi/boot/startup.nsh
./efi/grub
./efi/grub/grubx64.efi # 120512 Jan 4 2017
and the system boots up, just as before.
Can I just cp ./efi/grub/grubx64.efi ./efi/boot/bootx64.efi
?
This is what I ran to install grub:
Code:
mount -t msdosfs /dev/da0p1 /mnt
grub-install --boot-directory=/boot --bootloader-id=grub --efi-directory=/mnt --no-nvram --target=x86_64-efi /dev/da0
-
#13
Can I just cp ./efi/grub/grubx64.efi ./efi/boot/bootx64.efi?
Yes.
You can change the name that is used for the subdirectory that grub-install creates in your efi partition using the —bootloader-id option, but I don’t recall if there’s a way to make it output a file named anything other than
grubx64.efi
(though I’d be surprised if there wasn’t).
And you don’t need to pass a device path when using the EFI-variant of grub-install. It is sufficient to specify where your efi partition is mounted using the —efi-directory option.
-
#14
This grub-efi is driving me nuts! I have it set up successfully on a hard disk with the Grub menu coming up just as I want it, but on a USB stick with FreeBSD installed using gpt with an efi partition, grub-install does not provide Grub menu on booting but does straight into the FreeBSD efi boot.
In an attempt to copy the efi partition from working to none working, I mounted both partitions and copied one to the other, but it made no difference.
Can’t think of how to force a UEFI Grub boot… maybe it’s something particular to the ThinkPad T420 or X220…
-
#15
So, there are probably half a dozen things that could be wrong. You’re going to have to narrow down the problem.
- Make the USB drive the only bootable device;
- Ensure there is only one .efi executable in its EFI partition; and
- If you have a BIOS bootloader installed on the drive, disable CSM so that the firmware can’t fall back to legacy booting.
Then go from there.
You’ve probably just overlooked something, but it is possible that this is a firmware issue.
One thing I’ll briefly mention is that there are limitations to when you can just copy the .efi file that grub-install generates from one location to another, since there are a couple of things that get hard-coded into it: (a) the path to GRUB’s files—e.g., device, directory—and (b) the modules it needs to be able to read said files. It’s not quite as flexible as FreeBSD’s .efi executable when it comes to drop-and-go installation. But that’s the price you pay when you need a bootloader that can boot almost anything.
This article documents issues that might arise when trying to use or install GRUB2.
Installation errors
Installing GRUB2 from within a chroot
When a separate /boot partition exists, be sure to mount the target root partition before chrooting, but do not mount the /boot partition until after chrooting to the new environment. This is required because grub-mkconfig will not detect /boot as a separate partition and will assume the /boot directory and the root (/) directory are on the same partition.
Reinstalling the GRUB2 EFI boot manager entry
In case the boot manager entries need to be restored, they can be re-added without invoking grub-install. Load the efivars
kernel module and install sys-boot/efibootmgr:
root #
emerge --ask sys-boot/efibootmgr
Next add a boot menu entry:
root #
efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "gentoo" --loader "\EFI\gentoo\grubx86.efi"
grub-install: error: cannot find EFI directory.
Note
The following examples presumes a 64-bit EFI GRUB2 install, adjust accordingly for 32-bit EFI.
root #
grub-install --target=x86_64-efi
grub-install: error: cannot find EFI directory.
Properly setting the GRUB_PLATFORMS variable in /etc/portage/make.conf (the first time!) as listed above should resolve this error. Set the GRUB_PLATFORMS variable then re-emerge GRUB2 using the following command:
root #
emerge --ask --newuse sys-boot/grub:2
In the case this error persists try forcing the install to the EFI directory by issuing the grub-install command with correct parameters for the --target
and --efi-directory
options:
root #
grub-install --target=x86_64-efi --efi-directory=/boot
grub-install: Attempting to install GRUB2 to a disk or partition
root #
grub-install /dev/sda1
Attempting to install GRUB to a partition disk or to a partition. This is a BAD idea. Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged.
There could be many reasons for this error to come up.
No mounted /boot
A /boot partition is not mounted.
No BIOS boot partition while using BIOS-GPT setup
This could mean there is not a EF02
or bios_boot
partition to embed the core.img file in.
Creating a little partition of a few hundreds kilobytes may be enough, although it is good practice to align this partition to 2048 sectors to avoid a performance penalty with the disk. A 1 MiB partition should work well.
Attempting to install GRUB2 in a partition
When attempting to install GRUB2 in a partition e.g. /dev/sda5 (for instance because the boot loader will be chainloaded by a different boot loader), simply add --force
option switch to force install.
Missing target detection
If grub-install does not print any errors message or if the error message is about scanning disk files and several platforms are enabled in /etc/portage/make.conf while nothing is installed on the disk, then edit the /sbin/grub-install script with a text editor of choice.
Change the platform variable to the appropriate platform for the current use case. The platform must be rightly set when emerging sys-boot/grub, else it will be incorrectly configured in the /sbin/grub-install script.
For example, to set the platform for «PC», change platform=qemu
to platform=pc
.
Note
This is true for GRUB version 1.99x only… for GRUB2 the correct file to investigate can be found at /etc/grub.d/00_header; change transform="s,grub,grub-qemu,"
to transform="s,grub,grub2,"
for instance to install rightly with grub-$platform-install.
grub-setup: no post-MBR gap
root #
grub-bios-setup
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible! grub-bios-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged. grub-bios-setup: error: If you really want blocklists, use --force.
This error means that GRUB2 could not find the usual gap between the MBR and first partition of a disk. It is possible that the gap does not exist. Some tools (e.g. LiveUSB disk installer) format disks so that the first partition starts at sector 1 instead of 2048.
Repartitioning might be necessary to resolve the issue.
grub-install: embedding area is unusually small
root #
grub-install /dev/sda
grub-install: warn: Your embedding area is unusually small. core.img won't fit in it. grub-install: warn: 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.
There is not enough room at the beginning of the disk before the first partition.
In general this is a bit of trouble to fix. One or more partitions need to be resized in order to leave some free space at the beginning of the drive. The GParted LiveCD or SystemRescueCD are excellent tools to make this job less difficult.
If the swap partition is the first partition on the disk (e.g. /dev/sda1) it is possible to simply remove the existing swap space partition and re-partition the space. This resolution would avoid the need for booting into a live medium in order to resize a root (/) partition.
Не удается мне разобраться с загрузкой..
Итак, база установлена. В данный момент сделан chroot в установленную систему.
SSD 160GB, GPT
/dev/sda
— /dev/sda1 /boot — 512MB, FAT32 (под EFI, flags: boot, esp)
— /dev/sda2 /
— /dev/sda3 (здесь home планируется)
Итак, что имеется:
fstab:
#/dev/sda2
UUID=XXXXXXXXXX / ext4 ... 0 1
#/dev/sda1
UUID=XXXX-XXXX /boot/efi vfat ... 0 2
#/dev/sda3
UUID=XXXXXXXXXX /home ext4 ... 0 2
Установлены пакеты efibootmgr, grub
Что пробовал делать..
grub-install —root-directory=/boot/efi —boot-directory=/boot/efi/efi —bootloader-id=grub —recheck —debug
grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg
По логам всё в порядке.. Новая запись (с текстом grub) появляется в меню загрузки, однако попытка загрузиться выкидывает в BIOS
Я пытался из BIOSa прописать пути (функционал реализован). Скрин не мой, но картина такая же примерно — http://i.stack.imgur.com/jahqV.jpg
Добавляется опция загрузки через указание названия, раздела, а также пути к файлу-загрузчику (bootefiEFIgrubgrubx64.efi и в таком духе).. Как я только ни пытался, результат всегда один — снова выбрасывает в биос.. Не могу понять, почему. Где именно я ошибся и на каком месте..
Раньше я пытался поставить генту, но из-за того, что установка растянулась почти что на неделю, я поймал несколько кернел паник и не смог установить пакеты из-за сообщений об ошибках электропитания, на генту я решил забить. Хотя ее установка продвинулась дальше — мне удалось тогда загрузиться. Сейчас не удается загрузиться вообще, т.е. дальше EFI этого я не смог продвинуться.
С арчем пока всё нормально было до описываемого сейчас момента. Подскажете, что стоит проверить, на что нужно обратить внимание?
..
Сейчас вычистил полностью каталог boot, все свои старые эксперименты. Пребываю в chroot..
Подскажите алгоритм дальнейших действий по пунктам.
1.
По какой-то причине у меня во время установки в самом конце постоянно вылетает ошибка. Сама системя в общем ставится, но приходится устанавливать grub вручную с livecd и ещё исправлять UUID в файле /etc/fstab. Я уже создавал по этой проблеме топик Your text to link… и к этому геморою уже привык. Но решил попробовать manjaro KDE. Однако на этот раз старая схема дала сбой. Появилась новая ошибка
grub-install: error: /boot/efi doesn't look like an EFI partition.
Собственно, что я делал для её достижения:
[manjaro@manjaro ~]$ sudo su
[manjaro manjaro]# sudo mkdir /boot/efi
[manjaro manjaro]# mount /dev/sda2 /mnt
[manjaro manjaro]# mount /dev/sda1 /boot/efi
[manjaro manjaro]# cd /mnt
[manjaro mnt]# mount -t proc proc /mnt/proc
[manjaro mnt]# mount -t sysfs sys /mnt/sys
[manjaro mnt]# mount -o bind /dev /mnt/dev
[manjaro mnt]# mount -t devpts pts /mnt/dev/pts/
[manjaro mnt]# chroot /mnt
[root@manjaro /]# sudo pacman -Sy efibootmgr
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
warning: efibootmgr-17-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (1) efibootmgr-17-1
Total Download Size: 0.03 MiB
Total Installed Size: 0.08 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
efibootmgr-17-1-... 27.4 KiB 0.00 B/s 00:00 [###################] 100%
(1/1) checking keys in keyring [###################] 100%
(1/1) checking package integrity [###################] 100%
(1/1) loading package files [###################] 100%
(1/1) checking for file conflicts [###################] 100%
(1/1) checking available disk space [###################] 100%
:: Processing package changes...
(1/1) reinstalling efibootmgr [###################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[root@manjaro /]# sudo pacman -Sy dosfstools
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
warning: dosfstools-4.1-3 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (1) dosfstools-4.1-3
Total Download Size: 0.06 MiB
Total Installed Size: 0.17 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
dosfstools-4.1-3... 57.4 KiB 617 KiB/s 00:00 [###################] 100%
(1/1) checking keys in keyring [###################] 100%
(1/1) checking package integrity [###################] 100%
(1/1) loading package files [###################] 100%
(1/1) checking for file conflicts [###################] 100%
(1/1) checking available disk space [###################] 100%
:: Processing package changes...
(1/1) reinstalling dosfstools [###################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[root@manjaro /]# sudo pacman -Sy grub
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
resolving dependencies...
looking for conflicting packages...
Packages (1) grub-2.04-11.1
Total Download Size: 9.88 MiB
Total Installed Size: 48.87 MiB
Net Upgrade Size: -1.95 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages...
grub-2.04-11.1-x... 9.9 MiB 2.24 MiB/s 00:04 [###################] 100%
(1/1) checking keys in keyring [###################] 100%
(1/1) checking package integrity [###################] 100%
(1/1) loading package files [###################] 100%
(1/1) checking for file conflicts [###################] 100%
(1/1) checking available disk space [###################] 100%
warning: could not get file information for boot/grub/grub.cfg
:: Processing package changes...
(1/1) upgrading grub [###################] 100%
New optional dependencies for grub
libusb: For grub-emu USB support [installed]
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the info directory file...
[root@manjaro /]# sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro -recheck
grub-install: invalid option -- 'r'
Try 'grub-install --help' or 'grub-install --usage' for more information.
[root@manjaro /]# sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.
[root@manjaro /]# sudo pacman -Sy mtools os-prober
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
warning: mtools-4.0.24-1 is up to date -- reinstalling
warning: os-prober-1.77-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (2) mtools-4.0.24-1 os-prober-1.77-1
Total Installed Size: 0.48 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n] y
(2/2) checking keys in keyring [###########################################################] 100%
(2/2) checking package integrity [###########################################################] 100%
(2/2) loading package files [###########################################################] 100%
(2/2) checking for file conflicts [###########################################################] 100%
(2/2) checking available disk space [###########################################################] 100%
:: Processing package changes...
(1/2) reinstalling mtools [###########################################################] 100%
(2/2) reinstalling os-prober [###########################################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the info directory file...
[root@manjaro /]# sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.
Ноут с GPT разметкой под UEFI. Я создал раздел sda1 на 512 мб, форматировал как fat32, и пометил флагами boot, esp. sda2 — это корневой раздел. Т.е. всё по инструкции.
[root@manjaro /]# parted -l
Model: ATA HGST HTS545050A7 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 ESP Boot boot, esp
2 538MB 54.2GB 53.7GB ext4
3 54.2GB 243GB 189GB ext4
4 243GB 252GB 8703MB ext4
5 252GB 305GB 53.7GB ntfs msftdata
6 305GB 500GB 195GB ntfs msftdata
Model: USB DISK 2.0 (scsi)
Disk /dev/sdb: 7748MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
2 3120MB 3124MB 4194kB primary esp
Гугл не помог. В основном там у всех просто формат диска в каком-нибудь ext2, а не в fat32. У меня не так. В чём моя ошибка?
Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.
So i am pretty sure i installed this system using uefi but on another computer
I have since moved the hard drive to another compuetr. The first inkling that things weren’t right was when I booted into the BIOS to find the drive is not seen in UEFI but only when Legacy mode is also included. It boots in Legacy mode.
The disk is partitioned as
Code: Select all
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 206847 204800 100M b W95 FAT32
/dev/sda2 206848 468860927 468654080 223.5G 83 Linux
/dev/sda1 is mounted on /boot/efi
But when I try run
# grub-install /dev/sda
Code: Select all
grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
The installed grub packages
# dpkg -l | grep grub
Code: Select all
ii grub-common 2.02+dfsg1-20+deb10u2 amd64 GRand Unified Bootloader (common files)
ii grub-customizer 5.1.0-3 amd64 GUI to configure GRUB2 and BURG
ii grub-efi 2.02+dfsg1-20+deb10u2 amd64 GRand Unified Bootloader, version 2 (dummy package)
ii grub-efi-amd64 2.02+dfsg1-20+deb10u2 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 version)
ii grub-efi-amd64-bin 2.02+dfsg1-20+deb10u2 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 modules)
ii grub-efi-amd64-signed 1+2.02+dfsg1+20+deb10u2 amd64 GRand Unified Bootloader, version 2 (amd64 UEFI signed by Debian)
hi grub2-common 2.02+dfsg1-20+deb10u2 amd64 GRand Unified Bootloader (common files for version 2)
I installed the signed and customizer packages after the problems
So to try and resolve this I picked up what is believed should work. Using the debian 10 live dvd, I chroot into the system
Code: Select all
# mount /dev/sda2 /mnt
# mount /dev/sda1 /mnt/boot/efi
# for name in proc sys dev; do mount --bind /$name /mnt/$name; done
# chroot /mnt /bin/bash
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars
# grub-install /dev/sda
Grub reports no errors. I can see there are files in /sys/firmware/efi/efivars
But of course when I reboot I get the error above
Some other things I have looked at
# modprobe efivars
Code: Select all
modprobe: ERROR: could not insert 'efivars': No such device
# efivar -l
Code: Select all
efivar: error listing variables: Function not implemented
# efibootmgr
Code: Select all
EFI variables are not supported on this system.
Is there anything else I can do to get efivars onto the system? I assume that copying the efivar folder in /sys won’t help.
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) — Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 1th Gen — Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 — Sid