大网数据广告活动
服务器运维问答

Debian server showing "read only file system" repeatedly

· 52CE 我爱测

I am having issues with being unable to SSH into my server, running Debian 11. If I try to make a folder or file, I get an error that says mkdir: cannot create directory ‘/tmp/test’: Read-only file system . As suggested by this l…

问题原文

原帖链接 · Josh Loecker · CC BY-SA 4.0

I am having issues with being unable to SSH into my server, running Debian 11. If I try to make a folder or file, I get an error that says mkdir: cannot create directory ‘/tmp/test’: Read-only file system.

As suggested by this link, and a large swath of others, I can fix this by entering safe mode and running fsck.ext4 /dev/sda, but it only helps for 24-48 hours.

I got a new SSD about two weeks ago (smartctl is showing power-on hours of 442), because I was having similar errors and I thought I could be having a bad hard drive, but the same problems are happening with the new one.

Here is the results from sudo smartctl -t long -C /dev/sda: https://pastebin.com/LpHGJTx8

Does anyone happen to know why this may be happening? I can provide any other logs as well, I'm not sure what may be needed

I appreciate any help!

EDIT: I ran a badblocks -sv /dev/sda test and got the following result: Pass completed, 0 bad blocks found. (0/0/0 errors)

EDIT 2: I ran sudo memtest 2048 2 (from this link). These were the results: https://pastebin.com/auUJzvWy

已采纳解答

原帖链接 · Nikita Kipriyanov · CC BY-SA 4.0

Bad RAM is the usual cause of the unexpected file system corruption. This seems to be your case too, according to the memtester run.

It is so common so it is recommended to automatically check the file system at regular intervals even if it is marked as clean. For example, please read tune2fs manual. It is mentioned right in the beginning of the page, in the -c option description, and also later, in the -i option.

If you are brave, you may use Linux BadRAM or memory map feature, to tell it to not to use certain memory addresses at all. It'll use only the parts of memory that are healthy. But I wouldn't do that on the computer of non-negligible importance.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-02-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。