我认为我的 USB 硬盘已损坏。当我运行 时dmesg
,它显示:
[80489.847168] ---[ end trace 66bad045bd32e5be ]---
[80577.323943] usb 2-1.1: new high-speed USB device number 4 using ehci-pci
[80577.434010] usb 2-1.1: New USB device found, idVendor=152d, idProduct=2329
[80577.434016] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[80577.434020] usb 2-1.1: Product: USB to ATA/ATAPI bridge
[80577.434024] usb 2-1.1: Manufacturer: JMicron
[80577.434028] usb 2-1.1: SerialNumber: F8B08539621E
[80577.434862] usb-storage 2-1.1:1.0: USB Mass Storage device detected
[80577.436400] usb-storage 2-1.1:1.0: Quirks match for vid 152d pid 2329: 8020
[80577.436468] scsi host4: usb-storage 2-1.1:1.0
[80578.445148] scsi 4:0:0:0: Direct-Access MD02500- AVDW-RO 01.0 PQ: 0 ANSI: 2 CCS
[80578.446026] sd 4:0:0:0: Attached scsi generic sg2 type 0
[80578.446441] sd 4:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/233 GiB)
[80578.447457] sd 4:0:0:0: [sdb] Write Protect is off
[80578.447465] sd 4:0:0:0: [sdb] Mode Sense: 28 00 00 00
[80578.448565] sd 4:0:0:0: [sdb] No Caching mode page found
[80578.448574] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[80578.485832] sdb: sdb1 < sdb5 >
[80578.489329] sd 4:0:0:0: [sdb] Attached SCSI disk
[80581.790218] sd 4:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[80581.790223] sd 4:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current]
[80581.790225] sd 4:0:0:0: [sdb] tag#0 Add. Sense: Unrecovered read error
[80581.790229] sd 4:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 3f 00 00 00 08 00
[80581.790232] print_req_error: critical medium error, dev sdb, sector 16128
[80584.135828] sd 4:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[80584.135837] sd 4:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current]
[80584.135843] sd 4:0:0:0: [sdb] tag#0 Add. Sense: Unrecovered read error
[80584.135852] sd 4:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 3f 00 00 00 08 00
[80584.135856] print_req_error: critical medium error, dev sdb, sector 16128
[80584.135867] Buffer I/O error on dev sdb5, logical block 0, async page read
[80584.135875] Buffer I/O error on dev sdb5, logical block 1, async page read
[80584.135880] Buffer I/O error on dev sdb5, logical block 2, async page read
[80584.135885] Buffer I/O error on dev sdb5, logical block 3, async page read
[80584.135890] Buffer I/O error on dev sdb5, logical block 4, async page read
[80584.135941] Buffer I/O error on dev sdb5, logical block 5, async page read
[80584.135961] Buffer I/O error on dev sdb5, logical block 6, async page read
[80584.135977] Buffer I/O error on dev sdb5, logical block 7, async page read
我读过这个文章这表明你可以强制重新分配坏扇区:
$ sudo hdparm --read-sector 16128 /dev/sdb5
/dev/sdb5: Device /dev/sdb5 has non-zero LBA starting offset of 16128.
Please use an absolute LBA with the /dev/ entry for the raw device, rather than a partition or raid name.
/dev/sdb5 is probably a partition of /dev/sdb (?)
The absolute LBA of sector 16128 from /dev/sdb5 should be 32256
Aborting.
我不知道下一步该怎么做才能访问此驱动器中的数据。有人能帮忙吗?
以下是 SMART 信息:
sudo smartctl --all /dev/sdb
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.15.0-46-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: MD02500-AVDW-RO
Serial Number: FXB0XKS96R1E
LU WWN Device Id: 5 0014ee 600ec4c15
Firmware Version: 01.01A01
User Capacity: 250,059,350,016 bytes [250 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 5400 rpm
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 2.6, 3.0 Gb/s
Local Time is: Sun Mar 22 16:06:55 2020 GMT
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: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 6600) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
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: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 79) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x7037) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 100 253 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 183 179 021 Pre-fail Always - 1850
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 75
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 100 100 000 Old_age Always - 3
10 Spin_Retry_Count 0x0032 100 253 051 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 73
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 70
193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 42
194 Temperature_Celsius 0x0022 120 106 000 Old_age Always - 27
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 13
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 051 Old_age Offline - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
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.
答案1
您的 HDD 上有一个或多个坏扇区,如下所示:
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 13
您需要fsck
检查您的文件系统,然后对您的硬盘进行坏块处理。
文件系统检查
- 以“试用 Ubuntu”模式启动 Ubuntu Live DVD/USB
terminal
按Ctrl+ Alt+打开窗口T- 类型
sudo fdisk -l
- 识别“Linux 文件系统”的 /dev/sdXX 设备名称
- 输入
sudo fsck -f /dev/sdXX
,替换sdXX
为您之前找到的数字 fsck
如果有错误则重复命令
坏块
注意:不要中止坏块扫描!
注意:不要对 SSD 造成坏块
注意:请先备份您的重要文件!
注意:这将花费很多小时
注意:您可能面临硬盘故障
启动至 Ubuntu Live DVD/USB。
在terminal
...
sudo fdisk -l
# 识别所有“Linux 文件系统”分区
sudo e2fsck -fcky /dev/sdXX
# 只读测试
或者
sudo e2fsck -fccky /dev/sdXX
# 非破坏性读写测试(受到推崇的)
-k 很重要,因为它会保存之前的坏块表,并将任何新的坏块添加到该表中。如果没有 -k,您将丢失所有之前的坏块信息。
-fccky 参数...
-f Force checking even if the file system seems clean.
-c This option causes e2fsck to use badblocks(8) program to do a
read-only scan of the device in order to find any bad blocks.
If any bad blocks are found, they are added to the bad block
inode to prevent them from being allocated to a file or direc‐
tory. If this option is specified twice, then the bad block
scan will be done using a non-destructive read-write test.
-k When combined with the -c option, any existing bad blocks in the
bad blocks list are preserved, and any new bad blocks found by
running badblocks(8) will be added to the existing bad blocks
list.
-y Assume an answer of `yes' to all questions; allows e2fsck to be
used non-interactively. This option may not be specified at the
same time as the -n or -p options.