간단한 테스트 결과에 따르면, 내 하드 드라이브에 약간의 오류가 있었습니다 smartctl
(아래 참조).
그런 다음 개인 정보 보호를 위해 먼저 디스크의 데이터를 0으로 만듭니다.
sudo dd if=/dev/zero of=/dev/sdc1 bs=1M
sudo dd if=/dev/zero of=/dev/sdc2 bs=1M
그런 다음 1개의 큰 파티션으로 다시 분할한 다음 xfs_repiar를 사용하여 오류를 수정하려고 했습니다. sudo xfs_repair /dev/sdc
그러나 결국에는 다음과 같이 인쇄되었습니다.
Sorry, could not find valid secondary superblock
Exiting now.
그런 다음 다음을 실행했습니다 sudo smartctl -t short /dev/sdc
.
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-5.17.0-1.el7.elrepo.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Wed Jan 25 19:17:48 2023
Use smartctl -X to abort test.
[hc@hclinux22 src]$ sudo smartctl -a /dev/sdc
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-5.17.0-1.el7.elrepo.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: ST2000DM008-2FR102
Serial Number: [masked off]
LU WWN Device Id: 5 000c50 0bf3bfc3b
Firmware Version: 0001
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Jan 25 19:16:53 2023 HKT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 249) Self-test routine in progress...
90% of test remaining.
Total time to complete Offline
data collection: ( 0) seconds.
Offline data collection
capabilities: (0x73) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 198) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x30a5) SCT Status supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 100 053 006 Pre-fail Always - 0
3 Spin_Up_Time 0x0003 098 097 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 688
5 Reallocated_Sector_Ct 0x0033 099 099 010 Pre-fail Always - 2720
7 Seek_Error_Rate 0x000f 079 060 045 Pre-fail Always - 86398239
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 1741 (180 187 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 688
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 4501
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 12885098499
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 066 059 040 Old_age Always - 34 (Min/Max 20/34)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 24
193 Load_Cycle_Count 0x0032 079 079 000 Old_age Always - 42048
194 Temperature_Celsius 0x0022 034 041 000 Old_age Always - 34 (0 17 0 0 0)
195 Hardware_ECC_Recovered 0x001a 100 064 000 Old_age Always - 0
197 Current_Pending_Sector 0x0012 100 098 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 098 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 1272 (103 165 0)
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 8760463243
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 22589260799
SMART Error Log Version: 1
ATA Error Count: 4501 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 4501 occurred at disk power-on lifetime: 1727 hours (71 days + 23 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 53 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 01:38:29.788 READ FPDMA QUEUED
ef 10 02 00 00 00 a0 00 01:38:29.778 SET FEATURES [Enable SATA feature]
27 00 00 00 00 00 e0 00 01:38:29.752 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 01:38:29.750 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 01:38:29.737 SET FEATURES [Set transfer mode]
Error 4500 occurred at disk power-on lifetime: 1727 hours (71 days + 23 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 53 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 01:38:29.638 READ FPDMA QUEUED
ef 10 02 00 00 00 a0 00 01:38:29.628 SET FEATURES [Enable SATA feature]
27 00 00 00 00 00 e0 00 01:38:29.602 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 01:38:29.600 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 01:38:29.588 SET FEATURES [Set transfer mode]
Error 4499 occurred at disk power-on lifetime: 1727 hours (71 days + 23 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 53 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 01:38:29.481 READ FPDMA QUEUED
60 00 00 ff ff ff 4f 00 01:38:27.087 READ FPDMA QUEUED
60 00 00 ff ff ff 4f 00 01:38:23.902 READ FPDMA QUEUED
60 00 80 ff ff ff 4f 00 01:38:23.008 READ FPDMA QUEUED
60 00 40 ff ff ff 4f 00 01:38:23.008 READ FPDMA QUEUED
Error 4498 occurred at disk power-on lifetime: 1727 hours (71 days + 23 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 53 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 01:38:13.746 READ FPDMA QUEUED
ea 00 00 00 00 00 a0 00 01:38:13.728 FLUSH CACHE EXT
61 00 78 ff ff ff 4f 00 01:38:13.725 WRITE FPDMA QUEUED
61 00 c0 ff ff ff 4f 00 01:38:13.724 WRITE FPDMA QUEUED
ef 10 02 00 00 00 a0 00 01:38:13.715 SET FEATURES [Enable SATA feature]
Error 4497 occurred at disk power-on lifetime: 1727 hours (71 days + 23 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 53 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 01:38:13.519 READ FPDMA QUEUED
61 00 c0 ff ff ff 4f 00 01:38:13.519 WRITE FPDMA QUEUED
61 00 40 ff ff ff 4f 00 01:38:13.519 WRITE FPDMA QUEUED
61 00 d0 ff ff ff 4f 00 01:38:13.519 WRITE FPDMA QUEUED
61 00 40 ff ff ff 4f 00 01:38:13.518 WRITE FPDMA QUEUED
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Self-test routine in progress 90% 1741 -
# 2 Short offline Completed without error 00% 1739 -
# 3 Short offline Completed without error 00% 1737 -
# 4 Short offline Completed: read failure 90% 1709 3894432032
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
이전 오류가 여전히 존재합니다.
오류가 "로그"에 남아 있지만 수정되었는지 어떻게 확인할 수 있나요?
위의 오류가 존재하는 경우 어떻게 수정하고 확인할 수 있나요? 드라이브에는 관심이 없지만 오류를 수정할 수 있는지 확인하고 나면 디스크가 "신뢰할 수 있는" 상태로 유지되는지 확인하고 싶습니다.
감사해요!
===========================
고쳐 쓰다:
$ sudo parted /dev/sdc unit MiB print
Model: ATA ST2000DM008-2FR1 (scsi)
Disk /dev/sdc: 1907729MiB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1.00MiB 1907729MiB 1907728MiB xfs
예, sdc1 및 sdc2를 삭제한 후 다시 파티션을 나누었을 때 해당 파티션에 대한 xfs를 만들었습니다.
$ ll /dev/sdc2
ls: cannot access /dev/sdc2: No such file or directory
$ ll /dev/sdc1
brw-rw----. 1 root disk 8, 33 Jan 25 19:46 /dev/sdc1
답변1
무엇보다도 여기에는 일종의 하드웨어 버그가 있습니다. 모든 케이블이 제자리에 있는지 확인하십시오(USB의 경우 포트가 드라이브에 충분한 전원을 공급하고 있음).
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 12885098499
둘째, 디스크에 장애가 발생한 영역이 있으며 (현재 성공적으로) 섹터를 예비 영역에 다시 매핑하고 있습니다. 그러나 조만간 예비 섹터가 부족해지고 데이터에 오류가 나타나기 시작할 것입니다.
5 Reallocated_Sector_Ct 0x0033 099 099 010 Pre-fail Always - 2720
이제 응답으로 무엇을 했는지 살펴보겠습니다.
/dev/sdc1
디스크의 첫 번째 파티션에 있는 모든 항목을 삭제했습니다./dev/sdc2
디스크의 두 번째 파티션에 있는 모든 항목을 삭제했습니다.- 파티션에 없지만 전체 디스크를 차지하는 XFS 파일 시스템을 복구해 보십시오.
/dev/sdc
파티션 1과 2의 데이터를 삭제한 경우 더 이상 액세스할 수 있는 데이터가 없습니다. 그러나 파티션 테이블이 있는 경우 해당 파티션 테이블 외부의 디스크에 파일 시스템(XFS 또는 기타)이 있을 가능성은 거의 없습니다. 아마도 이미 데이터를 삭제했고 복구할 파일 시스템이 없거나 /dev/sdc3
.
업데이트된 질문에서 파티션 테이블에는 하나의 파티션만 표시됩니다 /dev/sdc1
. 보여주신 내용이 정확하다면 - before라는 큰 파일을 dd
생성했다는 의미 /dev/sdc2
이며, 파일 크기에 제한이 없으므로 파티션 /dev
을 가득 채웠을 것이므로 dd
이 오류가 보고되어야 합니다. ls -l /dev/sdc2
파일인지 장치인지 확인 하는 데 사용됩니다 .그리고 만약에파일이라면 delete 를 사용하세요 rm /dev/sdc2
.
반면에 /dev/sdc2
장치로 나열되어 있거나 누락된 경우 표시되는 파티션 테이블은 질문의 나머지 부분에서 설명하는 파티션 테이블이 아닙니다.