![e2fsck -n + 손상된 블록을 복구하기 위해 e2fsck를 실행해야 하는지 어떻게 알 수 있나요?](https://linux55.com/image/121503/e2fsck%20-n%20%2B%20%EC%86%90%EC%83%81%EB%90%9C%20%EB%B8%94%EB%A1%9D%EC%9D%84%20%EB%B3%B5%EA%B5%AC%ED%95%98%EA%B8%B0%20%EC%9C%84%ED%95%B4%20e2fsck%EB%A5%BC%20%EC%8B%A4%ED%96%89%ED%95%B4%EC%95%BC%20%ED%95%98%EB%8A%94%EC%A7%80%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%95%8C%20%EC%88%98%20%EC%9E%88%EB%82%98%EC%9A%94%3F.png)
각 Linux Redhat 시스템의 /deb/sdc..../dev/sdg로 디스크의 파일 시스템을 확인하고 싶습니다.
목표는 e2fsck가 필요한 디스크(예: e2fsck -y /dev/sdb 등)를 찾는 것입니다.
매뉴얼 페이지에 따르면
-n Open the filesystem read-only, and assume an answer of `no' to all questions. Allows e2fsck to be used non-interactively. This option may not be specified at
the same time as the -p or -y options.
명령을 실행할 때(예제일 뿐)
e2fsck -n /dev/sdXX
우리는 얻었다
e2fsck 1.42.9 (28-Dec-2013)
Warning! /dev/sdc is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/sdc: clean, 94/1310720 files, 156685/5242880 blocks
그렇다면 e2fsck를 실행하려면 e2fsck 출력에서 무엇을 캡처해야 합니까?
e2fsck 프로세스
init 1
umount /dev/sdXX
e2fsck -y /dev/sdXX ( or e2fsck -C /dev/sdXX for full details )
init 3
답변1
tune2fs
아마도 대신에 출력을 찾고 있을 것입니다 .e2fsck
tune2fs -l /dev/sdXX |grep "Filesystem state\|Last checked\|Check interval"
다음과 같은 결과가 생성되어야 합니다.
Filesystem state: clean
Last checked: Mon Nov 28 16:03:44 2016
Check interval: 31536000 (12 months)