文件系统 如何修复 "sudo: unable to open ... Read-only file system"?

分享于 

1分钟阅读

ubuntu

  繁體

问题

我SSH到服务器,当尝试启动apache时,得到以下:


username@srv1:~$ sudo service apache2 start


[sudo] password for username:


sudo: unable to open /var/lib/sudo/username/1: Read-only file system


 * Starting web server apache2 (30)Read-only file system: apache2: could not open error log file /var/log/apache2/error.log.


Unable to open logs


Action 'start' failed.


The Apache error log may have more information.



当尝试重新启动服务器时,得到:


username@srv1:~$ sudo shutdown -r now


[sudo] password for username:


sudo: unable to open /var/lib/sudo/username/1: Read-only file system




答案1

如果文件系存在致性问题,则文件系统通常会进入只读状态。你可以运行:


sudo fsck -Af -M



强制检查所有文件系统,


答案2

以下是解决问题的命令:


mount -o remount /



比重新引导或sudo fsck -Af更好



文件  files  SYS  系统  FIX