공부하면서/기타

[Linux] cannot create temp file for here-document: Read-only file system

omelette master 2024. 4. 15. 13:53

[ 문제 ]

  • 볼륨이 잠김
  • cannot create temp file for here-document: Read-only file system
[root@test ~]# l -bash: cannot create temp file for here-document: Read-only file system
-bash: cannot create temp file for here-document: Read-only file system

[root@test ~]# ll /tmp
ls: reading directory /tmp: Input/output error
total 0

[ 처리 ]

  • 무엇이 Read-only로 전환이 되었는지 확인 한다.
[root@test ~]# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/sda2                     507G   90G  392G  19% /
devtmpfs                       16G     0   16G   0% /dev
tmpfs                          16G     0   16G   0% /dev/shm
tmpfs                          16G   34M   16G   1% /run
tmpfs                          16G     0   16G   0% /sys/fs/cgroup
/dev/sda1                     477M  112M  336M  25% /boot

[root@test ~]# cat /proc/mounts | grep /dev
devtmpfs /dev devtmpfs rw,nosuid,size=16357692k,nr_inodes=4089423,mode=755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
/dev/sda2 / ext4 ro,relatime,stripe=64,data=ordered 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
/dev/sda1 /boot ext4 rw,relatime,stripe=256,data=ordered 0 0
/dev/sda2 /var/lib/kubelet/pods/0d7927a2-e10d-428b-8840-0e2f9a729a00/volume-subpaths/my-config/tomcat-webapp/1 ext4 ro,relatime,stripe=64,data=ordered 0 0

[root@test ~]# cat /proc/mounts | grep /dev | grep -i ro
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
**/dev/sda2 / ext4 ro,relatime,stripe=64,data=ordered 0 0**
/dev/sda2 /var/lib/kubelet/pods/0d7927a2-e10d-428b-8840-0e2f9a729a00/volume-subpaths/my-config/tomcat-webapp/1 ext4 ro,relatime,stripe=64,data=ordered 0 0

*** /(root) 가 잠겼음을 알수 있다.

mount -t ext4 -o remonunt,rw /**

[마무리]

  • 무엇때문에 잠겼는지 확인