![如何处理错误=remount-ro?](https://linux22.com/image/925686/%E5%A6%82%E4%BD%95%E5%A4%84%E7%90%86%E9%94%99%E8%AF%AF%3Dremount-ro%EF%BC%9F.png)
昨天,断电后启动操作系统时,屏幕上出现了这条消息“由于电池电量不足”
您处于紧急模式,登录后输入“journalctl -xb”查看系统日志,“systemctl reboot”重新启动,“systemctl default”或“exit”启动到默认模式。按 Enter 进行维护(或按 Control-D 继续):
以下帮助我摆脱了紧急模式
fsck -y /dev/sda*
*首先我使用了 sda7,但是只启动成功了一次并且再次进入紧急模式,然后我依次使用了 sda5 和 sda7。
它对我有用,但通过应用命令nano /etc/fstab
或vi /etc/fstab
,输出很烦人,因为它说
安装 ex4 时,/file 位于 /dev/sda5错误=重新安装-ro0 1
如何处理 errors=remount-ro ?我不知道它是否会损害我的系统。
操作系统 = UBUNTU 18.04
Smartmontools 结果:
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x80) Offline data collection activity
was never started.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 121) The previous self-test completed having
the read element of the test failed.
Total time to complete Offline
data collection: ( 120) seconds.
Offline data collection
capabilities: (0x51) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No 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: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 105) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control 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 100 100 050 Pre-fail Always - 0
2 Throughput_Performance 0x0027 100 100 050 Pre-fail Always - 0
3 Spin_Up_Time 0x0023 100 100 002 Pre-fail Always - 1368
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 5899
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 8
7 Seek_Error_Rate 0x002f 100 100 050 Pre-fail Always - 0
8 Seek_Time_Performance 0x0025 100 100 050 Pre-fail Offline - 0
9 Power_On_Hours 0x0032 061 061 000 Old_age Always - 15756
10 Spin_Retry_Count 0x0033 217 100 030 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 5587
183 Runtime_Bad_Block 0x0032 100 100 001 Old_age Always - 0
184 End-to-End_Error 0x0033 100 100 097 Pre-fail Always - 0
185 Unknown_Attribute 0x0032 100 100 001 Old_age Always - 65535
187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 24102
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 8
189 High_Fly_Writes 0x003a 100 100 001 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 063 045 040 Old_age Always - 37 (Min/Max 30/39)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 563
192 Power-Off_Retract_Count 0x0022 100 100 000 Old_age Always - 23069024
193 Load_Cycle_Count 0x0032 070 070 000 Old_age Always - 308244
194 Temperature_Celsius 0x0022 063 045 040 Old_age Always - 37 (Min/Max 30/39)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 1
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 3320
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
SMART Error Log Version: 1
ATA Error Count: 25061 (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 25061 occurred at disk power-on lifetime: 15747 hours (656 days + 3 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
-- -- -- -- -- -- --
40 41 50 ae 2c 01 40 Error: UNC at LBA = 0x00012cae = 76974
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 80 58 00 2d 01 40 00 01:24:48.589 READ FPDMA QUEUED
60 80 50 80 2c 01 40 00 01:24:48.558 READ FPDMA QUEUED
60 80 48 00 2c 01 40 00 01:24:48.558 READ FPDMA QUEUED
60 80 40 80 2b 01 40 00 01:24:48.558 READ FPDMA QUEUED
60 80 38 00 2b 01 40 00 01:24:48.557 READ FPDMA QUEUED
Error 25060 occurred at disk power-on lifetime: 15745 hours (656 days + 1 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
-- -- -- -- -- -- --
40 41 f0 ae 2c 01 40 Error: UNC at LBA = 0x00012cae = 76974
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 80 f8 60 9f 50 40 00 00:00:20.324 READ FPDMA QUEUED
60 01 f0 ae 2c 01 40 00 00:00:20.277 READ FPDMA QUEUED
60 80 e8 e0 9e 50 40 00 00:00:20.277 READ FPDMA QUEUED
60 80 e0 60 9e 50 40 00 00:00:20.277 READ FPDMA QUEUED
2f 00 01 10 00 00 28 00 00:00:20.276 READ LOG EXT
Error 25059 occurred at disk power-on lifetime: 15745 hours (656 days + 1 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
-- -- -- -- -- -- --
40 41 d8 ae 2c 01 40 Error: UNC at LBA = 0x00012cae = 76974
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 01 d8 ae 2c 01 40 00 00:00:20.185 READ FPDMA QUEUED
60 02 d0 32 2c 01 40 00 00:00:20.185 READ FPDMA QUEUED
60 02 c8 30 2c 01 40 00 00:00:20.185 READ FPDMA QUEUED
61 08 c0 38 75 03 40 00 00:00:20.184 WRITE FPDMA QUEUED
60 3d b8 71 2c 01 40 00 00:00:20.169 READ FPDMA QUEUED
Error 25058 occurred at disk power-on lifetime: 15744 hours (656 days + 0 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
-- -- -- -- -- -- --
40 41 18 ae 2c 01 40 Error: UNC at LBA = 0x00012cae = 76974
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 01 18 ae 2c 01 40 00 00:00:20.376 READ FPDMA QUEUED
60 80 10 c0 bf 2e 40 00 00:00:20.376 READ FPDMA QUEUED
60 80 08 40 bf 2e 40 00 00:00:20.376 READ FPDMA QUEUED
2f 00 01 10 00 00 28 00 00:00:20.370 READ LOG EXT
60 80 08 40 bf 2e 40 00 00:00:20.329 READ FPDMA QUEUED
Error 25057 occurred at disk power-on lifetime: 15744 hours (656 days + 0 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
-- -- -- -- -- -- --
40 41 00 ae 2c 01 40 Error: UNC at LBA = 0x00012cae = 76974
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 01 00 ae 2c 01 40 00 00:00:20.291 READ FPDMA QUEUED
60 02 f8 32 2c 01 40 00 00:00:20.291 READ FPDMA QUEUED
60 02 f0 30 2c 01 40 00 00:00:20.291 READ FPDMA QUEUED
61 08 e8 38 75 03 40 00 00:00:20.290 WRITE FPDMA QUEUED
60 3d e0 71 2c 01 40 00 00:00:20.275 READ FPDMA QUEUED
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed: read failure 90% 15753 76974
# 2 Extended offline Aborted by host 40% 31 -
# 3 Short offline Completed without error 00% 30 -
# 4 Extended offline Completed without error 00% 30 -
# 5 Short offline Completed without error 00% 28 -
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.
答案1
不要触碰 /etc/fstab。
您的 SMART 数据Current_Pending_Sector = 3320
表明你的硬盘可能有故障。
首先,备份您拥有的所有重要数据。
然后,我们再来fsck
一次,然后我们将对磁盘进行坏块处理,以尝试挽救我们能挽救的一切。如果坏块处理失败,请更换硬盘。
文件系统检查
- 以“试用 Ubuntu”模式启动 Ubuntu Live DVD/USB
terminal
按Ctrl+ Alt+打开窗口T- 类型
sudo fdisk -l
- 识别“Linux 文件系统”的 /dev/sdXX 设备名称
- 输入
sudo fsck -f /dev/sda5
,替换sdXX
为您之前找到的数字 fsck
如果有错误则重复命令
坏块
注意:不要中止坏块扫描!
注意:不要对 SSD 造成坏块
注意:请先备份您的重要文件!
注意:这将花费很多小时
注意:您可能面临硬盘故障
在“尝试 Ubuntu”模式下启动 Ubuntu Live DVD/USB。
在terminal
...
sudo fdisk -l
# 识别所有“Linux 文件系统”分区
sudo e2fsck -fcky /dev/sdXX
# 只读测试
或者
sudo e2fsck -fccky /dev/sdXX
# 非破坏性读写测试(受到推崇的)
-k 很重要,因为它会保存之前的坏块表,并将任何新的坏块添加到该表中。如果没有 -k,您将丢失所有之前的坏块信息。
-fccky 参数...
-f Force checking even if the file system seems clean.
-c This option causes e2fsck to use badblocks(8) program to do
a read-only scan of the device in order to find any bad blocks.
If any bad blocks are found, they are added to the bad block
inode to prevent them from being allocated to a file or direc‐
tory. If this option is specified twice, then the bad block scan
will be done using a non-destructive read-write test.
-k When combined with the -c option, any existing bad blocks in the
bad blocks list are preserved, and any new bad blocks found by
running badblocks(8) will be added to the existing bad blocks
list.
-y Assume an answer of `yes' to all questions; allows e2fsck to be
used non-interactively. This option may not be specified at the
same time as the -n or -p options.
答案2
不会,errors=remount-ro
不会损害您的系统。事实上,它旨在防止损害,因为不允许写入可能已经损坏的文件系统。
从man ext4
:
errors={continue|remount-ro|panic}
Define the behavior when an error is encountered. (Either
ignore errors and just mark the filesystem erroneous and con‐
tinue, or remount the filesystem read-only, or panic and halt
the system.) The default is set in the filesystem superblock,
and can be changed using tune2fs(8).
答案3
有时原因errors=remount-ro
很简单,因为其中一个驱动器无法安装。有一次我遇到了这种情况,因为我的 NAS IP 地址发生了变化。解决方案很简单,就是启动恢复/根 shell,编辑 /etc/fstab 文件以注释掉有问题的行,然后重新启动。