我想在 ubuntu disco 中使用 smartctl 测试 USB 硬盘。
alex@Guilmon:~$ LANG=C
alex@Guilmon:~$ sudo smartctl -d usbjmicron --all /dev/sdc
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-5.0.0-36-generic] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
Read Device Identity failed: empty IDENTIFY data
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options
我从中获得的选项 -d usbjmicronsmartmontools.org/wiki/
lsusb | grep -i micron
Bus 003 Device 002: ID 152d:2329 JMicron Technology Corp. / JMicron USA Technology Corp. JM20329 SATA Bridge
smartctl --scan 也显示了这一点
sudo smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdc -d usbjmicron # /dev/sdc [USB JMicron], ATA device
一段时间后,Fdisk 和 parted 挂起。
Nov 27 16:35:16 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Nov 27 16:35:16 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Sense Key : Unit Attention [current]
Nov 27 16:35:16 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Add. Sense: Not ready to ready change, medium may have changed
Nov 27 16:35:16 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
Nov 27 16:35:16 Guilmon kernel: print_req_error: I/O error, dev sdc, sector 0 flags 0
Nov 27 16:35:16 Guilmon kernel: Buffer I/O error on dev sdc, logical block 0, async page read
Nov 27 16:36:30 Guilmon sudo[14829]: alex : TTY=pts/0 ; PWD=/home/alex ; USER=root ; COMMAND=/usr/sbin/fdisk -l /dev/sdc
Nov 27 16:38:17 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Nov 27 16:38:17 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Sense Key : Unit Attention [current]
Nov 27 16:38:17 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Add. Sense: Not ready to ready change, medium may have changed
Nov 27 16:38:17 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 03 8a 47 80 00 00 08 00
Nov 27 16:38:17 Guilmon kernel: print_req_error: I/O error, dev sdc, sector 59393920 flags 80700
Nov 27 16:41:18 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Nov 27 16:41:18 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Sense Key : Unit Attention [current]
Nov 27 16:41:18 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Add. Sense: Not ready to ready change, medium may have changed
Nov 27 16:41:18 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 03 8a 4f fe 00 00 02 00
Nov 27 16:41:18 Guilmon kernel: print_req_error: I/O error, dev sdc, sector 59396094 flags 80700
Nov 27 16:44:20 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Nov 27 16:44:20 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Sense Key : Unit Attention [current]
Nov 27 16:44:20 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 Add. Sense: Not ready to ready change, medium may have changed
Nov 27 16:44:20 Guilmon kernel: sd 6:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
Nov 27 16:44:20 Guilmon kernel: print_req_error: I/O error, dev sdc, sector 0 flags 0
Nov 27 16:44:20 Guilmon kernel: Buffer I/O error on dev sdc, logical block 0, async page read
文件系统
sudo lsblk -f | grep sdc
sdc
├─sdc1 ext4 bionic 8cc02316-1cd7-4f54-bd1a-c3f174e55251 #my bionic installation
├─sdc2 swap f923fdf9-3416-420d-898c-e481c82a757b
├─sdc3
└─sdc5 ext4 bionic-home f7217969-9cde-4eff-940b-761ebb06189b #old debian home
文件系统检查
sudo fsck.ext4 /dev/sdc1
[sudo] password for alex:
e2fsck 1.44.6 (5-Mar-2019)
bionic: recovering journal
bionic: clean, 373117/1602496 files, 2540186/6400000 blocks
alex@Guilmon:~$ sudo fsck.ext4 /dev/sdc5
e2fsck 1.44.6 (5-Mar-2019)
bionic-home: clean, 161503/28672000 files, 102109567/114672128 blocks
当我插入硬盘时,它安装得很好。但是昨天当我在文件管理器上搜索数据时,它挂起了。
在更换更大容量的硬盘之前,我测试过该硬盘,但并不常用。我该如何检查该硬盘?我试过几条电缆。我只有一个机箱。
请注意,我可以毫无问题地启动我的仿生系统。
抱歉,文字太多。
现在我得到了 fdisk 输出
sudo fdisk -l /dev/sdc
Disk /dev/sdc: 465,8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: IB-272StU-OT
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000e2cd8
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 51202047 51200000 24,4G 83 Linux
/dev/sdc2 51202048 59394047 8192000 3,9G 82 Linux swap / Solaris
/dev/sdc3 59396094 976773119 917377026 437,5G 5 Extended
/dev/sdc5 59396096 976773119 917377024 437,5G 83 Linux
答案1
好的,就我而言,udisksd 守护进程经历了错误
udisksd[657]: Error performing initial housekeeping for drive /org/freedesktop /UDisks2/drives/WDC_WD5000BPVT_22A1YT0_WD_WXM1C52T8295: Error updating SMART data: sk_disk_smart_read_data: Operation not supported (udisks-error-quark, 0)
我四处寻找,找到了一个较旧的错误报告
我扩展了我的备份脚本的 udev 规则
ENV{ID_ATA_FEATURE_SET_SMART}="0", ENV{ID_ATA_FEATURE_SET_SMART_ENABLED}="0"
现在此硬盘的 smartd 功能已被禁用。
E: ID_ATA_FEATURE_SET_SMART=0
E: ID_ATA_FEATURE_SET_SMART_ENABLED=0