转载请注明文章出处: 树莓派 Cannot open access to console. The root account is locked
前序文章:html
昨晚把两块硬盘组成可扩容的lvm盘,挂载信息写入到了/etc/fstab中。今天发现机器莫名其妙的重启过,更糟糕的是没法进入系统,屏幕上出现以下错误:code
you are in emergency mode. after logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" or ^d to try again to boot into default mode. cannot open access to console, the root account is locked. see sulogin(8) man page for more details. press enter to continue.
<img src="https://user-gold-cdn.xitu.io...;h=768&f=jpeg&s=115082" alt="raspberry pi emergency mode" width="665" height="499" class="aligncenter size-large wp-image-5905" />cdn
按回车系统试图正常启动,惋惜最终仍是失败。断电重启屡次不能解决这个问题。htm
根据网上信息,大概是fstab信息有问题,致使/boot分区和根目录没法正常加载。因而和 重置密码 文中同样操做,init=/bin/sh
进入root环境。blog
先将/boot分区从新挂载:rem
mount -o remount,rw /dev/mmcblk0p1 /boot
提示boot分区并未加载。用ls /boot
查看,空空如也。因而先挂载:mount /dev/mmcblk0p1 /boot
,再次用ls
查看,OK问题解决。get
接着从新挂载根目录:mount -o remount,rw /dev/mmcblk0p2 /
。根目录可写后,编辑/etc/fstab文件,将引发问题的挂载点注释掉。cmd
而后执行exec /sbin/init
启动系统,此次终于正常进入系统了。raspberry-pi
按惯例,启动后把/boot/cmdline.txt文件中的init=/bin/sh
删除,避免下次又进入root环境。it