![交换分区损坏-怎么办?](https://linux22.com/image/818702/%E4%BA%A4%E6%8D%A2%E5%88%86%E5%8C%BA%E6%8D%9F%E5%9D%8F-%E6%80%8E%E4%B9%88%E5%8A%9E%EF%BC%9F.png)
我需要 GPartEd 来格式化 MicroSD 卡(不要太相信磁盘实用程序,因为用它格式化的硬盘和存储卡似乎比用 GPartEd 格式化的硬盘和存储卡出现的问题更多),差点心脏病发作……我的新硬盘上有一个损坏的分区(使用了 2 个多月)!
幸运的是,它只是我的 SWAP 分区,但仍然……
我想知道一些事情...
- 如何排除硬件故障的可能。
- 如果问题与硬件无关,那么为什么会发生这种情况。
- 我只安装了Linux一次在这台计算机上(等待 Ubuntu 12.04 发布),所以它不是早期安装留下的 SWAP 分区。
- 哪些原因可能导致物理硬盘损坏。
- 电脑没有从桌子上掉下来或其他地方……
- 如果可能的话,如何防止将来发生此类情况。
- 额外的:阅读(我认为写作也一样)速度在一分钟内显着下降是否正常;如果不是,有哪些可能的方法来分析/解决这个问题?
如果你不能回答我所有的问题也没关系。
信息
这是一个只读基准。
标记为视窗包含一个 Windows 7 安装,我应该需要一些时间去上学,我在 Ubuntu 12.04 发布之前使用它。在安装 Ubuntu 12.04 后,我启动过几次(我不知道 Windows 的磁盘检查是否会对 Linux 分区造成任何损害,但在我使用 GPartEd 等 Linux 应用程序更改分区表布局后,它似乎总是运行检查磁盘)。/dev/sda7
是我所说的 SWAP 分区。
我想我现在最好的选择就是尝试启动 Live CD 并/dev/sda7
再次格式化?它不会从我安装的 Ubuntu 系统进行格式化。
答案1
只是瞎猜,但恕我直言,您的交换分区根本没有损坏。我已经看到fdisk
和之间的差异gparted
,很遗憾,但 fdisk 几乎总是正确的。
尝试一下:
#> cat /proc/meminfo | grep -i swap
SwapCached: 10632 kB
SwapTotal: 2094076 kB
SwapFree: 2053324 kB
您应该看到您的交换空间实际上正在使用中(或者至少我希望如此)。
/dev/mapper/cryptswap1
那个“不可读”分区的解释是,它cryptswap1
实际上是一个映射的加密交换空间,所以没有人能理解里面有什么应该没问题。如果你想禁用它,你可以看看这个帖子:如何禁用 cryptswap?
最后但并非最不重要的一点是您的SMART
状况:乍一看(仅查看读取错误率和寻道错误率),我会说您的驱动器即将崩溃。但是,不,没关系,我有一个驱动器也SMART
显示完全相同的信息。我将发布完整的输出,仅供参考(对我和其他人而言),以供将来访问。
#> sudo smartctl --all /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-24-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.12
Device Model: ST3250318AS
Serial Number: 9VM2R3AN
LU WWN Device Id: 5 000c50 015aa8d47
Firmware Version: CC35
User Capacity: 250,059,350,016 bytes [250 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Sun May 27 18:03:03 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
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: ( 617) 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: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 52) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x103f) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 118 099 006 Pre-fail Always - 196559365
3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 320
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 067 060 030 Pre-fail Always - 6277671
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 517
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 158
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 41
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 065 065 045 Old_age Always - 35 (Min/Max 21/35)
194 Temperature_Celsius 0x0022 035 040 000 Old_age Always - 35 (0 12 0 0)
195 Hardware_ECC_Recovered 0x001a 052 045 000 Old_age Always - 196559365
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 72748156060552
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 968998393
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 939693204
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 --all /dev/sdc
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.0.6-gentoo-goomba-test-3]
(local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Model Family: Western Digital Caviar Green (Adv. Format)
Device Model: WDC WD20EARS-00MVWB0
Serial Number: WD-WCAZA2437330
LU WWN Device Id: 5 0014ee 205473c89
Firmware Version: 51.0AB51
User Capacity: 2,000,398,934,016 bytes [2,00 TB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 8
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Sun May 27 18:16:09 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x84) Offline data collection activity
was suspended by an interrupting
command from host.
Auto Offline Data Collection: Enabled.
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: (37500) 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: ( 255) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x3035) 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 253 253 021 Pre-fail Always - 1233
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 390
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 094 094 000 Old_age Always - 4988
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 - 388
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 33
193 Load_Cycle_Count 0x0032 135 135 000 Old_age Always - 197801
194 Temperature_Celsius 0x0022 119 109 000 Old_age Always - 31
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 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 199 000 Old_age Always - 451
200 Multi_Zone_Error_Rate 0x0008 200 200 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 --all /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.0.6-gentoo-goomba-test-3] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Model Family: Seagate Maxtor DiamondMax 20
Device Model: MAXTOR STM3160211AS
Serial Number: 6PT56QN7
Firmware Version: 3.AAE
User Capacity: 160,041,885,696 bytes [160 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Sun May 27 18:33:59 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
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: ( 430) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No 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: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 54) minutes.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 102 087 006 Pre-fail Always - 4542948
3 Spin_Up_Time 0x0003 095 095 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 1011
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 11
7 Seek_Error_Rate 0x000f 089 060 030 Pre-fail Always - 846828717
9 Power_On_Hours 0x0032 086 086 000 Old_age Always - 13126
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 1019
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 064 052 045 Old_age Always - 36 (Min/Max 22/37)
194 Temperature_Celsius 0x0022 036 048 000 Old_age Always - 36 (0 14 0 0 0)
195 Hardware_ECC_Recovered 0x001a 050 046 000 Old_age Always - 11583613
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 169 000 Old_age Always - 48
200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline - 0
202 Data_Address_Mark_Errs 0x0032 100 253 000 Old_age Always - 0
SMART Error Log Version: 1
ATA Error Count: 204 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 204 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
84 51 2d 72 00 00 e0 Error: ICRC, ABRT 45 sectors at LBA = 0x00000072 = 114
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 3e 61 00 00 e0 00 00:01:52.203 READ DMA
27 00 00 00 00 00 e0 00 00:01:52.133 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 00:01:52.125 IDENTIFY DEVICE
ef 03 42 00 00 00 a0 00 00:01:52.104 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 00:01:46.941 READ NATIVE MAX ADDRESS EXT
Error 203 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
84 51 2d 72 00 00 e0 Error: ICRC, ABRT 45 sectors at LBA = 0x00000072 = 114
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 3e 61 00 00 e0 00 00:01:45.519 READ DMA
c8 00 02 5f 00 00 e0 00 00:01:45.511 READ DMA
27 00 00 00 00 00 e0 00 00:01:45.503 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 00:01:45.431 IDENTIFY DEVICE
ef 03 42 00 00 00 a0 00 00:01:45.423 SET FEATURES [Set transfer mode]
Error 202 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
84 51 00 60 00 00 e0 Error: ICRC, ABRT at LBA = 0x00000060 = 96
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 02 5f 00 00 e0 00 00:01:45.519 READ DMA
27 00 00 00 00 00 e0 00 00:01:45.511 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 00:01:45.503 IDENTIFY DEVICE
ef 03 42 00 00 00 a0 00 00:01:45.431 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 00:01:45.423 READ NATIVE MAX ADDRESS EXT
Error 201 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
84 51 00 60 00 00 e0 Error: ICRC, ABRT at LBA = 0x00000060 = 96
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
c8 00 02 5f 00 00 e0 00 00:01:44.035 READ DMA
25 00 08 af 8a a1 e0 00 00:01:43.980 READ DMA EXT
27 00 00 00 00 00 e0 00 00:01:43.972 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 00:01:43.968 IDENTIFY DEVICE
ef 03 42 00 00 00 a0 00 00:01:43.904 SET FEATURES [Set transfer mode]
Error 200 occurred at disk power-on lifetime: 5852 hours (243 days + 20 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
84 51 00 b6 8a a1 e0 Error: ICRC, ABRT at LBA = 0x00a18ab6 = 10586806
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
25 00 08 af 8a a1 e0 00 00:01:44.035 READ DMA EXT
25 00 06 41 8a a1 e0 00 00:01:43.980 READ DMA EXT
27 00 00 00 00 00 e0 00 00:01:43.972 READ NATIVE MAX ADDRESS EXT
ec 00 00 00 00 00 a0 00 00:01:43.968 IDENTIFY DEVICE
ef 03 42 00 00 00 a0 00 00:01:43.904 SET FEATURES [Set transfer mode]
SMART Self-test log structure revision number 1
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.
至于读取速度基准,我认为速度随着时间的推移而下降是正常的。我怀疑缓存机制会使磁盘在测试的初始阶段看起来更快,而在测试结束时看起来更慢。但是我看到您的“最差”读取速度约为 80MB/s,远高于我的“最佳平均”读取速度(约 60MB/s),所以我不会担心这方面。
答案2
(本意是评论,但是太大了……)
gparted 错误只是它无法检测到文件系统(读取:它可能正在读取分区数据并尝试检测文件系统类型)。
fdisk
列出了分区表,仅此而已,并且那里的条目表明它是一个交换分区(这与文件系统无关,它是分区表中的分区类型条目,fdisk
甚至不会尝试自动检测文件系统类型)。
您显示的输出fdsik
提到了一个cryptswap
设备,我猜想它是交换分区上的加密层。所以这意味着您的交换分区可能已加密。
如果是这种情况,那么gparted
正在读取交换分区本身,但可能会只会发现似乎不是任何可用文件系统也不是交换分区的加密数据,因为那里的数据是加密的,只能通过该cryptswap
设备访问(以其清晰的解密形式)。
如果交换正在使用中,并且加密数据当前正在设备上解密cryptswap
,这也意味着该分区正在使用中,从而解释了“设备或资源繁忙”错误。
为了检查这是否是问题所在,您可以分享在终端中运行的输出吗/sbin/swapon -s
?也许还有内容/etc/fstab
?