我突然在我们的 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
操作系统怎么可能知道正在使用多少,但我不能ls
以 root 身份使用它?或者更确切地说,这表明什么问题?
/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
然后我安装它,现在ls
可以工作并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.
有趣的是,即使在扩展测试显然自发中止之后,也没有记录任何错误:
$ 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 错误的更多信息。可能表明磁盘损坏的东西?smartctl
(来自smartmontools,它在 CentOS 中)命令来确定。我最近在使用 8TB USB 驱动器时遇到了这个问题。我认为它可能已损坏,因为我的 Windows 计算机也无法读取它。(它被格式化为 EXT4,但被误认为是 HFS)。在我试图弄清楚的时候,刚刚添加的第二个 4TB 驱动器做了同样的事情,尽管它在另一台 linux 机器上被正确识别为 EXT4。我没有尝试用 Windows 阅读它。它们会挂载但无法读取。它有时也没有安装在正确的分区上。当我们发现两个驱动器都可以在另一台 linux 机器上读取时,我松了一口气。我尝试再次重新安装它们,并且两者都是可读的。由于它发生在两个不同的驱动器上,我认为这是我机器上的 USB 接口的间歇性问题。