linux启动问题

DIL*_*ATH 5 boot centos grub2 initramfs dracut

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

它只显示

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.
Run Code Online (Sandbox Code Playgroud)

DIL*_*ATH 6

在 dracut 紧急外壳中:

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

串行 --unit=0 --speed=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
Run Code Online (Sandbox Code Playgroud)
  1. 您还记得您的根卷是一个 LVM 逻辑卷。扫描并激活任何逻辑卷

lvm vgscan

lvm vgchange -ay

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

    黑色

    /dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="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="swap"

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

出口