I have only pictures. And I can’t write the Question well.
I was starting my laptop (with Windows 10 Pro
and CentOS8
).
systemctl status initrd-switch-root.service
https://i.stack.imgur.com/fuGRU.jpg
https://i.stack.imgur.com/CAQ7Y.jpg
The last image Failed to Start Switch Root
.
And
Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.
https://i.stack.imgur.com/onWbr.jpg
Doing a ls -al /sysroot
the directory is empty.
With dmesg
i got:
any idea why this failure occurs?
And obviously, how I can solve it?
In the image, the only entry working is Rescue
The CentOS entry that is above the Windows entry CentOS Linux (0-rescue-***)
Please help.
EDIT 1:
Using solution https://unix.stackexchange.com/a/212710/117555
- Check dev ->
ls -al /dev/s*
- Insert the USB stick
- Check Again ->
ls -al /dev/s*
- Create Mounting Directory ->
mkdir -p /mnt/logError_SwitchRoot
- Mount the stick ->
mount /dev/sd[letter][number] /mnt/logError_SwitchRoot
- Copy the File ->
cp /run/initramfs/rdsosreport.txt /mnt/logError_SwitchRoot
- Umount the stick ->
umount /mnt/logError_SwitchRoot
I have now on rdsosreport.txt
file on https://drive.google.com/file/d/1vMK0QAoyMZ7xTibDqn8Y_Y9nohUStN-6/view?usp=sharing
Checking the File:
/dev/nvme0n1p1: LABEL="SYSTEM_DRV" UUID="5464-19F2" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="31ebd6ef-ec98-42c7-a57b-7855c2c9a1f3"
/dev/nvme0n1p5: LABEL="WINRE_DRV" UUID="C2EC6975EC69651F" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="51363955-3d66-4f95-92de-732ccff36936"
/dev/nvme0n1p6: LABEL="boot_efi" UUID="6E91-210B" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="5291c15b-2f5c-42a0-b3e3-2c69f27b801b"
/dev/nvme0n1p7: UUID="7471a525-f8c8-4a77-819e-65b40c04eaaf" TYPE="ext4" PARTUUID="13b3a31b-193f-4ef5-9076-a083cdc857de"
/dev/nvme0n1p8: UUID="d1ee8d12-37a1-43e7-9f13-0f97544864aa" TYPE="ext4" PARTUUID="88cd29e2-3b20-44e4-bdf4-0ce02d9008d6"
/dev/nvme0n1p9: UUID="54f24598-4a21-4875-bacd-61c060de891f" TYPE="ext4" PARTUUID="d1126852-240f-4e03-a8f3-86f769b3fd77"
/dev/nvme0n1p10: UUID="3fc5f4f8-566b-48e2-85e1-59f5dccdcb57" TYPE="ext4" PARTUUID="b2190e39-3ee8-4a41-a156-6a866ee8ee14"
/dev/nvme0n1p11: UUID="42640b78-ce32-403c-8705-8c12e2d02855" TYPE="swap" PARTUUID="acc07fc2-4876-42c0-9d02-b066c04cfd4f"
/dev/sda1: LABEL="EFI" UUID="67E3-17ED" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="5cd547d2-a0ef-4c51-8a00-9877055342bb"
/dev/nvme0n1: PTUUID="e24c5cda-1faa-490b-b677-7c4792194960" PTTYPE="gpt"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="b692aa4c-0d83-40f0-8707-cd0b49290b00"
/dev/nvme0n1p3: PARTLABEL="Basic data partition" PARTUUID="72f573a8-4b1d-40ab-900c-5b2b608fa964"
/dev/nvme0n1p4: PARTLABEL="Basic data partition" PARTUUID="50badba8-609d-4a24-b957-c8f90b8d7d80"
/dev/sda2: PARTUUID="f704e2d2-a0b9-4fa4-9b19-cef07c8b6668"
And
BOOT_IMAGE=(hd1,gpt7)/vmlinuz-5.8.0-1.el8.elrepo.x86_64
EDIT 2:
I found some pictures of my installation (5 July 2020 15:05, for my reference)!
DATA
/home
nvme0n1p8
SYSTEM
/boot/efi
nvme0n1p6
/var
nvme0n1p10
/
nvme0n1p9
/boot
nvme0n1p7
swap
nvme0n1p11
Here my info (After the restart)
[root@centos /]# lsblk -o NAME,MAJ:MIN,RM,SIZE,RO,FSTYPE,UUID,MOUNTPOINT
NAME MAJ:MIN RM SIZE RO FSTYPE UUID MOUNTPOINT
loop0 7:0 0 29.8M 1 squashfs /var/lib/snapd/snap/snapd/8140
loop1 7:1 0 55M 1 squashfs /var/lib/snapd/snap/core18/1754
loop2 7:2 0 29.9M 1 squashfs /var/lib/snapd/snap/snapd/8542
loop3 7:3 0 55M 1 squashfs /var/lib/snapd/snap/core18/1880
loop4 7:4 0 97M 1 squashfs /var/lib/snapd/snap/core/9665
loop5 7:5 0 62.1M 1 squashfs /var/lib/snapd/snap/gtk-common-themes/1506
nvme0n1 259:0 0 477G 0
├─nvme0n1p1 259:1 0 260M 0 vfat 5464-19F2
├─nvme0n1p2 259:2 0 16M 0
├─nvme0n1p3 259:3 0 115.7G 0
├─nvme0n1p4 259:4 0 104G 0
├─nvme0n1p5 259:5 0 1000M 0 ntfs C2EC6975EC69651F
├─nvme0n1p6 259:6 0 1G 0 vfat 6E91-210B /boot/efi
├─nvme0n1p7 259:7 0 1G 0 ext4 7471a525-f8c8-4a77-819e-65b40c04eaaf /boot
├─nvme0n1p8 259:8 0 174G 0 ext4 d1ee8d12-37a1-43e7-9f13-0f97544864aa /home
├─nvme0n1p9 259:9 0 32G 0 ext4 54f24598-4a21-4875-bacd-61c060de891f /
├─nvme0n1p10 259:10 0 24G 0 ext4 3fc5f4f8-566b-48e2-85e1-59f5dccdcb57 /var
└─nvme0n1p11 259:11 0 24G 0 swap 42640b78-ce32-403c-8705-8c12e2d02855 [SWAP]
[root@centos /]#
I have this list...
/tmp/nvme0n1p6/:
total 16
drwxr-xr-x 4 root root 4096 Jan 1 1970 .
drwxr-xr-x 6 root root 120 Jun 11 02:11 ..
drwxr-xr-x 4 root root 4096 Jul 5 2020 EFI
-rwxr-xr-x 1 root root 4096 Jan 1 1980 FSCK0000.REC
drwxr-xr-x 2 root root 4096 Jul 22 2020 System Volume Information
/tmp/nvme0n1p6/EFI:
total 16
drwxr-xr-x 4 root root 4096 Jul 5 2020 .
drwxr-xr-x 4 root root 4096 Jan 1 1970 ..
drwxr-xr-x 2 root root 4096 Jul 5 2020 BOOT
drwxr-xr-x 3 root root 4096 Aug 23 2020 centos
/tmp/nvme0n1p6/EFI/BOOT:
total 1544
drwxr-xr-x 2 root root 4096 Jul 5 2020 .
drwxr-xr-x 4 root root 4096 Jul 5 2020 ..
-rwxr-xr-x 1 root root 1211224 May 7 2020 BOOTX64.EFI
-rwxr-xr-x 1 root root 356800 May 7 2020 fbx64.efi
/tmp/nvme0n1p6/EFI/centos:
total 5360
drwxr-xr-x 3 root root 4096 Aug 23 2020 .
drwxr-xr-x 4 root root 4096 Jul 5 2020 ..
-rwxr-xr-x 1 root root 134 May 7 2020 BOOTX64.CSV
drwxr-xr-x 2 root root 4096 Apr 14 2020 fonts
-rwxr-xr-x 1 root root 5502 Jul 5 2020 grub.cfg
-rwxr-xr-x 1 root root 0 Aug 23 2020 grubenv
-rwxr-xr-x 1 root root 1877384 Apr 14 2020 grubx64.efi
-rwxr-xr-x 1 root root 1160136 May 7 2020 mmx64.efi
-rwxr-xr-x 1 root root 1205152 May 7 2020 shimx64-centos.efi
-rwxr-xr-x 1 root root 1211224 May 7 2020 shimx64.efi
/tmp/nvme0n1p6/EFI/centos/fonts:
total 8
drwxr-xr-x 2 root root 4096 Apr 14 2020 .
drwxr-xr-x 3 root root 4096 Aug 23 2020 ..
/tmp/nvme0n1p6/System Volume Information:
total 8
drwxr-xr-x 2 root root 4096 Jul 22 2020 .
drwxr-xr-x 4 root root 4096 Jan 1 1970 ..
And this another List
/tmp/nvme0n1p7/:
total 360344
dr-xr-xr-x 7 root root 4096 Aug 11 2020 .
drwxr-xr-x 7 root root 140 Jun 11 02:17 ..
-rw-r--r-- 1 root root 166 Dec 4 2019 .vmlinuz-4.18.0-147.el8.x86_64.hmac
-rw-r--r-- 1 root root 172 Jun 10 2020 .vmlinuz-4.18.0-193.6.3.el8_2.x86_64.hmac
drwxrwxrwx 2 nobody 65534 4096 Sep 7 2020 System Volume Information
-rw------- 1 root root 3838259 Dec 4 2019 System.map-4.18.0-147.el8.x86_64
-rw------- 1 root root 3910484 Jun 10 2020 System.map-4.18.0-193.6.3.el8_2.x86_64
-rw------- 1 root root 4654688 Jul 7 2020 System.map-5.7.8-1.el8.elrepo.x86_64
-rw------- 1 root root 4714527 Aug 2 2020 System.map-5.8.0-1.el8.elrepo.x86_64
-rw-r--r-- 1 root root 184613 Dec 4 2019 config-4.18.0-147.el8.x86_64
-rw-r--r-- 1 root root 187643 Jun 10 2020 config-4.18.0-193.6.3.el8_2.x86_64
-rw-r--r-- 1 root root 197087 Jul 7 2020 config-5.7.8-1.el8.elrepo.x86_64
-rw-r--r-- 1 root root 201589 Aug 2 2020 config-5.8.0-1.el8.elrepo.x86_64
drwxr-xr-x 2 root root 4096 Jul 5 2020 efi
drwx------ 2 root root 4096 Apr 14 2020 grub2
-rw------- 1 root root 71713525 Jul 5 2020 initramfs-0-rescue-fb78af0a9247484aad9831a10a928084.img
-rw------- 1 root root 49320247 Jul 6 2020 initramfs-4.18.0-147.el8.x86_64.img
-rw------- 1 root root 18223920 Jul 6 2020 initramfs-4.18.0-147.el8.x86_64kdump.img
-rw------- 1 root root 49864041 Jul 6 2020 initramfs-4.18.0-193.6.3.el8_2.x86_64.img
-rw------- 1 root root 18642820 Jul 6 2020 initramfs-4.18.0-193.6.3.el8_2.x86_64kdump.img
-rw------- 1 root root 50414753 Jul 15 2020 initramfs-5.7.8-1.el8.elrepo.x86_64.img
-rw------- 1 root root 50395127 Aug 11 2020 initramfs-5.8.0-1.el8.elrepo.x86_64.img
drwxr-xr-x 3 root root 4096 Jul 5 2020 loader
drwx------ 2 root root 16384 Jul 5 2020 lost+found
-rwxr-xr-x 1 root root 8106744 Jul 5 2020 vmlinuz-0-rescue-fb78af0a9247484aad9831a10a928084
-rwxr-xr-x 1 root root 8106744 Dec 4 2019 vmlinuz-4.18.0-147.el8.x86_64
-rwxr-xr-x 1 root root 8913656 Jun 10 2020 vmlinuz-4.18.0-193.6.3.el8_2.x86_64
-rwxr-xr-x 1 root root 8558528 Jul 7 2020 vmlinuz-5.7.8-1.el8.elrepo.x86_64
-rwxr-xr-x 1 root root 8742176 Aug 2 2020 vmlinuz-5.8.0-1.el8.elrepo.x86_64
/tmp/nvme0n1p7/System Volume Information:
total 12
drwxrwxrwx 2 nobody 65534 4096 Sep 7 2020 .
dr-xr-xr-x 7 root root 4096 Aug 11 2020 ..
-rw-rw-rw- 1 nobody 65534 76 Sep 7 2020 IndexerVolumeGuid
/tmp/nvme0n1p7/efi:
total 8
drwxr-xr-x 2 root root 4096 Jul 5 2020 .
dr-xr-xr-x 7 root root 4096 Aug 11 2020 ..
/tmp/nvme0n1p7/grub2:
total 8
drwx------ 2 root root 4096 Apr 14 2020 .
dr-xr-xr-x 7 root root 4096 Aug 11 2020 ..
lrwxrwxrwx 1 root root 25 Apr 14 2020 grubenv -> ../efi/EFI/centos/grubenv
/tmp/nvme0n1p7/loader:
total 12
drwxr-xr-x 3 root root 4096 Jul 5 2020 .
dr-xr-xr-x 7 root root 4096 Aug 11 2020 ..
drwx------ 2 root root 4096 Aug 11 2020 entries
/tmp/nvme0n1p7/loader/entries:
total 28
drwx------ 2 root root 4096 Aug 11 2020 .
drwxr-xr-x 3 root root 4096 Jul 5 2020 ..
-rw-r--r-- 1 root root 395 Jul 5 2020 fb78af0a9247484aad9831a10a928084-0-rescue.conf
-rw-r--r-- 1 root root 323 Jul 5 2020 fb78af0a9247484aad9831a10a928084-4.18.0-147.el8.x86_64.conf
-rw-r--r-- 1 root root 353 Jul 6 2020 fb78af0a9247484aad9831a10a928084-4.18.0-193.6.3.el8_2.x86_64.conf
-rw-r--r-- 1 root root 356 Jul 15 2020 fb78af0a9247484aad9831a10a928084-5.7.8-1.el8.elrepo.x86_64.conf
-rw-r--r-- 1 root root 356 Aug 11 2020 fb78af0a9247484aad9831a10a928084-5.8.0-1.el8.elrepo.x86_64.conf
/tmp/nvme0n1p7/lost+found:
total 20
drwx------ 2 root root 16384 Jul 5 2020 .
dr-xr-xr-x 7 root root 4096 Aug 11 2020 ..
How I know what is /sysroot?
I haven't /boot/efi
mounted, neither /boot directory!
How I can mount /boot/efi?
grub commands aren't working!
EDIT 3:
To solve this problem
# grub2-editenv list
grub2-editenv: error: invalid environment block.
# grub2-editenv set
grub2-editenv: error: invalid environment block.
#
I follow https://access.redhat.com/solutions/5622731
# mv /boot/grub2/grubenv /boot/grub2/grubenv.bak
# grub2-set-default 1
# grub2-editenv list
saved_entry=1
# grub2-editenv set
#
EDIT 4:
https://www.golinuxcloud.com/update-grub2-grubby-grub2-editenv-rhel-8/ Checking https://www.techbrown.com/change-default-grub-entries-timeout-centos-rhel/ Works for me
# grub2-editenv - set "kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro"
After Restart
[root@centos /]# grub2-editenv list
saved_entry=1
boot_success=1
kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet
[root@centos /]#
EDIT 5:
[root@centos /]# grub2-editenv list
saved_entry=fb78af0a9247484aad9831a10a928084-4.18.0-193.14.2.el8_2.x86_64
boot_success=1
kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet
boot_indeterminate=1
[root@centos /]#
For me this line is strange :
saved_entry=fb78af0a9247484aad9831a10a928084-4.18.0-193.14.2.el8_2.x86_64
EDIT 6:
[root@centos /]# ls -al /boot/efi/EFI/centos/
total 5820
drwx------. 3 root root 4096 Jun 11 13:50 .
drwx------. 4 root root 4096 Nov 16 2020 ..
-rwx------. 1 root root 134 Jul 31 2020 BOOTX64.CSV
drwx------. 2 root root 4096 Mar 2 16:03 fonts
-rwx------. 1 root root 5502 Jul 5 2020 grub.cfg
-rwx------. 1 root root 0 Aug 23 2020 grubenv.bak
-rwx------. 1 root root 2285336 Mar 2 16:03 grubx64.efi
-rwx------. 1 root root 1162400 Jul 31 2020 mmx64.efi
-rwx------. 1 root root 1238416 Jul 31 2020 shimx64-centos.efi
-rwx------. 1 root root 1244496 Jul 31 2020 shimx64.efi
[root@centos /]# ls -al /boot/grub2/
total 20
drwx------. 2 root root 4096 Jun 12 22:20 .
dr-xr-xr-x. 7 root root 4096 Jun 11 13:58 ..
-rw-r--r--. 1 root root 5503 Jun 11 05:01 grub.cfg
-rw-------. 1 root root 1024 Jun 12 22:20 grubenv
lrwxrwxrwx. 1 root root 25 Apr 14 2020 grubenv.bak -> ../efi/EFI/centos/grubenv
[root@centos /]# cat /boot/grub2/grubenv
# GRUB Environment Block
saved_entry=fb78af0a9247484aad9831a10a928084-4.18.0-305.3.1.el8.x86_64
boot_success=1
kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet
boot_indeterminate=1
#################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################[root@centos /]#
Obviously something wrong!!! The /efi/EFI/centos/grubenv
file does not exist and /boot/grub2/grubenv
seems that is malformed.
According to this link https://bugzilla.redhat.com/show_bug.cgi?id=1435435
The physical file must be located in /efi/EFI/centos/grubenv
and a symlink /boot/grub2/grubenv
should be pointing to /efi/EFI/centos/grubenv
.
How to create the /efi/EFI/centos/grubenv
file, without editing it directly?
And
[root@centos /]# awk -F\' '/^menuentry/ {print $2}' /boot/grub2/grub.cfg
Windows Boot Manager (on /dev/nvme0n1p1)
System setup
[root@centos /]#
[root@centos /]# awk -F' '/^menuentry/ {print $2}' /boot/efi/EFI/centos/grub.cfg
Windows Boot Manager (on /dev/nvme0n1p1)
System setup
[root@centos /]#
[root@centos /]# grub2-mkconfig -o /boot/grub2/grub.cfg.bck
Generating grub configuration file ...
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
[root@centos /]#
[root@centos /]# awk -F' '/^menuentry/ {print $2}' /boot/grub2/grub.cfg.bck
Windows Boot Manager (on /dev/nvme0n1p1)
System setup
[root@centos /]#
I copied to test:
# cp /boot/grub2/grubenv /boot/efi/EFI/centos/
The entries not appearing?
I follow this link
# ls -al /boot/loader/entries
total 36
drwx------. 2 root root 4096 Jun 11 13:57 .
drwxr-xr-x. 3 root root 4096 Jul 5 2020 ..
-rw-r--r--. 1 root root 395 Jul 5 2020 fb78af0a9247484aad9831a10a928084-0-rescue.conf
-rw-r--r--. 1 root root 358 Jun 11 11:36 fb78af0a9247484aad9831a10a928084-4.18.0-193.14.2.el8_2.x86_64.conf
-rw-r--r--. 1 root root 353 Jul 5 2020 fb78af0a9247484aad9831a10a928084-4.18.0-193.6.3.el8_2.x86_64.conf
-rw-r--r--. 1 root root 336 Jun 11 13:57 fb78af0a9247484aad9831a10a928084-4.18.0-305.3.1.el8.x86_64.conf
-rw-r--r--. 1 root root 366 Jun 11 12:05 fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64.conf
-rw-r--r--. 1 root root 356 Jul 15 2020 fb78af0a9247484aad9831a10a928084-5.7.8-1.el8.elrepo.x86_64.conf
-rw-r--r--. 1 root root 356 Aug 11 2020 fb78af0a9247484aad9831a10a928084-5.8.0-1.el8.elrepo.x86_64.conf
[root@centos /]#
And following this answer https://stackoverflow.com/a/64637392
I list all # grubby --info=ALL
I view a specific # grubby --info 0
Check what was my default
[root@centos /]# grubby --info DEFAULT
index=3
kernel="/boot/vmlinuz-4.18.0-305.3.1.el8.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-4.18.0-305.3.1.el8.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-305.3.1.el8.x86_64) 8"
id="fb78af0a9247484aad9831a10a928084-4.18.0-305.3.1.el8.x86_64"
[root@centos /]#
I was trying to change the default with # grubby --args amd_iommu=on --update-kernel=/boot/vmlinuz-$(uname -r)
and with grubby --args amd_iommu=on --update-kernel 2
But it does not work (using # grubby --info DEFAULT
)!
Reviewing 0 Entry
[root@centos /]# grubby --info 0
index=0
kernel="/boot/vmlinuz-5.12.10-1.el8.elrepo.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params amd_iommu=on"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-5.12.10-1.el8.elrepo.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)"
id="fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64"
[root@centos /]#
And following https://unix.stackexchange.com/a/394889/400726
Selecting by title:
[root@centos /]# grub2-editenv - set saved_entry='Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)'
[root@centos /]#
Apparently it changed.
[root@centos /]# grubby --info DEFAULT
index=0
kernel="/boot/vmlinuz-5.12.10-1.el8.elrepo.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params amd_iommu=on"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-5.12.10-1.el8.elrepo.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)"
id="fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64"
[root@centos /]#
Restarting, But it doesn't work either!
Reviewing
[root@centos /]# cmp /boot/efi/EFI/centos/grubenv /boot/grub2/grubenv
/boot/efi/EFI/centos/grubenv /boot/grub2/grubenv differ: byte 38, line 2
[root@centos /]#
The files has been changed, are different!
[root@centos /]# cat /boot/efi/EFI/centos/grubenv
# GRUB Environment Block
saved_entry=fb78af0a9247484aad9831a10a928084-4.18.0-305.3.1.el8.x86_64
boot_success=0
kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet
boot_indeterminate=0
##############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################[root@centos /]#
[root@centos /]# cat /boot/grub2/grubenv
GRUB Environment Block
saved_entry=Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)
boot_success=1
kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet
boot_indeterminate=1
##############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################[root@centos /]#
I was trying
[root@centos /]# rm /boot/grub2/grubenv.bak
rm: remove symbolic link '/boot/grub2/grubenv.bak'? y
[root@centos /]#
[root@centos /]# rm /boot/efi/EFI/centos/grubenv.bak
rm: remove regular empty file '/boot/efi/EFI/centos/grubenv.bak'? y
[root@centos /]#
[root@centos /]# ln -s /boot/grub2/grubenv /boot/efi/EFI/centos/grubenv
ln: failed to create symbolic link '/boot/efi/EFI/centos/grubenv': Operation not permitted
[root@centos /]#
I would have preferred a symlink (But, I undersa tood the situation https://www.linuxquestions.org/questions/suse-opensuse-60/boot-is-not-allowing-symbolic-link-creation-4175682262/#post6166967)!
[root@centos /]# cp /boot/grub2/grubenv /boot/efi/EFI/centos/
[root@centos /]#
Is there some work around?
[root@centos /]# ls -al /boot/grub2/
total 28
drwx------. 2 root root 4096 Jun 12 23:07 .
dr-xr-xr-x. 7 root root 4096 Jun 11 13:58 ..
-rw-r--r--. 1 root root 5503 Jun 11 05:01 grub.cfg
-rw-r--r--. 1 root root 6956 Jun 12 22:59 grub.cfg.bck
-rw-------. 1 root root 1024 Jun 12 22:59 grubenv
[root@centos /]#
[root@centos /]# ls -al /boot/efi/EFI/centos/
total 5824
drwx------. 3 root root 4096 Jun 12 23:09 .
drwx------. 4 root root 4096 Nov 16 2020 ..
-rwx------. 1 root root 134 Jul 31 2020 BOOTX64.CSV
drwx------. 2 root root 4096 Mar 2 16:03 fonts
-rwx------. 1 root root 5502 Jul 5 2020 grub.cfg
-rwx------. 1 root root 1024 Jun 12 23:06 grubenv
-rwx------. 1 root root 2285336 Mar 2 16:03 grubx64.efi
-rwx------. 1 root root 1162400 Jul 31 2020 mmx64.efi
-rwx------. 1 root root 1238416 Jul 31 2020 shimx64-centos.efi
-rwx------. 1 root root 1244496 Jul 31 2020 shimx64.efi
[root@centos /]#
EDIT 7
Remembering the original symlink problem, I need to fixed.
Here we have the DEFAULT Entry... as result of copy.
[root@centos /]# grubby --info DEFAULT
index=0
kernel="/boot/vmlinuz-5.12.10-1.el8.elrepo.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params amd_iommu=on"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-5.12.10-1.el8.elrepo.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)"
id="fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64"
[root@centos /]#
I need test the changes, but first I need to check all entries.
[root@centos /]# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-5.12.10-1.el8.elrepo.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params amd_iommu=on"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-5.12.10-1.el8.elrepo.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)"
id="fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64"
index=1
kernel="/boot/vmlinuz-5.8.0-1.el8.elrepo.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-5.8.0-1.el8.elrepo.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (5.8.0-1.el8.elrepo.x86_64) 8.2 (Ootpa)"
id="fb78af0a9247484aad9831a10a928084-5.8.0-1.el8.elrepo.x86_64"
index=2
kernel="/boot/vmlinuz-5.7.8-1.el8.elrepo.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-5.7.8-1.el8.elrepo.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (5.7.8-1.el8.elrepo.x86_64) 8.2 (Ootpa)"
id="fb78af0a9247484aad9831a10a928084-5.7.8-1.el8.elrepo.x86_64"
index=3
kernel="/boot/vmlinuz-4.18.0-305.3.1.el8.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-4.18.0-305.3.1.el8.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-305.3.1.el8.x86_64) 8"
id="fb78af0a9247484aad9831a10a928084-4.18.0-305.3.1.el8.x86_64"
index=4
kernel="/boot/vmlinuz-4.18.0-193.14.2.el8_2.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-4.18.0-193.14.2.el8_2.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-193.14.2.el8_2.x86_64) 8 (Core)"
id="fb78af0a9247484aad9831a10a928084-4.18.0-193.14.2.el8_2.x86_64"
index=5
kernel="/boot/vmlinuz-4.18.0-193.6.3.el8_2.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-4.18.0-193.6.3.el8_2.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-193.6.3.el8_2.x86_64) 8 (Core)"
id="fb78af0a9247484aad9831a10a928084-4.18.0-193.6.3.el8_2.x86_64"
index=6
kernel="/boot/vmlinuz-0-rescue-fb78af0a9247484aad9831a10a928084"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-0-rescue-fb78af0a9247484aad9831a10a928084.img"
title="CentOS Linux (0-rescue-fb78af0a9247484aad9831a10a928084) 8 (Core)"
id="fb78af0a9247484aad9831a10a928084-0-rescue"
[root@centos /]#
Now, I try to change the entry.
[root@centos /]# grubby --args amd_iommu=on --update-kernel 3
[root@centos /]# grubby --info DEFAULT
index=0
kernel="/boot/vmlinuz-5.12.10-1.el8.elrepo.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params amd_iommu=on"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-5.12.10-1.el8.elrepo.x86_64.img $tuned_initrd"
title="Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)"
id="fb78af0a9247484aad9831a10a928084-5.12.10-1.el8.elrepo.x86_64"
[root@centos /]#
(previous doesn't work), now using the alternative manner.
[root@centos /]# grub2-editenv - set saved_entry='CentOS Linux (4.18.0-305.3.1.el8.x86_64) 8'
[root@centos /]# grubby --info DEFAULT
index=3
kernel="/boot/vmlinuz-4.18.0-305.3.1.el8.x86_64"
args="ro crashkernel=auto resume=UUID=42640b78-ce32-403c-8705-8c12e2d02855 rhgb quiet $tuned_params amd_iommu=on"
root="UUID=54f24598-4a21-4875-bacd-61c060de891f"
initrd="/boot/initramfs-4.18.0-305.3.1.el8.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-305.3.1.el8.x86_64) 8"
id="fb78af0a9247484aad9831a10a928084-4.18.0-305.3.1.el8.x86_64"
[root@centos /]#
SOLVED:
Finally, after restart the changes works!!!
My /sysroot is empty, And I don't know where get its content.
– Sep 01 '20 at 06:12