Smartctl
디스크 정보 조회
sudo smartctl -i /dev/sda1
자가진단 결과 조회. PASSED이면 정상
sudo smartctl -H /dev/sda1
SMART값 상세 조회
sudo smartctl -a /dev/sda1
스마트 숏 테스트 (1분 내외)
smartctl -t short /dev/sdb
스마트 롱 테스트 ( 373분)
smartctl -t long /dev/sdb
첫 베드섹터 출력
smartctl -l selftest /dev/sbd
파일시스템검사/복구
fsck /dev/backup/data
배드섹터 파괴하기
해당 섹터를 지워버림.
hdparm --write-sector 3694747216 --yes-i-know-what-i-am-doing /dev/sdg
기타
현재 보류 중인 섹터 수(Current_Pending_Sector)
현재 보류 중인 섹터 수(Current_Pending_Sector)는 디스크에서 재매핑 대기 중인 불안정한 섹터의 현재 수를 표시하는 S.M.A.R.T 매개변수임. 이 섹터를 나중에 성공적으로 읽으면 카운트가 감소함. 드라이브가 영향을 받은 섹터의 데이터 읽기를 다시 시도하는 데 실패하면 이러한 섹터는 예비 드라이브 공간에 재할당된다. 섹터가 재할당되면 현재 보류 중인 섹터 수는 감소하고 재할당된 섹터 수(Reallocated_Event_Count)는 증가함.
이 수치가 계속 증가한다면, 곧 하드디스크가 망가진다는 뜻이므로 즉시 자료를 옮겨야 한다.
이 수치가 상당히 낮고 급격하게 증가하지 않는다면, 또 귀중한 자료가 저장된 것이 아니라면, 하드 드라이브는 계속해서 사용할 수도 있다.
복구
제로필(Zero fill) 포맷로 해당 섹터에 '0'을 채우게 함으로써 강제로 재분석
을 하게할 수 있다.
이후 복구될 수도 있고, 일시적으로 에러가 없어진 것일 수도 있다.
Reallocated_Event_Count
드라이브가 영향을 받은 섹터의 데이터 읽기를 다시 시도하여 실패하고, 오류가 있다고 판정하면, 이러한 섹터는 예비 드라이브 공간에 재할당된다. 섹터가 재할당되면 현재 보류 중인 섹터 수(Current_Pending_Sector)는 감소하고 재할당된 섹터 수(Reallocated_Event_Count)는 증가함.
ID#|ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1|Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always - 0 2|Throughput_Performance 0x0005 138 138 054 Pre-fail Offline - 74 3|Spin_Up_Time 0x0007 160 160 024 Pre-fail Always - 301 (Average 416) 4|Start_Stop_Count 0x0012 100 100 000 Old_age Always - 143 5|Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0 7|Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0 8|Seek_Time_Performance 0x0005 124 124 020 Pre-fail Offline - 33 9|Power_On_Hours 0x0012 092 092 000 Old_age Always - 56054 10|Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0 12|Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 142 192|Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 970 193|Load_Cycle_Count 0x0012 100 100 000 Old_age Always - 970 194|Temperature_Celsius 0x0002 181 181 000 Old_age Always - 33 (Min/Max 10/46) 196|Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0 197|Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0 198|Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0 199|UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 13 3 Spin_Up_Time 0x0027 184 172 021 Pre-fail Always - 3758 4 Start_Stop_Count 0x0032 098 098 000 Old_age Always - 2115 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0 7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0 9 Power_On_Hours 0x0032 022 022 000 Old_age Always - 57382 10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0 11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 800 192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 186 193 Load_Cycle_Count 0x0032 001 001 000 Old_age Always - 1018044 194 Temperature_Celsius 0x0022 117 099 000 Old_age Always - 30 196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0 197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 1 198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x0032 200 199 000 Old_age Always - 2 200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0
smartctl -f hex,id -a /dev/sda
ID를 16진수로 출력.
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 0x05 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0 0x09 Power_On_Hours 0x0032 099 099 000 Old_age Always - 1785 0x0c Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 225 0xb1 Wear_Leveling_Count 0x0013 098 098 000 Pre-fail Always - 25 0xb3 Used_Rsvd_Blk_Cnt_Tot 0x0013 100 100 010 Pre-fail Always - 0 0xb5 Program_Fail_Cnt_Total 0x0032 100 100 010 Old_age Always - 0 0xb6 Erase_Fail_Count_Total 0x0032 100 100 010 Old_age Always - 0 0xb7 Runtime_Bad_Block 0x0013 100 100 010 Pre-fail Always - 0 0xbb Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0 0xbe Airflow_Temperature_Cel 0x0032 066 047 000 Old_age Always - 34 0xc3 Hardware_ECC_Recovered 0x001a 200 200 000 Old_age Always - 0 0xc7 UDMA_CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0 0xeb Unknown_Attribute 0x0012 099 099 000 Old_age Always - 22 0xf1 Total_LBAs_Written 0x0032 099 099 000 Old_age Always - 26385520271