OpenWRT 빈 폴더는 삭제(rm -rf|rmdir)되거나 나열될 수 없습니다(ls).

OpenWRT 빈 폴더는 삭제(rm -rf|rmdir)되거나 나열될 수 없습니다(ls).

OpenWRT를 실행하는 임베디드 컴퓨터의 파일 시스템에 몇 가지 문제가 있습니다. 갑자기 일부 빈 폴더를 삭제할 수 없습니다.

다음과 같은 매우 혼란스러운 오류 메시지가 나타납니다.

root@Omega-9439:/usr/lib/python3.6/site-packages# rm -rf tmp/
rm: can't stat 'tmp/_reloader.py': No error information
rm: can't stat 'tmp/datastructures.py': No error information
rm: can't stat 'tmp/_internal.py': No error information
rm: can't stat 'tmp/middleware': No error information
rm: can't stat 'tmp/__pycache__': No error information
rm: can't stat 'tmp/wrappers': No error information
rm: can't stat 'tmp/_compat.py': No error information
rm: can't stat 'tmp/__init__.py': No error information
rm: can't remove 'tmp': Directory not empty

파일은 이전에 이 폴더에 있었지만 더 이상 존재하지 않습니다.

root@Omega-9439:/usr/lib/python3.6/site-packages/tmp# ll
ls: ./_reloader.py: No error information
ls: ./datastructures.py: No error information
ls: ./_internal.py: No error information
ls: ./middleware: No error information
ls: ./__pycache__: No error information
ls: ./wrappers: No error information
ls: ./_compat.py: No error information
ls: ./__init__.py: No error information
drwxr-xr-x    5 root     root          4096 Nov 11 12:19 ./
drwxr-xr-x   69 root     root          4096 Nov 11 15:24 ../

여기서 무슨 일이 일어나고 있는지 아는 사람 있나요?

감사해요!

답변1

sudo rmdir --ignore-fail-on-non-empty 삭제할 폴더 이름

그런 다음 명령을 사용하여 디렉터리를 삭제해 보세요.

이 문제가 해결될 수 있는지 확실하지 않습니다. 그래도 실패하면 파일 시스템이 손상된 것 같습니다. /tmp 파티션에서 fsck를 실행하고 파일 시스템을 복구해 보십시오. 실제 환경의 루트 파일 시스템에서 fsck를 실행하면 안 됩니다. 그러나 /tmp는 괜찮을 것입니다.

관련 정보