linux – Harddrive问题“只读”

前端之家收集整理的这篇文章主要介绍了linux – Harddrive问题“只读”前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个问题,当我在几小时后挂载我的分区后,它变为只读.目前我运行:
  1. fuser -m -k /dev/sdb1
  2. umount /dev/sdb1
  3. fsck -y /dev/sdb1
  4. mount /dev/sdb1

这允许我在读/写中重新安装它,但这是一个反复出现的问题.我的问题是如何解决这个问题.它看起来像硬件或软件问题?

目前这是在CentOS 64位盒子上.

当我运行dmesg时,我会看到这个:

  1. EXT3-fs error (device sdb1): ext3_lookup: unlinked inode 36127046 in dir #36126721
  2. Aborting journal on device sdb1.
  3. __journal_remove_journal_head: freeing b_committed_data
  4. __journal_remove_journal_head: freeing b_committed_data
  5. ext3_abort called.
  6. EXT3-fs error (device sdb1): ext3_journal_start_sb: Detected aborted journal
  7. Remounting filesystem read-only

“smartctl -a / dev / sdb1”返回

  1. smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
  2. Home page is http://smartmontools.sourceforge.net/
  3.  
  4. === START OF INFORMATION SECTION ===
  5. Device Model: ST31500341AS
  6. Serial Number: 9VS2RH1M
  7. Firmware Version: CC1H
  8. User Capacity: 1,500,301,910,016 bytes
  9. Device is: Not in smartctl database [for details use: -P showall]
  10. ATA Version is: 8
  11. ATA Standard is: ATA-8-ACS revision 4
  12. Local Time is: Fri Aug 13 16:50:33 2010 PDT
  13. SMART support is: Available - device has SMART capability.
  14. SMART support is: Enabled
  15.  
  16. === START OF READ SMART DATA SECTION ===
  17. SMART overall-health self-assessment test result: PASSED
  18.  
  19. General SMART Values:
  20. Offline data collection status: (0x82) Offline data collection activity
  21. was completed without error.
  22. Auto Offline Data Collection: Enabled.
  23. Self-test execution status: ( 246) Self-test routine in progress...
  24. 60% of test remaining.
  25. Total time to complete Offline
  26. data collection: ( 609) seconds.
  27. Offline data collection
  28. capabilities: (0x7b) SMART execute Offline immediate.
  29. Auto Offline data collection on/off support.
  30. Suspend Offline collection upon new
  31. command.
  32. Offline surface scan supported.
  33. Self-test supported.
  34. Conveyance Self-test supported.
  35. Selective Self-test supported.
  36. SMART capabilities: (0x0003) Saves SMART data before entering
  37. power-saving mode.
  38. Supports SMART auto save timer.
  39. Error logging capability: (0x01) Error logging supported.
  40. General Purpose Logging supported.
  41. Short self-test routine
  42. recommended polling time: ( 1) minutes.
  43. Extended self-test routine
  44. recommended polling time: ( 255) minutes.
  45. Conveyance self-test routine
  46. recommended polling time: ( 2) minutes.
  47. SCT capabilities: (0x103f) SCT Status supported.
  48. SCT Feature Control supported.
  49. SCT Data Table supported.
  50.  
  51. SMART Attributes Data Structure revision number: 10
  52. Vendor Specific SMART Attributes with Thresholds:
  53. ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_Failed RAW_VALUE
  54. 1 Raw_Read_Error_Rate 0x000f 113 099 006 Pre-fail Always - 51209038
  55. 3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 0
  56. 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 16
  57. 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 6
  58. 7 Seek_Error_Rate 0x000f 078 060 030 Pre-fail Always - 78095697
  59. 9 Power_On_Hours 0x0032 094 094 000 Old_age Always - 5685
  60. 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
  61. 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 16
  62. 184 Unknown_Attribute 0x0032 100 100 099 Old_age Always - 0
  63. 187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
  64. 188 Unknown_Attribute 0x0032 100 099 000 Old_age Always - 4295032833
  65. 189 High_Fly_Writes 0x003a 093 093 000 Old_age Always - 7
  66. 190 Airflow_Temperature_Cel 0x0022 068 057 045 Old_age Always - 32 (Lifetime Min/Max 31/35)
  67. 194 Temperature_Celsius 0x0022 032 043 000 Old_age Always - 32 (0 19 0 0)
  68. 195 Hardware_ECC_Recovered 0x001a 038 022 000 Old_age Always - 51209038
  69. 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
  70. 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
  71. 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
  72. 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 243150983534133
  73. 241 Unknown_Attribute 0x0000 100 253 000 Old_age Offline - 230593735
  74. 242 Unknown_Attribute 0x0000 100 253 000 Old_age Offline - 2219959893
  75.  
  76. SMART Error Log Version: 1
  77. No Errors Logged
  78.  
  79. SMART Self-test log structure revision number 1
  80. Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
  81. # 1 Extended offline Self-test routine in progress 60% 5685 -
  82.  
  83. SMART Selective self-test log data structure revision number 1
  84. SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
  85. 1 0 0 Not_testing
  86. 2 0 0 Not_testing
  87. 3 0 0 Not_testing
  88. 4 0 0 Not_testing
  89. 5 0 0 Not_testing
  90. Selective self-test flags (0x0):
  91. After scanning selected spans,do NOT read-scan remainder of disk.
  92. If Selective self-test is pending on power-up,resume after 0 minute delay.

我最终运行“e2fsck -fy / dev / sdb1”,它给了我这个:

  1. e2fsck 1.39 (29-May-2006)
  2. /dev/sdb1: recovering journal
  3. Pass 1: Checking inodes,blocks,and sizes
  4. Pass 2: Checking directory structure
  5. Entry 'primary.sqlite' in /cache/yum/updates (36094008) has deleted/unused inode 36094073. Clear? yes
  6.  
  7. Entry 'repomd.xml' in /cache/yum/c5-testing (36126721) has deleted/unused inode 36127046. Clear? yes
  8.  
  9. Pass 3: Checking directory connectivity
  10. Pass 4: Checking reference counts
  11. Unattached inode 20005231
  12. Connect to /lost+found? yes
  13.  
  14. Inode 20005231 ref count is 2,should be 1. Fix? yes
  15.  
  16. Inode 36094015 ref count is 1,should be 2. Fix? yes
  17.  
  18. Inode 36094017 ref count is 1,should be 2. Fix? yes
  19.  
  20. Unattached inode 36094024
  21. Connect to /lost+found? yes
  22.  
  23. Inode 36094024 ref count is 2,should be 1. Fix? yes
  24.  
  25. Unattached inode 36094068
  26. Connect to /lost+found? yes
  27.  
  28. Inode 36094068 ref count is 2,should be 1. Fix? yes
  29.  
  30. Unattached inode 36094076
  31. Connect to /lost+found? yes
  32.  
  33. Inode 36094076 ref count is 2,should be 1. Fix? yes
  34.  
  35. Unattached inode 36110353
  36. Connect to /lost+found? yes
  37.  
  38. Inode 36110353 ref count is 2,should be 1. Fix? yes
  39.  
  40. Inode 36110357 ref count is 1,should be 2. Fix? yes
  41.  
  42. Unattached inode 36127047
  43. Connect to /lost+found? yes
  44.  
  45. Inode 36127047 ref count is 2,should be 1. Fix? yes
  46.  
  47. Unattached inode 73007330
  48. Connect to /lost+found? yes
  49.  
  50. Inode 73007330 ref count is 2,should be 1. Fix? yes
  51.  
  52. Unattached inode 73007331
  53. Connect to /lost+found? yes
  54.  
  55. Inode 73007331 ref count is 2,should be 1. Fix? yes
  56.  
  57. Pass 5: Checking group summary information
  58. Block bitmap differences: +161978373 -161984512 +161986577 -(161990662--161990663) +(161990668--161990669) -161992704 +161992715 -161994753 +161994778 -162000900
  59. Fix? yes
  60.  
  61. Free blocks count wrong for group #356 (242,counted=240).
  62. Fix? yes
  63.  
  64. Free blocks count wrong for group #375 (2086,counted=2064).
  65. Fix? yes
  66.  
  67. Free blocks count wrong for group #2203 (3224,counted=3223).
  68. Fix? yes
  69.  
  70. Free blocks count wrong for group #3564 (1,counted=3).
  71. Fix? yes
  72.  
  73. Free blocks count wrong for group #3571 (2820,counted=2824).
  74. Fix? yes
  75.  
  76. Free blocks count wrong (311466471,counted=311466452).
  77. Fix? yes
  78.  
  79. Free inodes count wrong for group #2203 (16060,counted=16059).
  80. Fix? yes
  81.  
  82. Free inodes count wrong (181859841,counted=181859840).
  83. Fix? yes
  84.  
  85.  
  86. /dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****
  87. /dev/sdb1: 1296896/183156736 files (1.5% non-contiguous),54817548/366284000 blocks

我假设那是导致HD进入只读状态的原因.我会及时通知你,并告诉你问题是否再次发生. (无论哪种方式我更换硬盘)

解决方法

文件系统可能安装了选项errors = remount-ro,顾名思义表示如果检测到错误,文件系统会立即设置为只读,以避免进一步损坏.

内核日志中会有信息(大多数Linux发行版上都是/var/log/kern.log).

下一步该做什么取决于原因.以下是最有可能的:

>它可能是一个失败的磁盘.通常,您会看到内核日志中报告的IO错误. smartctl -a / dev / sdb可以告诉你更多.尽快备份数据并更换磁盘.>这可能是你的RAM的一个问题.运行memtest只是为了确保.>这可能是一个内核错误.这对凡人来说很难诊断.确保为您的发行版发布了最新的内核.>由于不再适用的原因(例如现在已修复的内核错误),文件系统可能早先被损坏了.运行fsck应该可以解决问题,所以不幸的是,这种情况不适用于你.

猜你在找的Linux相关文章