View previous topic :: View next topic |
Author |
Message |
flysideways Guru
Joined: 29 Jan 2005 Posts: 438
|
Posted: Mon Apr 15, 2024 6:34 am Post subject: |
|
|
ONEEYEMAN wrote: | Hi,
I went and bought myself an external CD-ROM.
Booted, chrooted and fixed "installkernel".
Now I don't remember if the GRUB also was updated, but I don't think so.
However - just in case I want to reinstall it.
But the HB is now contains too much information and I don't remember what/how the GRUB was installed.
Is there a way to find out?
I think I used EFI with GPT label but I'm not sure...
Thank you. |
From the same computer; Code: | # fdisk -l /dev/sdd
Disk /dev/sdd: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 870
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 10D68705-54C6-4B4A-9A4F-AD2A7A5D574A
Device Start End Sectors Size Type
/dev/sdd1 2048 4196351 4194304 2G EFI System
/dev/sdd2 4196352 71305215 67108864 32G Linux swap
/dev/sdd3 71305216 976773119 905467904 431.8G Linux filesystem |
The disk label shows GPT.
Code: | # ls -lh /boot/grub/
total 88K
drwxr-xr-x 2 root root 25 Feb 27 07:34 fonts
-rw------- 1 root root 30K Apr 14 07:02 grub.cfg
-rw------- 1 root root 28K Apr 14 07:02 grub.cfg~
-rw-r--r-- 1 root root 1.0K Feb 27 07:34 grubenv
drwxr-xr-x 2 root root 4.0K Mar 2 05:40 locale
drwxr-xr-x 3 root root 23 Feb 27 07:34 themes
drwxr-xr-x 2 root root 16K Mar 2 05:40 x86_64-efi
| This provides some insight as to how grub was installed. |
|
Back to top |
|
|
ONEEYEMAN Advocate
Joined: 01 Mar 2005 Posts: 3612
|
Posted: Mon Apr 15, 2024 6:02 pm Post subject: |
|
|
Hi,
This weird.
I also have GPT as label on the fdisk output and x86_64-efi directory in /boot/grub.
But trying to install it as EFI results in an error.
Thank you. |
|
Back to top |
|
|
flysideways Guru
Joined: 29 Jan 2005 Posts: 438
|
Posted: Tue Apr 16, 2024 12:14 am Post subject: |
|
|
What is the command you used to attempt to install grub? And, do you have GRUB_PLATFORMS="efi-64" in /etc/portage/make.conf? |
|
Back to top |
|
|
ONEEYEMAN Advocate
Joined: 01 Mar 2005 Posts: 3612
|
Posted: Tue Apr 16, 2024 12:25 am Post subject: |
|
|
Hi,
The commands are:
Code: |
grub-install /dev/sda
you'd grub-install --efi-directory=/boot
you'd grub-install --target x86_64-efi --efi-directory=/boot
|
And yes - I do have this line...
Thank you. |
|
Back to top |
|
|
flysideways Guru
Joined: 29 Jan 2005 Posts: 438
|
Posted: Tue Apr 16, 2024 3:02 am Post subject: |
|
|
ONEEYEMAN wrote: | Hi,
The commands are:
Code: |
grub-install /dev/sda
|
And yes - I do have this line...
Thank you. |
This line from your mount command output Code: | /dev/sda1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) | would indicate that grub-install /dev/sda should be grub-install /dev/sda1
Code: | you'd grub-install --efi-directory=/boot
you'd grub-install --target x86_64-efi --efi-directory=/boot |
The FX-8350 computer is set up with the currently suggested scheme using an /efi directory. It was Code: | grub-install --target x86_64-efi --efi-directory=/efi | and that is mounted on the 1st partition. |
|
Back to top |
|
|
ONEEYEMAN Advocate
Joined: 01 Mar 2005 Posts: 3612
|
Posted: Tue Apr 16, 2024 4:21 am Post subject: |
|
|
Hi,
does not yield anything...
Running:
Code: |
grub-install /dev/sda1
|
or
Code: |
grub-install --efi-directory=/efi
|
both rsults in the:
Quote: |
[/usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory
|
Now this:
Code: |
grub-install --target x86_64-efi --efi-directory=/efi
|
results in:
Quote: |
Installing for x86_64-efi platform.
grub-install:error: Failed to get canonicl path for /efi
|
Thank you. |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1549 Location: South America
|
Posted: Tue Apr 16, 2024 4:05 pm Post subject: |
|
|
Let's stop guessing your setup. Post the outputs of:
Code: | $ lsblk -o name,mountpoints,partlabel,parttype
$ ls /sys/firmware |
_________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
ONEEYEMAN Advocate
Joined: 01 Mar 2005 Posts: 3612
|
Posted: Tue Apr 16, 2024 6:22 pm Post subject: |
|
|
Hi,
The output is:
Code: |
loop0
sda
|----------sda1/boot c12a7328-f81f-11d2-ba4b-00a0c93ec93b
|---------- sda2 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
|---------- sda3 / 0fc63daf-8483-4772-8e79-3d69d8477dc4
|
All 3 are directories...
Thank you. |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1549 Location: South America
|
Posted: Tue Apr 16, 2024 7:27 pm Post subject: |
|
|
ONEEYEMAN wrote: | Code: | loop0
sda
|----------sda1/boot c12a7328-f81f-11d2-ba4b-00a0c93ec93b
|---------- sda2 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
|---------- sda3 / 0fc63daf-8483-4772-8e79-3d69d8477dc4 |
|
Alright, disk /dev/sda has a GUID partition table (GPT), partition 1 is marked as the EFI System Partition (ESP) and is mounted at /boot, so likely this computer supports UEFI, and your normal GRUB update command should be grub-install --efi-directory=/boot. However:
your rescue medium has not booted in UEFI mode, or otherwise there would be another directory named efi. That's why you are having trouble, particularly with updating EFI variables:
ONEEYEMAN wrote: | Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub-install: error: efibootmgrfailed to register the boot entry: No such file or directory. |
It may not matter, though, because you are using GRUB, so the pathname in the ESP's filesystem of the executable that the firmware should run doesn't really change.
Given all of this, with /dev/sda1 mounted, try this:
Code: | # rm -r /boot/grub/x86_64-efi # Wipe all old GRUB modules
# grub-install --no-nvram --target=x86_64-efi --efi-directory=/boot # This one time only
# grub-mkconfig -o /boot/grub/grub.cfg |
And if all commands succeeded, try rebooting the computer. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
flysideways Guru
Joined: 29 Jan 2005 Posts: 438
|
Posted: Tue Apr 16, 2024 7:35 pm Post subject: |
|
|
I am interested as to why it is looking for the modinfo.sh file here; /usr/lib/grub/i386-pc/modinfo.sh
The modinfo.sh file on my amd64 machines using UEFI are here; /usr/lib/grub/x86_64-efi/modinfo.sh
The wiki.gentoo.org grub entry says; Quote: | grub-install accepts a --target option to set the CPU architecture and system platform. If unspecified, grub-install will attempt to guess the correct values; on an amd64/x86 system in BIOS mode it will use i386-pc by default and in conjunction with a GUID partition table (GPT) a "BIOS boot partition" will be automatically used when present. |
I'm guessing at some time your system was booted in the BIOS mode, not UEFI, and grub guessed i386-pc for you.
Is your pc actually booting into UEFI mode? or BIOS mode?
Last edited by flysideways on Tue Apr 16, 2024 7:47 pm; edited 2 times in total |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1549 Location: South America
|
Posted: Tue Apr 16, 2024 7:41 pm Post subject: |
|
|
flysideways wrote: | I am interested as to why it is looking for the modinfo.sh file here; /usr/lib/grub/i386-pc/modinfo.sh |
Because the rescue medium did not boot in UEFI mode, so grub-install without a --target option autodetects the target as i386-pc, i.e BIOS, and tries to copy the BIOS variant of its modules, which are expected to be in /usr/lib/grub/i386-pc. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
ONEEYEMAN Advocate
Joined: 01 Mar 2005 Posts: 3612
|
Posted: Tue Apr 16, 2024 8:44 pm Post subject: |
|
|
GDH-gentoo,
Should I back-up the content of the folder or just delete it?
Thank you. |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1549 Location: South America
|
Posted: Tue Apr 16, 2024 9:52 pm Post subject: |
|
|
ONEEYEMAN wrote: | Should I back-up the content of the folder or just delete it? |
You can back it up for safety if you want to. Just make sure that it is empty or removed before grub-install, and that it has been repopulated after. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
ONEEYEMAN Advocate
Joined: 01 Mar 2005 Posts: 3612
|
Posted: Wed Apr 17, 2024 1:18 am Post subject: |
|
|
Hi,
That worked.
Thx.
Now I have another problem... - I killed half of my home dir...
But that's on me.
I will restore the network and see if
At least I can login...
And I thik we can put this thread to sleep...
Thank you. |
|
Back to top |
|
|
|