![불량 블록이나 디스크 문제를 식별하는 방법](https://linux55.com/image/146195/%EB%B6%88%EB%9F%89%20%EB%B8%94%EB%A1%9D%EC%9D%B4%EB%82%98%20%EB%94%94%EC%8A%A4%ED%81%AC%20%EB%AC%B8%EC%A0%9C%EB%A5%BC%20%EC%8B%9D%EB%B3%84%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
우리는 불량 블록이나 디스크 문제를 식별하고 싶습니다.
umount /grid/sdd
badblocks -n -vv /dev/sdd
Checking for bad blocks in non-destructive read-write mode
From block 0 to 20971519
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: 14.38% done, 2:46 elapsed. (0/0/0 errors)
문제는 검증 시간이 오래 걸린다는 점인데, 5T 디스크라면 30시간 이상 걸린다는 점이다.
이 작업을 더 빠르게 수행할 수 있는 다른 옵션이나 도구가 있습니까?
20G 디스크 확인, 도구 30분
badblocks -n -vv /dev/sdd
Checking for bad blocks in non-destructive read-write mode
From block 0 to 20971519
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: done
Pass completed, 0 bad blocks found. (0/0/0 errors)
답변1
첫째, 비파괴 모드 대신 파괴 badblocks
( ) 모드를 사용하면 실행 시간을 절반으로 줄일 수 있습니다 .-w
-n
청크 크기와 청크 수를 조정할 수도 있습니다.
-b block_size
Specify the size of blocks in bytes. The default is 1024.
-c number of blocks
is the number of blocks which are tested at a time. The default
is 64.
블록 수는 사용 가능한 메모리에 의해서만 제한됩니다. 블록 크기는 디스크의 블록 크기(요즘 일반적으로 4096)와 일치해야 합니다. 다음을 통해 확인할 수 있습니다:
lsblk -o NAME,PHY-SeC
디스크 문제를 감지하는 일반적인 방법은 이제 SMART입니다. 최신 디스크는 실패한 섹터를 다시 매핑하고 표시되지도 않습니다 badblocks
. SMART가 프로세스를 실행하고 수시로 확인하도록 할 수도 있고( smartctl -H /dev/sda
) 강제로 테스트할 수도 있습니다 smartctl -t long
. 이 테스트는 디스크의 정상적인 작동을 방해하지 않습니다. 즉, badblocks
SMART로 대체됩니다.