Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Confused, Grub install command.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DavidF
n00b
n00b


Joined: 12 Jan 2004
Posts: 45
Location: Rocky Mountains

PostPosted: Fri Mar 29, 2024 3:30 pm    Post subject: Confused, Grub install command. Reply with quote

I messed this up yesterday and had to restore from a back-up to boot. I have grub 2.12-r2 installed. My current grub directories are /boot/EFI/BOOT and /boot/EFI/gentoo. I have read the upgrade info and the handbook and I am not confident in the exact command I should use. The Handbook sounds like I should have /boot/efi/EFI. What should my exact command be to configure grub? I think I understand the --removable but the path is my concern.

Long time user with a newbie question.
David
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2968

PostPosted: Fri Mar 29, 2024 3:58 pm    Post subject: Re: Confused, Grub install command. Reply with quote

DavidF wrote:
I messed this up yesterday and had to restore from a back-up to boot. I have grub 2.12-r2 installed. My current grub directories are /boot/EFI/BOOT and /boot/EFI/gentoo.


Very simple and crucial info missing...

Where do you mount your ESP?
Back to top
View user's profile Send private message
DavidF
n00b
n00b


Joined: 12 Jan 2004
Posts: 45
Location: Rocky Mountains

PostPosted: Fri Mar 29, 2024 4:10 pm    Post subject: Reply with quote

I hate to say it, but I am not sure. There is no directory in /boot, /boot/grub has a x86_64-efi directory.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1663

PostPosted: Fri Mar 29, 2024 4:24 pm    Post subject: Reply with quote

The ESP is usually a vfat partition of its own. Use the command lsblk -f and it will likely show this.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4167
Location: Bavaria

PostPosted: Fri Mar 29, 2024 4:37 pm    Post subject: Reply with quote

DavidF,

Now ... it really doesn't matter which mountpoint you have used so far, because you can mount your ESP (efi system partition) wherever you want; of course I recommend the "new" standard mountpoint /efi right away (if you don't have /efi, just create it).

Maybe read this first to understand some changes: https://forums.gentoo.org/viewtopic-t-1165115-highlight-.html

Can you boot into your old system ? If not boot with our GentooMinimalCD and chroot into your system:
( https://wiki.gentoo.org/wiki/User:Pietinger/New_at_Gentoo#Pause_during_Installation )

If you have other settings in your /etc/fstab you can change them later and mount immediately - manual - with: "mount /dev/nvme0n1p1 /efi" or "mount /dev/sda1 /efi" (Check if the first partition is really your ESP with "parted -l" OR "fdisk -l").

Now look into your ESP with "ls -lR /efi" ... Do you see (1) "only" some xxx.efi files ... or (2) also the grub ?

If (1) then you had the new mountpoint already active and grub is in /boot OF THE ROOT partition.
If (2) then you had an old installation where the ESP was mointed to /boot -> Now you can decide if you want switch to the new /mountpoint or leave it the way it was ...

This is an - very actual - (short) descritption for a modern installation:
https://wiki.gentoo.org/wiki/User:Pietinger/Draft/Quick_Installation_OpenRC_for_an_UEFI_System

Here you see a checklist for an UEFI boot (dont use ist for dist-kernel; only informational):
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Boot_kernel_via_UEFI
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
DavidF
n00b
n00b


Joined: 12 Jan 2004
Posts: 45
Location: Rocky Mountains

PostPosted: Fri Mar 29, 2024 5:12 pm    Post subject: Reply with quote

Ok, Here is what I know ...

1.) Yesterday I updated the kernel and the new grub version caused the system to boot to bios.

2.) I restored the system from back-up and it boots and runs now.

3.) My vfat partition is nvme1n1p1 and contains /boot/EFI/BOOT/BOOTX64.EFI and /boot/gentoo/grubx64.efi and /boot/grub/x86_64-efi

4.) I have configured new grub versions in the past and do not remember the command I used.

I assume that I have a working esp but honestly I am not sure I understand what it does. I have read most of the material but am not sure how to proceed. It sounds like I do not have a standard install.
Back to top
View user's profile Send private message
DavidF
n00b
n00b


Joined: 12 Jan 2004
Posts: 45
Location: Rocky Mountains

PostPosted: Fri Mar 29, 2024 5:35 pm    Post subject: Reply with quote

Based on my directory structure would my install be ... grub-install --efi-directory=/boot/EFI
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1663

PostPosted: Fri Mar 29, 2024 5:59 pm    Post subject: Reply with quote

DavidF wrote:
Based on my directory structure would my install be ... grub-install --efi-directory=/boot/EFI

grub-install --efi-directory=/boot is likely what you are looking for
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4167
Location: Bavaria

PostPosted: Fri Mar 29, 2024 6:34 pm    Post subject: Reply with quote

DavidF,

please give us the output of the command efibootmgr (this is most important) and fdisk -l (or "parted -l") and blkid and lsblk

grknight wrote:
grub-install --efi-directory=/boot is likely what you are looking for

I would wait a little bit until we get the output, because it could be he has a corrupt UEFI which needs the parameter "--removable", because this is wrong:
DavidF wrote:
My vfat partition is nvme1n1p1 and contains /boot/EFI/BOOT/BOOTX64.EFI and /boot/gentoo/grubx64.efi and /boot/grub/x86_64-efi

It should be /boot/EFI/gentoo/grubx64.efi and /boot/EFI/grub/x86_64-efi (if he has mounted his ESP to /boot).
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
DavidF
n00b
n00b


Joined: 12 Jan 2004
Posts: 45
Location: Rocky Mountains

PostPosted: Fri Mar 29, 2024 7:02 pm    Post subject: Reply with quote

Here is the output ..

Code:
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001,0006,0004,0002,0003,0005
Boot0000* gentoo   HD(1,GPT,572cc49b-8094-e94a-9029-11267d1170e6,0x800,0x100000)/File(\EFI\gentoo\g​rubx64.efi)
Boot0001* Pop!_OS 22.04 LTS   HD(1,GPT,ec36019f-a7a6-4820-84bb-68b955803bbc,0x1000,0x1fefff)/File(\EFI\SYSTEMD​\SYSTEMD-BOOTX64.EFI)
Boot0002* UEFI:CD/DVD Drive   BBS(129,,0x0)
Boot0003* UEFI:Removable Device   BBS(130,,0x0)
Boot0004* UEFI OS   HD(1,GPT,572cc49b-8094-e94a-9029-11267d1170e6,0x800,0x100000)/File(\EFI\BOOT\BOO​TX64.EFI)0000424f
Boot0005* UEFI:Network Device   BBS(131,,0x0)
Boot0006* UEFI OS   HD(1,GPT,ec36019f-a7a6-4820-84bb-68b955803bbc,0x1000,0x1fefff)/File(\EFI\BOOT\BO​OTX64.EFI)0000424f

fdisk -l

Code:
Disk /dev/nvme1n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 980 PRO 2TB
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: A5D69C70-91C6-9A49-AB5E-89DF63E5633B

Device            Start        End    Sectors  Size Type
/dev/nvme1n1p1     2048    1050623    1048576  512M Microsoft basic data
/dev/nvme1n1p2  1050624   17827839   16777216    8G Linux swap
/dev/nvme1n1p3 17827840 3907028991 3889201152  1.8T Linux filesystem


Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 980 PRO 1TB
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: 9E52D2FD-2AF0-4909-BBD2-621F65D73EA6

Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1       4096    2097150    2093055  1022M EFI System
/dev/nvme0n1p2    2097152   10485758    8388607     4G Microsoft basic data
/dev/nvme0n1p3   10485760 1945132462 1934646703 922.5G Linux filesystem
/dev/nvme0n1p4 1945132464 1953521070    8388607     4G Linux swap


Disk /dev/nvme2n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 980 PRO 2TB
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: 19A81083-923D-442A-81AE-51C5DD6FDC99

Device         Start        End    Sectors  Size Type
/dev/nvme2n1p1  2048 3907028991 3907026944  1.8T Linux filesystem


Disk /dev/nvme3n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 980 PRO 1TB
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: A5A7814F-0A99-1149-8C1A-B9FE14BC43E6

Device         Start        End    Sectors   Size Type
/dev/nvme3n1p1  2048 1953523711 1953521664 931.5G Linux filesystem


Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
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: dos
Disk identifier: 0xfd2c7920

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1        2048 976773119 976771072 465.8G 83 Linux


Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 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: 303F77D8-8B0C-4A56-BBA7-C63AEA2F3D2C

Device     Start        End    Sectors   Size Type
/dev/sdb2  32768 1953523711 1953490944 931.5G Linux filesystem

blkid

Code:
/dev/nvme0n1p3: UUID="9c664827-044f-4ae9-9448-45ba13bdcfa9" TYPE="crypto_LUKS" PARTUUID="023bf3b7-a30b-48fc-901c-7cc10ca3418f"
/dev/nvme0n1p1: UUID="324A-EEFE" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="ec36019f-a7a6-4820-84bb-68b955803bbc"
/dev/nvme0n1p4: UUID="7ec8a54e-3d49-47a5-a244-984f9ca1c097" TYPE="swap" PARTUUID="398ea737-1212-4c70-b7b6-3355b406a815"
/dev/nvme0n1p2: UUID="324A-EF01" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="recovery" PARTUUID="a2b84d09-a232-4a74-860d-fe6701dad7be"
/dev/nvme3n1p1: LABEL="M.2" UUID="6725461a-8e2d-44a2-acdb-7695253f2bd9" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="6d39a8cf-2494-41f2-b4a5-9a4f7b2b5cf9"
/dev/sdb2: LABEL="Timeshift" UUID="742eb429-08c7-4e84-916c-ec97523ad8eb" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="85823431-230a-43be-aa0a-ba130db60479"
/dev/nvme2n1p1: LABEL="Storage-1" UUID="006943bd-de21-48c8-b190-a923f1dbcccf" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Storage-1" PARTUUID="e0920fca-95d2-4d4a-89a0-3d82b36ea81a"
/dev/nvme1n1p2: UUID="a175d437-b378-4b87-8e14-cad218f79564" TYPE="swap" PARTUUID="ce6637c7-d1e4-d042-a42e-21a6ab8ff227"
/dev/nvme1n1p3: UUID="775153ef-3f60-468d-b372-311253159df1" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="9331b0ff-c384-f246-b649-43d73884d996"
/dev/nvme1n1p1: UUID="A8C0-CACA" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="572cc49b-8094-e94a-9029-11267d1170e6"
/dev/sda1: LABEL="Linux SSD" UUID="901c7897-de6c-4626-8497-b2699177aa52" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="fd2c7920-01"

lsblk

Code:
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 465.8G  0 disk
└─sda1        8:1    0 465.8G  0 part
sdb           8:16   0 931.5G  0 disk
└─sdb2        8:18   0 931.5G  0 part
nvme1n1     259:0    0   1.8T  0 disk
├─nvme1n1p1 259:1    0   512M  0 part /boot
├─nvme1n1p2 259:2    0     8G  0 part [SWAP]
└─nvme1n1p3 259:3    0   1.8T  0 part /
nvme0n1     259:4    0 931.5G  0 disk
├─nvme0n1p1 259:5    0  1022M  0 part
├─nvme0n1p2 259:6    0     4G  0 part
├─nvme0n1p3 259:7    0 922.5G  0 part
└─nvme0n1p4 259:8    0     4G  0 part
nvme2n1     259:9    0   1.8T  0 disk
└─nvme2n1p1 259:11   0   1.8T  0 part
nvme3n1     259:10   0 931.5G  0 disk
└─nvme3n1p1 259:12   0 931.5G  0 part

I went ahead and ran sudo grub-install --efi-directory=/boot and sudo grub-mkconfig -o /boot/grub/grub.cfg. I rebooted and am up and running.

In checking BOOTX64.EFI did not update but grub64.efi did.

[Moderator edit: added [code] tags to preserve output layout; broke long whitespace-free lines in code tags to fix thread layout. -Hu]
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4167
Location: Bavaria

PostPosted: Fri Mar 29, 2024 8:15 pm    Post subject: Reply with quote

DavidF wrote:
[...] I rebooted and am up and running.[...]

Great ! :D Yes, it must have been a typo (or bad copying) - you have indeed: /boot/EFI/gentoo/grubx64.efi =>
Code:
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001,0006,0004,0002,0003,0005
Boot0000* gentoo   HD(1,GPT,572cc49b-8094-e94a-9029-11267d1170e6,0x800,0x100000)/File(\EFI\gentoo\g​rubx64.efi)
[...]

BTW: I can see you are using two partitions as ESP ... the first ESP is nvme0n1p1 and you are using the second ESP (*) for your Gentoo ... Look to the partition-UUIDs:
Code:
Boot0000* gentoo   HD(1,GPT,572cc49b-8094-e94a-9029-11267d1170e6,
Boot0001* Pop!_OS 22.04 LTS   HD(1,GPT,ec36019f-a7a6-4820-84bb-68b955803bbc
Boot0004* UEFI OS   HD(1,GPT,572cc49b-8094-e94a-9029-11267d1170e6,
Boot0006* UEFI OS   HD(1,GPT,ec36019f-a7a6-4820-84bb-68b955803bbc

<=>
Code:
/dev/nvme0n1p1: ... TYPE="vfat" PARTUUID="ec36019f-a7a6-4820-84bb-68b955803bbc"

/dev/nvme1n1p1: ... TYPE="vfat" PARTUUID="572cc49b-8094-e94a-9029-11267d1170e6"


*) You have a brave UEFI ... some UEFI dont like it when the ESP has not the correct ESP-flag on its partition =>
Code:
Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1       4096    2097150    2093055  1022M EFI System

Device            Start        End    Sectors  Size Type
/dev/nvme1n1p1     2048    1050623    1048576  512M Microsoft basic data

_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
DavidF
n00b
n00b


Joined: 12 Jan 2004
Posts: 45
Location: Rocky Mountains

PostPosted: Fri Mar 29, 2024 8:47 pm    Post subject: Reply with quote

Thank you for helping me think this through. You guys have always shown a caring attitude. It is appreciated!
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4167
Location: Bavaria

PostPosted: Fri Mar 29, 2024 10:05 pm    Post subject: Reply with quote

DavidF wrote:
Thank you for helping me think this through. You guys have always shown a caring attitude. It is appreciated!

You are very Welcome ! :D
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum