内核在CentOS上的恐慌 – 谷歌计算引擎实例

我在Google Compute Engine的CentOS实例中遇到内核恐慌错误。 我能够看到错误,并已经找出解决方法,但是我无法通过串口控制台进入GRUB菜单。

dracut: Mounted root filesystem /dev/sda1 dracut: Loading SELinux policy type=1404 audit(1479929075.614:2): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295 dracut: SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.24: No such file or directory /sbin/load_policy: Can't load policy and enforcing mode requested: No such file or directory dracut Warning: Initial SELinux policy load failed. dracut FATAL: Initial SELinux policy load failed. Machine in enforcing mode. To disable selinux, add selinux=0 t o the kernel command line. dracut Warning: dracut Warning: Boot has failed. To debug this issue add "rdshell" to the kernel command line. dracut Warning: Signal caught! dracut Warning: Boot has failed. To debug this issue add "rdshell" to the kernel command line. Kernel panic - not syncing: Attempted to kill init! Pid: 1, comm: init Not tainted 2.6.32-642.11.1.el6.x86_64 #1 Call Trace: [<ffffffff815482b1>] ? panic+0xa7/0x179 [<ffffffff8112aea0>] ? perf_event_exit_task+0xc0/0x340 [<ffffffff81081f97>] ? do_exit+0x867/0x870 [<ffffffff8119b735>] ? fput+0x25/0x30 [<ffffffff81081ff8>] ? do_group_exit+0x58/0xd0 [<ffffffff81082087>] ? sys_exit_group+0x17/0x20 [<ffffffff8100b0d2>] ? system_call_fastpath+0x16/0x1b 

CentOS版本是6.7,这是yum更新后发生的。 我只是想进入GRUB菜单追加“selinux = 0”启动到Permissive模式,但它似乎不可能通过串行控制台。 我将不胜感激任何帮助。

我已经做了一个工作,让我的实例再次运行。 基本问题是,默认情况下,Google云上的Linux实例在GRUB菜单中设置为零超时。 所以,即使通过串口控制台也无法访问菜单。 我将描述我为恢复实例所做的步骤。

  1. 创build机器启动磁盘的快照。
  2. 创build一个磁盘,其源是在第一步创build的快照。 我们称之为救援盘
  3. 启动一个新的Linux实例。 可能是微型实例,您可以稍后删除它。 称之为救援实例
  4. 救援磁盘附加到救援实例
  5. rescue-instance挂载救援磁盘,并按如下方式更改<mount point>/etc/grub.conf
    根(hd0,0)
     kernel /boot/vmlinuz-2.6.32-642.11.1.el6.x86_64 ro root = UUID = 23f78139-a1ac-4a7a-b608-05687cecfa37 selinux = 0
  1. rescue-instance中取消rescue-disk ,如果需要的话删除那个实例。
  2. 启动一个新来源是救援盘的实例。 你可以在磁盘中做到这一点。

如果你已经在gcloud上运行另一个linux实例,你不需要创build一个新的实例,只需要使用你的虚拟机。

与其他答案一样,访问和编辑磁盘并使其可引导,但要真正解决问题,

 # yum install selinux-policy-targeted # may have to use reinstall # semodule -B # vi/nano /boot/grub/grub.conf # remove selinux=0 # reboot 

从系统日志中:

 *** Warning -- SELinux targeted policy relabel is required. *** Relabeling could take a very long time, depending on file *** system size and speed of hard drives. 

https://access.redhat.com/solutions/91863