How to deal with errors=remount-ro?

6,774

Solution 1

Don't touch /etc/fstab.

Your SMART Data indicates Current_Pending_Sector = 3320 which means that your HDD is probably failing.

FIRST, backup whatever important data that you have.

Then, we'll fsck it again, and then we'll bad block the disk to try and save what we can. If bad blocking fails, replace the HDD.

fsck

  • boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode
  • open a terminal window by pressing Ctrl+Alt+T
  • type sudo fdisk -l
  • identify the /dev/sdXX device name for your "Linux Filesystem"
  • type sudo fsck -f /dev/sda5, replacing sdXX with the number you found earlier
  • repeat the fsck command if there were errors

bad block

Note: do NOT abort a bad block scan!

Note: do NOT bad block a SSD

Note: backup your important files FIRST!

Note: this will take many hours

Note: you may have a pending HDD failure

Boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode.

In terminal...

sudo fdisk -l # identify all "Linux Filesystem" partitions

sudo e2fsck -fcky /dev/sdXX # read-only test

or

sudo e2fsck -fccky /dev/sdXX # non-destructive read/write test (recommended)

The -k is important, because it saves the previous bad block table, and adds any new bad blocks to that table. Without -k, you loose all of the prior bad block information.

The -fccky parameter...

   -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.

Solution 2

No, errors=remount-ro will not harm your system. In fact, it is intended to prevent harm, by not allowing writes to a filesystem that may already be damaged.

From 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).
Share:
6,774
nanopilot
Author by

nanopilot

Updated on September 18, 2022

Comments

  • nanopilot
    nanopilot over 1 year

    Yesterday this message appeared on my screen while booting OS after powerfailure "due to low battery backup"

    You are in emergency mode, After logging in type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" or "exit" to boot into default mode. Press enter for maintenance (or press control-D to contnue):

    Following helped me getting rid of emergency mode

    fsck -y /dev/sda*

    *First I used sda7 but boot was successful for only one time and again entered into emergency mode, then i used sda5 and sda7 one by one.

    It worked for me but by applying command nano /etc/fstab or vi /etc/fstab, output is annoying as it says

    / file was on /dev/sda5 during installation ext4 errors=remount-ro 0 1

    How to deal with errors=remount-ro ? I don't know if it might harm my system.

    OS = UBUNTU 18.04


    Smartmontools result:

    === 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.
    
    • nanopilot
      nanopilot almost 4 years
      OS = UBUNTU 18.04
    • nobody
      nobody almost 4 years
      you will test your harddrive with smatmontools help.ubuntu.com/community/Smartmontools this ist a protection errors=remount-ro for your files.
    • Parsa Mousavi
      Parsa Mousavi almost 4 years
      It indicates that if there was any error during the mounting process of your filesystem , to protect it from corruption it will mount it as read-only.
    • steeldriver
      steeldriver almost 4 years
      What is the problem, exactly? You are looking at a configuration file (/etc/fstab) not a log file, and errors=remount-ro is not an error message, it's an instruction to remount in readonly mode in the event that errors occur
  • nanopilot
    nanopilot almost 4 years
    thankyou for explanation