<markdown> # 使用树莓派遇见的一些问题的解决方法 ## 不能进入系统 Failed to load SELinux policy. Freezing ### 背景 想关闭 SELinux 结果改错配置项了,导致系统启动时一直提示`Failed to load SELinux policy. Freezing`就是进不去系统。现在进不去系统,配置文件也没法修改,也不想重装系统,遂在网上找了各种方法 1. windows下倒是可以使用DiskGenius来访问ext4格式的文件系统,但是写入的功能是收费的,也没找到破解版,其他软件只支持读取不支持写入; 2. 进入grub编辑的方法我是没弄成功;
后来突然想到挂载到虚拟机上试试,结果还真成功了,所以在此记录下。
### 原因 永久关闭 SELinux 时配置错了,应修改的是`/etc/selinux/config`中的`SELINUX`项改为`disabled`,结果错改了`SELINUXTYPE`项,原始配置如下 ``` # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
``` ### 解决方法 1. 将TF卡挂载到Linux虚拟机上,方法可以参考[《linux虚拟机上挂载U盘》]( https://jingyan.baidu.com/article/8ebacdf028b13449f65cd5a5.html) 2. 使用`fdisk -l`查看磁盘信息 3. 使用`mount /dev/sdb4 /usb`挂载
挂载完成后就可以访问磁盘了,进去把配置修改正确再插入树莓派启动,完美!
</markdown>