Read-only file system appears in linux

当linux操作系统启动出现root用户也无法进行任何的文件写操作时,无论什么用户(包括root)写文件保存或者删除文件,且对操作文件或目录都有写权限时,还任然报错:E212: Can't open file for writing 或者 Read-only file system。

1. The root user creates the test file in the home directory, and the error is reported as follows:

2. Delete the root user

[root@hadoop01 home]# ll /etc/.pwd.lock
-rw-------. 1 root root 0 Jun 1 2002 .pwd.lock
[root@hadoop01 home]# rm -rf /etc/. pwd.lock
rm: cannot remove `/etc/.pwd.lock': Read-only file system
[root@hadoop01 home]# mount -o remount rw / (This step is the key step to make the "/" root file system Remount and have read-write mode)
[root@hadoop01 home]# rm -rf /etc/.pwd.lock
[root@hadoop01 home]#

Notice:

If you are under the root user, you still cannot write after the above operations are completed. Pay attention to whether an error is reported during startup. The error may be: partition information error such as /dev/sda1. At this time, you need to use the disk detection command that comes with the system to operate. In this case use the following command:

[root@hadoop01 home]#fsck -y /dev/sda1 (Detect the error partition and try to repair it)

At this point, the inability to write operations caused by the stubborn non-permission problem has been overcome. Most of the reasons are to enter the read-only mode of the file system. After the above modification, files can be created or deleted normally! ! !

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326126228&siteId=291194637