CentOS 8에 액세스할 수 없고 루트 '/sysroot'를 전환할 수 없습니다.

CentOS 8에 액세스할 수 없고 루트 '/sysroot'를 전환할 수 없습니다.

사진만 있어요. 그리고 저는 질문을 잘 못 씁니다.

랩톱을 부팅하고 있습니다 ( Windows 10 Pro및 사용 CentOS8).

systemctl status initrd-switch-root.service

https://i.stack.imgur.com/fuGRU.jpg

https://i.stack.imgur.com/CAQ7Y.jpg

마지막 사진 Failed to Start Switch Root. 그리고

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

어떤 것을 만들어ls -al /sysroot디렉토리가 비어 있습니다.

dmesg겠어요:

여기에 이미지 설명을 입력하세요.

왜 이런 실패가 발생하는지 아시나요?

분명히, 어떻게 고치나요?

이미지에서 유일한 유효한 항목은 Rescue입니다. CentOS 항목이 Windows 항목 위에 있습니다.CentOS Linux (0-rescue-***) 여기에 이미지 설명을 입력하세요.

도와주세요.

편집 1:

솔루션을 사용https://unix.stackexchange.com/a/212710/117555

  1. 개발 확인->ls -al /dev/s*
  2. USB 플래시 드라이브 삽입
  3. 다시 확인해보세요 ->ls -al /dev/s*
  4. 마운트 디렉터리 생성->mkdir -p /mnt/logError_SwitchRoot
  5. 설치스틱->mount /dev/sd[letter][number] /mnt/logError_SwitchRoot
  6. 파일 복사->cp /run/initramfs/rdsosreport.txt /mnt/logError_SwitchRoot
  7. 스틱을 제거하세요 ->umount /mnt/logError_SwitchRoot

지금은 rdsosreport.txt보관처리 되어 있어요https://drive.google.com/file/d/1vMK0QAoyMZ7xTibDqn8Y_Y9nohUStN-6/view?usp=sharing

파일을 확인하세요:

    /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"

그리고

BOOT_IMAGE=(hd1,gpt7)/vmlinuz-5.8.0-1.el8.elrepo.x86_64

편집 2:

설치 사진 몇 장을 찾았습니다. (2020년 7월 5일 15:05,참고로)!

DATA
    /home
    nvme0n1p8

SYSTEM
    /boot/efi
    nvme0n1p6

    /var
    nvme0n1p10

    /
    nvme0n1p9

    /boot
    nvme0n1p7

    swap
    nvme0n1p11

내 메시지입니다(재부팅 후).

[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 /]# 

나한테 이 목록이 있는데...

/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 ..

여기 또 다른 목록이 있습니다

/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 ..

/sysroot가 무엇인지 어떻게 알 수 있나요?

아직 마운트 하지 않았 /boot/efi으며 /boot 디렉토리도 마운트하지 않았습니다!

/boot/efi를 마운트하는 방법은 무엇입니까?

grub 명령이 작동하지 않습니다!

편집 3:

이 문제를 해결하려면

# grub2-editenv list
grub2-editenv: error: invalid environment block.
# grub2-editenv set
grub2-editenv: error: invalid environment block.
# 

나는 팔로우한다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
#

편집 4:

https://www.golinuxcloud.com/update-grub2-grubby-grub2-editenv-rhel-8/ 조사하다https://www.techbrown.com/change-default-grub-entries-timeout-centos-rhel/ 나에게 유용하다

# grub2-editenv - set "kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro"

다시 시작한 후

[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 /]# 

편집 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 /]# 

이 줄은 나에게 이상해 보입니다.

saved_entry=fb78af0a9247484aad9831a10a928084-4.18.0-193.14.2.el8_2.x86_64

편집 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 /]#

여기에 이미지 설명을 입력하세요.

뭔가 분명히 잘못된 것 같아요! ! ! 파일 /efi/EFI/centos/grubenv이 존재하지 않으며 /boot/grub2/grubenv형식이 잘못된 것 같습니다.

이 링크에 따르면https://bugzilla.redhat.com/show_bug.cgi?id=1435435 실제 파일을 찾아야 하며 /efi/EFI/centos/grubenv심볼릭 링크 /boot/grub2/grubenv/efi/EFI/centos/grubenv.

/efi/EFI/centos/grubenv파일을 직접 편집하지 않고 어떻게 만들 수 있나요 ?

그리고

[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 /]#

테스트를 위해 복사했습니다.

# cp /boot/grub2/grubenv /boot/efi/EFI/centos/

항목이 표시되지 않습니까?

나는 이것을 따른다협회

# 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 /]#

그리고 이 대답을 따르세요https://stackoverflow.com/a/64637392

나는 모두 나열한다# grubby --info=ALL

구체적인 내용을 확인해보겠습니다# grubby --info 0

내 기본값이 무엇인지 확인하세요.

[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 /]#

grubby --args amd_iommu=on --update-kernel=/boot/vmlinuz-$(uname -r)# 및 with를 사용하여 기본값을 변경하려고 했지만 grubby --args amd_iommu=on --update-kernel 2작동하지 않습니다( 사용 # grubby --info DEFAULT).

0개 항목 검토 중

[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 /]#

그리고 아래https://unix.stackexchange.com/a/394889/400726

제목으로 선택:

[root@centos /]# grub2-editenv - set saved_entry='Red Hat Enterprise Linux (5.12.10-1.el8.elrepo.x86_64) 8.4 (Ootpa)'
[root@centos /]# 

분명히 바뀌 었습니다.

[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 /]#

다시 시작했지만 여전히 작동하지 않습니다!

검토

[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 /]# 

파일이 바뀌어서 달라졌어요!

[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 /]# 

나는 노력하고있다

[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 /]#

나는 심볼릭 링크를 선호합니다(그러나 상황을 이해합니다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 /]#

해결책이 있나요?

[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 /]#

편집 7

원래의 심볼릭 링크 문제를 염두에 두고 이를 수정해야 했습니다.

여기에 이미지 설명을 입력하세요.

여기에 복사 결과에 따른 기본 항목이 있습니다.

[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 /]#

변경 사항을 테스트해야 하지만 먼저 모든 항목을 확인해야 합니다.

[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 /]#

이제 항목을 변경하려고 합니다.

[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 /]#

(이전 방법은 작동하지 않았습니다.) 이제 다른 방법을 사용하십시오.

[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 /]#

해결됨:

Finally, after restart the changes works!!!

답변1

요약하다:

  • 누구세요비상 모드로 전환시작에
  • 보고된 오류는 다음과 같습니다.
Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.
  • rdsosreport.txt실제로는 아무것도 설치되지 않았 /sysroot으며 /proc/cmdline커널 부팅 옵션이 하나만 있음을 나타냅니다 BOOT_IMAGE=(hd1,gpt7)/vmlinuz-5.8.0-1.el8.elrepo.x86_64.

정보 에 따르면 실제 루트 파일 시스템을 식별하려면 최소한 목록 이나 이와 유사한 것이 rdsosreport.txt있어야 하는 것 같습니다 . 그러나 선택의 여지가 전혀 없습니다. 이는 다른 일이 발생하지 않는 한 부트로더 문제가 상대적으로 간단하다는 것을 나타냅니다.root=UUID=54f24598-4a21-4875-bacd-61c060de891froot=/dev/nvme0n1p9root=

RHEL/CentOS 8은 이 정보를 grubenv사용자와 같은 UEFI 시스템에서 /boot/efi/EFI/centos/grubenv모든 파일 시스템이 일반 위치에 마운트될 때 파일이 위치하는 파일에 저장합니다. 파일에는 다음과 같은 줄이 포함되어야 합니다.

kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro

grubenv파일을 직접 편집 해서는 안 되며 , 설정 보기 및 설정 grub2-editenv명령 을 사용하십시오.grub2-editenv listgrub2-editenv set "kernelopts=root=UUID=54f24598-4a21-4875-bacd-61c060de891f ro"

그러나 이를 사용할 수 있는 수준에 도달하려면 grub2-editenv먼저 운영 체제를 시작하고 실행해야 합니다.

GRUB 메뉴가 나타나면 화살표 키를 사용하여 사용하려는 커널에 해당하는 줄(첫 번째 또는 세 번째 줄일 수 있음)로 이동합니다. 그런 다음 E을 누르는 대신 을 누르십시오 Enter. 편집할 수 있는 시작 항목이 표시됩니다. 로 시작하는 줄을 찾아 linux /vmlinuz-...커서를 줄 끝으로 이동한 다음 공백과 를 입력합니다 root=/dev/nvme0n1p9. (UUID 양식을 사용해도 되지만, 정확하게 입력하기가 더 어렵습니다.)

그런 다음 화면 하단에서 수정된 항목을 실행하는 키를 찾으세요(+ 제가 올바르게 기억한다면 Control).X

이것이 작동하면 이번에만 시스템이 CentOS로 정상적으로 부팅되어야 합니다. 문제를 영구적으로 해결하려면 grubenv위에서 설명한 대로 파일을 복구 해야 합니다 .

답변2

Rocky 8.6 이미지를 부팅할 때에도 똑같은 문제가 발생합니다.

명령줄에서 다음 프로세스를 실행합니다.

  1. sysroot를 다시 마운트하세요:
mount -o remount,rw /sysroot
  1. 초기화 파일 변경
vi /sysroot/etc/init.sh
i
#!/bin/bash
exec /sbin/init
  1. 실행 플래그를 변경합니다.
/sysroot//usr/bin/chmod ugo+x /sysroot/etc/init.sh
  1. ro 재설치
mount -o remount,ro /sysroot
  1. 계속해서 시작하세요:
exit

현재 설치 문제를 해결했습니다. 그런데 왜 이런 오류가 나타나는지 궁금합니다. 버그인 것 같나요?

관련 정보