不幸的是我格式化了驱动器/dev/sda2。所以所有的/root、、/homeLVMswap都不再存在了。因此我的服务器无法正常工作。

它只显示

dracut#>Dracut Error:




[ OK ] Reached target Paths.
[ OK ] Reached target Basic System.
dracut-initqueue[372]: Warning: Could not boot.
[ OK ] Started Show Plymouth Boot Screen.
[ OK ] Reached target Paths.
[ OK ] Reached target Basic System.
dracut-initqueue[372]: Warning: Could not boot.
dracut-initqueue[372]: Warning: /dev/centos/root does not exist.
dracut-initqueue[372]: Warning: /dev/centos/swap does not exist.
dracut-initqueue[372]: Warning: /dev/mapper/centos-root does not exist.
Starting Dracut Emergency Shell...
Warning: /dev/centos/root does not exist
Warning: /dev/centos/swap does not exist
Warning: /dev/mapper/centos-root does not exist

Generating "/run/initramfs/rdsosreport.txt"

Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.

答案1

在 dracut 紧急 shell 中:

Dracut 提供了一个 shell,用于在 dracut 无法找到根文件系统时进行交互式调试。要启用外壳:

  1. 将引导参数“rd.shell”添加到引导加载程序配置文件(例如/etc/grub.conf)

rhgb = redhat 图形启动 - 这是一个 GUI 模式启动屏幕,其中隐藏了大部分信息,同时用户看到旋转的活动图标以及有关计算机正在执行的操作的简要信息。

Quiet = 在 rhgb 启动之前隐藏大部分启动消息。这些应该让普通用户更舒服。他们对看到内核和初始化消息感到震惊,因此他们隐藏它们以求安慰。

rd.shell=如果 dracut 无法找到您的根设备,这将显示一个 shell

  1. 删除引导参数“rhgb”和“quiet” 下面列出了示例 /etc/grub.conf 引导加载程序配置文件。

默认=0

超时=5

串行--单位=0--速度=9600

终端 --timeout=5 串行控制台

标题 Fedora (2.6.29.5-191.fc11.x86_64)

根 (hd0,0)

内核 /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell

initrd /dracut-2.6.29.5-191.fc11.x86_64.img

  1. 如果系统启动失败,您将进入 shell,如下例所示。

    找不到根设备正在调试 shell。 sh: 无法访问 tty;作业控制已关闭

  2. 使用此 shell 提示符收集上述请求的信息(请参阅“所有错误报告”部分)。

5.从 dracut shell 访问根卷 从 dracut 调试 shell 中,您可以手动执行定位根卷并准备引导的任务。所需的步骤取决于根卷的配置方式。常见场景包括:

• 块设备(例如/dev/sda7)

• LVM 逻辑卷(例如/dev/VolGroup00/LogVol00)

• 加密设备(例如/dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83)

• 网络连接设备(例如 netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.fedoraproject:for.all)

6. 定位和准备的具体方法会有所不同。但是,要继续成功启动,目标是找到根卷并创建指向文件系统的符号链接 /dev/root。例如,以下示例演示了访问和引导作为加密 LVM 逻辑卷的根卷。

Inspect your partitions using parted
  1. 您还记得您的根卷是 LVM 逻辑卷。扫描并激活任何逻辑卷

lvm vgscan

lvm vgchange-ay

  1. 您现在应该使用命令 blkid 看到任何逻辑卷:

    黑子

    /dev/sda1:UUID =“3de247f3-5de4-4a44-afc5-1fe179750cf7”类型=“ext4”

    /dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"

    /dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"

    /dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"

    /dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="交换"

9.根卷可用后,您可以通过退出 dracut shell 来继续引导系统

出口

答案2

第一步:输入journalctl

第二步:查找错误

第三步:运行

xfs_repair -L /dev/dm-0

第四步:运行

xfs_repair -d  /dev/dm-0

答案3

sda2 分区很可能是构成 LVM 逻辑卷“根”和“交换”的物理卷。您也许可以使用以下命令恢复 LVM 元数据https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/mdatarecover.html

答案4

从 VirtualBox 虚拟设备导入的 EL7 虚拟机可能无法在 Oracle VM 或 Xen 上启动,并出现相同的错误。

运行 EL7 的虚拟机从 Oracle VirtualBox 作为虚拟设备导出,然后导入到 Oracle VM 中,可能无法正确启动,并且可能会退出到紧急 shell。这是由于 initramfs 映像中缺少 xen-blkfront 驱动程序造成的。通常,对于受影响的系统,引导期间的输出如下所示:

[ OK ] Reached target Basic System.
dracut-initqueue[227]: Warning: Counld not boot.
dracut-initqueue[227]: Warning: /dev/mapper/ol-root does not exist
dracut-initqueue[227]: Warning: /dev/ol/root does not exist
dracut-initqueue[227]: Warning: /dev/ol/swap does not exist
             Starting Dracut Emergency Shell ...
Warning: /dev/mapper/ol-root does not exist
Warning: /dev/ol/root does not exist
Warning: /dev/ol/swap does not exist 

解决方法: 此问题有两种解决方法。第一个涉及在从 Oracle VirtualBox 导出 Oracle Linux 7 虚拟机之前添加缺少的驱动程序。为此,请在执行导出之前以 root 身份运行以下命令:

# dracut --add-drivers "xen-blkfront xen-netfront" --force 

如果您无法在导出之前执行此步骤,您可以暂时将虚拟机作为 HVM 引导,并在引导之前在 GRUB 中添加以下引导选项:

xen_emul_unplug=never

虚拟机启动后,您可以通过以 root 身份运行以下命令来添加缺少的驱动程序:

# dracut --add-drivers "xen-blkfront xen-netfront" --force 

将驱动程序添加到 initramfs 后,重新启动虚拟机。

错误 21244825 来源:https://docs.oracle.com/cd/E64076_01/E64077/html/vmrns-bugs-3.4.1-virtualbox-export-ol7-does-not-start.html

相关内容