在Linux系统创建用户时出现只读文件系统报错,在/etc目录查找.lock的文件,删除文件时也会报只读文件。此时将系统根目录挂载为读写可以解决问题。
[[email protected] home]# mkdir hadoop
mkdir: cannot create directory `hadoop‘: Read-only file system
[[email protected] home]# ll /etc/.pwd.lock
-rw-------. 1 root root 0 Jun 1 2002 .pwd.lock
[[email protected] home]# rm -rf /etc/.pwd.lock
rm: cannot remove `/etc/.pwd.lock‘: Read-only file system
[[email protected] home]# mount -o remount rw /
[[email protected] home]# rm -rf /etc/.pwd.lock
[[email protected] home]# mkdir /home/hadoop --成功了
时间: 2024-10-14 04:51:40