我正在将 CentOS 8 作为 VMWare 来宾操作系统运行。我已经使用它有一段时间了。今天我重新启动了机器,但它进入了 Dracut 恢复模式。它无法激活操作系统 LVM。
我该如何修复这个错误?
更新1:
它进入 Darcut shell,我必须运行这两个命令并退出 shell。
lvm vgscan
lvm vgchange -ay
然后服务器启动。我不确定为什么 LVM 在启动过程中没有被激活。
更新 1/9/2020
从旧内核启动也有同样的问题,这里是 rdsosreport 行。
# more /run/initramfs/rdsosreport.txt
+ cat /lib/dracut/dracut-049-10.git20190115.el8
dracut-049-10.git20190115.el8
+ cat /proc/cmdline
+ sed -e 's/\(ftp:\/\/.*\):.*@/\1:*******@/g;s/\(cifs:\/\/.*\):.*@/\1:*******@/g;s/cifspass=[^ ]*/cifspass=*******/g;s/iscsi:.*@/iscsi:******@/g;s/rd.iscsi.password=[^ ]*/rd.iscsi.password=*
*****/g;s/rd.iscsi.in.password=[^ ]*/rd.iscsi.in.password=******/g'
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-4.18.0-80.7.1.el8_0.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 ipv6.disable=0 a
udit=1 loglevel=7 systemd.log_level=debug
这是磁盘信息:
+ blkid
/dev/sda1: UUID="CA2D-9F26" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="d999eb85-785f-467a-9d99-62d285374df7"
/dev/sda2: UUID="d6d4c6f0-a259-4a2d-9bb4-da691f85f40c" TYPE="ext4" PARTUUID="b6015c77-0900-4228-927f-47cf670d7ab5"
/dev/sda3: UUID="9XRB6B-pJI3-8K9l-1vOi-rQ8r-4ghe-pQw7q7" TYPE="LVM2_member" PARTUUID="8a37820e-352e-47e5-b4a7-890d43078415"
+ blkid -o udev
ID_FS_UUID=CA2D-9F26
ID_FS_UUID_ENC=CA2D-9F26
ID_FS_TYPE=vfat
ID_FS_PARTLABEL=EFI System Partition
ID_FS_PARTUUID=d999eb85-785f-467a-9d99-62d285374df7
ID_FS_UUID=d6d4c6f0-a259-4a2d-9bb4-da691f85f40c
ID_FS_UUID_ENC=d6d4c6f0-a259-4a2d-9bb4-da691f85f40c
ID_FS_TYPE=ext4
ID_FS_PARTUUID=b6015c77-0900-4228-927f-47cf670d7ab5
ID_FS_UUID=9XRB6B-pJI3-8K9l-1vOi-rQ8r-4ghe-pQw7q7
ID_FS_UUID_ENC=9XRB6B-pJI3-8K9l-1vOi-rQ8r-4ghe-pQw7q7
ID_FS_TYPE=LVM2_member
ID_FS_PARTUUID=8a37820e-352e-47e5-b4a7-890d43078415
+ ls -l /dev/disk/by-id /dev/disk/by-partlabel /dev/disk/by-partuuid /dev/disk/by-path /dev/disk/by-uuid
/dev/disk/by-id:
total 0
lrwxrwxrwx 1 root root 9 Jan 9 21:45 ata-VMware_Virtual_SATA_CDRW_Drive_00000000000000000001 -> ../../sr0
lrwxrwxrwx 1 root root 10 Jan 9 21:45 lvm-pv-uuid-9XRB6B-pJI3-8K9l-1vOi-rQ8r-4ghe-pQw7q7 -> ../../sda3
/dev/disk/by-partlabel:
total 0
lrwxrwxrwx 1 root root 10 Jan 9 21:45 EFI\x20System\x20Partition -> ../../sda1
/dev/disk/by-partuuid:
total 0
lrwxrwxrwx 1 root root 10 Jan 9 21:45 8a37820e-352e-47e5-b4a7-890d43078415 -> ../../sda3
lrwxrwxrwx 1 root root 10 Jan 9 21:45 b6015c77-0900-4228-927f-47cf670d7ab5 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 9 21:45 d999eb85-785f-467a-9d99-62d285374df7 -> ../../sda1
/dev/disk/by-path:
total 0
lrwxrwxrwx 1 root root 9 Jan 9 21:45 pci-0000:02:01.0-ata-1 -> ../../sr0
lrwxrwxrwx 1 root root 9 Jan 9 21:45 pci-0000:03:00.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Jan 9 21:45 pci-0000:03:00.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 9 21:45 pci-0000:03:00.0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 9 21:45 pci-0000:03:00.0-scsi-0:0:0:0-part3 -> ../../sda3
这是 udev 消息:
systemd-udevd[409]: passed 821 byte device to netlink monitor 0x559ccca0e790
systemd-udevd[381]: passed 240 byte device to netlink monitor 0x559ccc9e0e20
systemd-udevd[423]: Successfully forked off '(spawn)' as PID 579.
systemd-udevd[423]: Process '/sbin/modprobe -bv sg' failed with exit code 1.
systemd-udevd[423]: passed 240 byte device to netlink monitor 0x559ccca4bbf0
systemd-udevd[381]: passed 269 byte device to netlink monitor 0x559ccc9e0e20
systemd[1]: dev-disk-by\x2dpath-pci\x2d0000:02:01.0\x2data\x2d1.device: Changed dead -> plugged
systemd[1]: dev-disk-by\x2did-ata\x2dVMware_Virtual_SATA_CDRW_Drive_00000000000000000001.device: Changed dead -> plugged
systemd[1]: dev-sr0.device: Changed dead -> plugged
systemd[1]: sys-devices-pci0000:00-0000:00:11.0-0000:02:01.0-ata3-host3-target3:0:0-3:0:0:0-block-sr0.device: Changed dead -> plugged
systemd-udevd[423]: Successfully forked off '(spawn)' as PID 580.
systemd-udevd[423]: created db file '/run/udev/data/b11:0' for '/devices/pci0000:00/0000:00:11.0/0000:02:01.0/ata3/host3/target3:0:0/3:0:0:0/bloc
systemd[1]: dev-disk-by\x2dpath-pci\x2d0000:02:01.0\x2data\x2d1.device: Installed new job dev-disk-by\x2dpath-pci\x2d0000:02:01.0\x2data\x2d1.de$
systemd[1]: dev-disk-by\x2did-ata\x2dVMware_Virtual_SATA_CDRW_Drive_00000000000000000001.device: Installed new job dev-disk-by\x2did-ata\x2dVMwa$
1.device/nop as 54
systemd[1]: dev-sr0.device: Installed new job dev-sr0.device/nop as 55
systemd[1]: sys-devices-pci0000:00-0000:00:11.0-0000:02:01.0-ata3-host3-target3:0:0-3:0:0:0-block-sr0.device: Installed new job sys-devices-pci0$
rget3:0:0-3:0:0:0-block-sr0.device/nop as 56
systemd[1]: sys-devices-pci0000:00-0000:00:11.0-0000:02:01.0-ata3-host3-target3:0:0-3:0:0:0-block-sr0.device: Job sys-devices-pci0000:00-0000:00$
0:0-block-sr0.device/nop finished, result=done
systemd[1]: dev-sr0.device: Job dev-sr0.device/nop finished, result=done
systemd[1]: dev-disk-by\x2did-ata\x2dVMware_Virtual_SATA_CDRW_Drive_00000000000000000001.device: Job dev-disk-by\x2did-ata\x2dVMware_Virtual_SAT$
inished, result=done
systemd[1]: dev-disk-by\x2dpath-pci\x2d0000:02:01.0\x2data\x2d1.device: Job dev-disk-by\x2dpath-pci\x2d0000:02:01.0\x2data\x2d1.device/nop finis$
systemd-udevd[423]: passed 844 byte device to netlink monitor 0x559ccca4bbf0
dracut-initqueue[425]: Scanning devices sda3 for LVM logical volumes centos/root centos/swap
dracut-initqueue[425]: inactive '/dev/cl/swap' [7.91 GiB] inherit
dracut-initqueue[425]: inactive '/dev/cl/home' [<40.50 GiB] inherit
dracut-initqueue[425]: inactive '/dev/cl/root' [50.00 GiB] inherit
kernel: random: fast init done
dracut-initqueue[425]: Volume group "centos" not found
dracut-initqueue[425]: Cannot process volume group centos
dracut-initqueue[425]: Volume group "centos" not found
dracut-initqueue[425]: Cannot process volume group centos
systemd[1]: systemd-udevd.service: Got notification message from PID 381 (WATCHDOG=1)
systemd[1]: systemd-udevd.service: Got notification message from PID 381 (WATCHDOG=1)
systemd[1]: systemd-journald.service: Got notification message from PID 245 (WATCHDOG=1)
dracut-initqueue[425]: Warning: dracut-initqueue timeout - starting timeout scripts
dracut-initqueue[425]: Scanning devices sda3 for LVM logical volumes centos/root centos/swap
dracut-initqueue[425]: inactive '/dev/cl/swap' [7.91 GiB] inherit
dracut-initqueue[425]: inactive '/dev/cl/home' [<40.50 GiB] inherit
dracut-initqueue[425]: inactive '/dev/cl/root' [50.00 GiB] inherit
dracut-initqueue[425]: Volume group "centos" not found
dracut-initqueue[425]: Cannot process volume group centos
dracut-initqueue[425]: Volume group "centos" not found
dracut-initqueue[425]: Cannot process volume group centos
dracut-initqueue[425]: Warning: dracut-initqueue timeout - starting timeout scripts
dracut-initqueue[425]: Warning: dracut-initqueue timeout - starting timeout scripts
kernel: random: crng init done
kernel: random: 7 urandom warning(s) missed due to ratelimiting
答案1
解决这个问题有两种想法。
- CentOS 7 有
centos
vg 名称,在 CentOS 8 中,vg 名称是cl
,我需要更新GRUB_CMDLINE_LINUX
cat/etc/default/grub
文件条目中的 vg 名称。 - 对于 UFI 启动需要运行此命令
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
该命令帮助我grub2-editenv list
显示启动参数
谢谢