Analysis and repair methods of Linux file system corruption

  
        

Sometimes when you maintain a Linux server, you will face the error that the file system becomes (Read Only System), that is, the file system becomes read-only. There are two reasons for this problem. This is a problem with the synchronization mechanism when writing multiple machines. Another way is when the server is powered off during a single machine write.

When this problem occurs, the application system users will be very nervous. When they are lucky, they can read the data in a read-only manner. When the luck is not good, the system will not start.

Here is a solution:

(1) Modify /etc/fstab to comment out the damaged file system first. If the file cannot be read or written, mount -o Remount rw , /Change the file system to read-write mode.

(2) For the damaged file system, execute the fsck command, such as: fsck /dev/sda1.

Note:

(1) It is best to back up the data before execution to prevent data loss after the repair fails.

Copyright © Windows knowledge All Rights Reserved