我想在 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
我从smartmontools.org/wiki/获得的选项 -d usbjmicron
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
好的,在我的情况下, udisksd 守护进程会出现错误
我四处寻找,发现了一个较旧的错误报告
我为我的备份脚本扩展了我的 udev 规则
现在该硬盘的 smartd 功能已禁用。