在CentOS 6.4上读取USB备份驱动器的input/输出错误

我突然看到我们的USB备份驱动器上有一些奇怪的行为,这对我来说是没有意义的:

(2013-10-21 14:58:23 [root@newdc /]$ cd /mnt/backup/ (2013-10-21 14:59:03 [root@newdc backup]$ ls -la ls: reading directory .: Input/output error total 0 (2013-10-21 14:59:05 [root@newdc backup]$ df -h /mnt/backup Filesystem Size Used Avail Use% Mounted on /dev/sda1 917G 843G 28G 97% /mnt/backup 

操作系统怎么可能知道有多less使用,但我不能作为根的任何一个? 或者更重要的是,这表明了什么问题?

/var/log/messages说这个:

 Oct 21 14:57:54 g5 kernel: EXT4-fs error (device sda1): ext4_journal_start_sb: Detected aborted journal Oct 21 14:57:54 g5 kernel: EXT4-fs (sda1): Remounting filesystem read-only 

但是…只读与“抛出io错误”不同

在卸载之后尝试fsck,我有人在现场看着它,驱动器没有旋转,并有一个缓慢闪烁的灯光,我相信这意味着它是在电源暂停模式。 所以我让他们拔下并重新插入USB电缆,现在(重新安装之前)它说:

 fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/sda1: clean, 2805106/61046784 files, 181934167/244182016 blocks 

然后,我挂载它,现在工作和df报告:

 Filesystem Size Used Avail Use% Mounted on /dev/sda1 917G 680G 191G 79% /mnt/backup 

什么会导致它进入这样的状态,而不被要求呢? 为什么所有的怪异行为,现在看起来不是腐败?

 smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.11.1.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Device Model: WDC WD10JMVW-11S5XS0 Serial Number: WD-WX51AC2X2298 LU WWN Device Id: 5 0014ee 6587c0e18 Firmware Version: 01.01A01 User Capacity: 1,000,204,886,016 bytes [1.00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Wed Oct 23 20:08:46 2013 EDT SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART STATUS RETURN: incomplete response, ATA output registers missing SMART overall-health self-assessment test result: PASSED Warning: This result is based on an Attribute check. 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: (18180) 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: ( 198) minutes. Conveyance self-test routine recommended polling time: ( 5) minutes. SCT capabilities: (0x70b5) 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 200 200 051 Pre-fail Always - 0 3 Spin_Up_Time 0x0027 188 179 021 Pre-fail Always - 1600 4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 940 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 098 098 000 Old_age Always - 2004 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 - 744 192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 12 193 Load_Cycle_Count 0x0032 197 197 000 Old_age Always - 9379 194 Temperature_Celsius 0x0022 115 098 000 Old_age Always - 32 196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0 197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0 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 000 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. 

有趣的是,没有错误logging,即使在一个延长的testing显然中止自发:

 $ sudo smartctl -l error /dev/sda smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-358.11.1.el6.x86_64] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net === START OF READ SMART DATA SECTION === SMART Error Log Version: 1 No Errors Logged 

文件系统已损坏。 它甚至可能是非常腐败的,因为甚至没有fsck作品。 也许硬盘坏了什么的。

  • 检查dmesg ,看看你是否有更多关于这个FS错误。 可能表示磁盘损坏的东西?
  • 您可以检查驱动器是否支持SMART ,并运行一些smartctl (来自smartmontools ,它位于CentOS中)来查看。

我最近有一个8TB的USB驱动器这个问题。 我认为这可能是腐败的,因为我的Windows电脑无法读取它。 (这是格式化的EXT4,但是被误认为是HFS)。 在我试图弄清楚的时候,刚刚添加的第二个4TB驱动器也做了同样的事情,虽然它在另一台Linux机器上被正确识别为EXT4。 我没有试图用Windows读取它。 他们会挂载但不能被读取。 有时候也没有安装在正确的分区上。 当我们发现两个驱动器都可以在另一台Linux机器上读取时,我感到宽慰。 我试着重新安装它们,并且都是可读的。 由于它发生在两个不同的驱动器,我认为这是我的机器上的USB接口间歇性的问题。