我在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菜单中设置为零超时。 所以,即使通过串口控制台也无法访问菜单。 我将描述我为恢复实例所做的步骤。
<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
如果你已经在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.