Unable to create a temporary file for here document: read-only file system

Fault description

Some time ago ran station Ubuntu 18.04 virtual machines to run applications flask, applications can not open suddenly this morning

According to repair the computer cheats three 重启,重装,换电脑first restarted the system a bit, the results directly to the hate initramfsinside
Here Insert Picture Description
run manually fsckcheck the disk again, a bunch of jumped fixafter the system is up
Here Insert Picture Description

Restart supervisordare normal, then after a few geese two hours, services and tm hung up, look! supervisordLogs, the default is on the /tmpinside, the implementation of tailthe results of a press tab键actually on the error:

-bash: 无法为立即文档创建临时文件: 只读文件系统

Demining process

First look at conventional operating system resource usage

lpwm@lpwm-virtual-machine:/tmp$ free -h
              总计         已用        空闲      共享    缓冲/缓存    可用
内存:         15G        3.1G         11G        9.3M        1.2G         12G
交换:        2.0G          0B        2.0G
lpwm@lpwm-virtual-machine:/tmp$ df -h
文件系统        容量  已用  可用 已用% 挂载点
udev            7.8G     0  7.8G    0% /dev
tmpfs           1.6G  1.4M  1.6G    1% /run
/dev/sda1       492G  9.8G  457G    3% /
tmpfs           7.9G  7.8M  7.9G    1% /dev/shm
tmpfs           5.0M     0  5.0M    0% /run/lock
tmpfs           7.9G     0  7.9G    0% /sys/fs/cgroup
/dev/loop2      1.0M  1.0M     0  100% /snap/gnome-logs/81
/dev/loop0      157M  157M     0  100% /snap/gnome-3-28-1804/110
/dev/loop1      3.8M  3.8M     0  100% /snap/gnome-system-monitor/123
/dev/loop3       92M   92M     0  100% /snap/core/8689
/dev/loop5       15M   15M     0  100% /snap/gnome-characters/375
/dev/loop4       45M   45M     0  100% /snap/gtk-common-themes/1440
/dev/loop6       45M   45M     0  100% /snap/gtk-common-themes/1353
/dev/loop7      4.3M  4.3M     0  100% /snap/gnome-calculator/544
/dev/loop8       15M   15M     0  100% /snap/gnome-characters/399
/dev/loop10     1.0M  1.0M     0  100% /snap/gnome-logs/61
/dev/loop9      4.2M  4.2M     0  100% /snap/gnome-calculator/406
/dev/loop11      55M   55M     0  100% /snap/core18/1668
/dev/loop12     161M  161M     0  100% /snap/gnome-3-28-1804/116
/dev/loop14     3.8M  3.8M     0  100% /snap/gnome-system-monitor/127
/dev/loop13      92M   92M     0  100% /snap/core/8592
/dev/loop15      55M   55M     0  100% /snap/core18/1650
tmpfs           1.6G   28K  1.6G    1% /run/user/121
tmpfs           1.6G     0  1.6G    0% /run/user/1000

Normal memory, disk space, seemingly normal, look online there are said to be /tmpspace filled with such problems will arise, but dfto see the result of which tmpfswas spent 1.4M, okay 1.6G total of ...

And a stroll around found this article: https://blog.csdn.net/RL_LEEE/article/details/96870739

Check the status of the mount point:

lpwm@lpwm-virtual-machine:~/.local/log$ mount |grep dev/sd
/dev/sda1 on / type ext4 (ro,relatime,errors=remount-ro)

Sure enough! /dev/sda1Mount into roread-only mode up! Keep checking/etc/fstab

UUID=c65f7898-18ba-4527-ba70-ea3f5a287ed1 /               ext4    errors=remount-ro 0       1
/swapfile                                 none            swap    sw              0       0

Here you always had this looked at the other one is Ubuntu 18.04 virtual machine, other people's? /etc/fstabLong like this:

UUID=91cf5b91-62ec-4aa6-9885-55f8d061bd88 / ext4 defaults 0 0
/swap.img       none    swap    sw      0       0

It seems it should be the beginning and start to initramfshave a relationship, that there is a problem the system disk, so automatically modify the mount point /configuration into a read-only again to restart it try, the result went to the initramfsinside, rub! Do the virtual machine's disk is really a problem? still running fsck /dev/sda1and then all the way to fix the system after the reboot into the inside

It seems likely the disk does have problems, followed by LIVE system disk to boot the boot and then use fsckthe Repair Disk to try
Here Insert Picture Description
actually did wrong ... it had to manually put fstabinside errors=remount-rointo defaults
Here Insert Picture Description
reboot again, the normal into the system, the error message does not appear, check the hanging load point

lpwm@lpwm-virtual-machine:~$ mount |grep sda1
/dev/sda1 on / type ext4 (rw,relatime)

Restartsupervisord

lpwm@lpwm-virtual-machine:~$ supervisord
lpwm@lpwm-virtual-machine:~$ supervisorctl
dingding                         RUNNING   pid 1959, uptime 0:00:03
ytb_fetcher                      RUNNING   pid 1960, uptime 0:00:03
ytb_flask                        RUNNING   pid 1961, uptime 0:00:03

Check the log and press tab键are normal.

So far, the treatment should be done to observe the run for some time to say conclusion.

Published 219 original articles · won praise 99 · views 490 000 +

Guess you like

Origin blog.csdn.net/lpwmm/article/details/104813853